Template enhancements

* adds configurable label-input ratio setting for forms and specializes for RemoveModalForm
* enhances form body html structure for better UX and usage of label-input ratio
This commit is contained in:
2022-12-08 09:48:01 +01:00
parent e85065d43b
commit 0f6867605e
4 changed files with 31 additions and 5 deletions

View File

@@ -4,12 +4,18 @@
<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>
{{form.small_label_column}}
<th scope="row" class="col-sm-{{form.label_input_ratio.0}}">
<label for="id_{{ field.name }}">
{{ field.label }}
<span class="label-required">
{% if field.field.required %}*{% endif %}
</span>
<br>
<small>{{ field.help_text }}</small>
</label>
</th>
<td class="col-sm-9">
<td class="col-sm-{{form.label_input_ratio.1}}">
{{ field }}
{% for error in field.errors %}
<br>