* 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
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			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 %}">
 | 
						|
            {{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-{{form.label_input_ratio.1}}">
 | 
						|
                {{ 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> |