Commits

Borislav Borisov committed 06e15dc Draft

Indent the templates a bit

Comments (0)

Files changed (3)

form_utils/templates/form_utils/better_form.html

 {% extends "form_utils/form.html" %}
 
 {% block fields %}
-{% for fieldset in form.fieldsets %}
-<fieldset class="{{ fieldset.classes }}">
-{% if fieldset.legend %}
-<legend>{{ fieldset.legend }}</legend>
-{% endif %}
-<ul>
-{% with fieldset as fields %}
-{% include "form_utils/fields_as_lis.html" %}
-{% endwith %}
-</ul>
-</fieldset>
-{% endfor %}
-{% endblock %}
+    {% for fieldset in form.fieldsets %}
+    <fieldset class="{{ fieldset.classes }}">
+        {% if fieldset.legend %}
+        <legend>{{ fieldset.legend }}</legend>
+        {% endif %}
+        <ul>
+        {% with fieldset as fields %}
+            {% include "form_utils/fields_as_lis.html" %}
+        {% endwith %}
+        </ul>
+    </fieldset>
+    {% endfor %}
+{% endblock fields %}

form_utils/templates/form_utils/fields_as_lis.html

 {% for field in fields %}
-{% if field.is_hidden %}
-{{ field }}
-{% else %}
-<li{{ field.row_attrs }}>
-  {{ field.errors }}
-  {{ field.label_tag }}
-  {{ field }}
-</li>
-{% endif %}
+    {% if field.is_hidden %}
+        {{ field }}
+    {% else %}
+        <li{{ field.row_attrs }}>
+            {{ field.errors }}
+            {{ field.label_tag }}
+            {{ field }}
+        </li>
+    {% endif %}
 {% endfor %}

form_utils/templates/form_utils/form.html

 {% block errors %}
-{% if form.non_field_errors %}{{ form.non_field_errors }}{% endif %}
+    {% if form.non_field_errors %}{{ form.non_field_errors }}{% endif %}
 {% endblock %}
 
 {% block fields %}
-<fieldset class="fieldset_main">
-<ul>
-{% with form as fields %}
-{% include "form_utils/fields_as_lis.html" %}
-{% endwith %}
-</ul>
-</fieldset>
+    <fieldset class="fieldset_main">
+    <ul>
+    {% with form as fields %}
+        {% include "form_utils/fields_as_lis.html" %}
+    {% endwith %}
+    </ul>
+    </fieldset>
 {% endblock %}