konova/templates/form/table/generic_table_form_body.html
mipel 86ed11c907 #7 New Form
* refactors/renames folders and files for generic template rendering
* removes unused choiceColumnForm.html
2021-10-06 16:15:40 +02:00

26 lines
932 B
HTML

{% load i18n %}
<div class="table-responsive">
<table class="table">
<tbody>
{% for field in form %}
<tr title="{{ field.help_text }}" class="{% if field.errors %}alert-danger{% endif %}">
<th scope="row" class="col-sm-3">
<label for="id_{{ field.name }}">{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></label>
<br>
<small>{{ field.help_text }}</small>
</th>
<td class="col-sm-9">
{{ field }}
{% for error in field.errors %}
<br>
<strong class="invalid">{{ error }}</strong>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if form.has_required_fields %}
<small>{% trans 'Fields with * are required.' %}</small>
{% endif %}
</div>