diff --git a/src/postorius/templates/postorius/domain_new.html b/src/postorius/templates/postorius/domain_new.html index badbc25..50f2802 100644 --- a/src/postorius/templates/postorius/domain_new.html +++ b/src/postorius/templates/postorius/domain_new.html @@ -3,35 +3,17 @@ {% load bootstrap_tags %} {% block subtitle %} -{% trans 'Add Domain' %} +{% trans 'Add domain' %} {% endblock %} {% block main %}
- {% csrf_token %} - {{ form.non_field_errors }} - {% for field in form %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
{{ field|add_form_control }}
-

- {{ field.help_text }} -

-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal form 2 8 'Create domain' %}
{% endblock main %} diff --git a/src/postorius/templates/postorius/lib/form-horizontal.html b/src/postorius/templates/postorius/lib/form-horizontal.html new file mode 100644 index 0000000..06fe277 --- /dev/null +++ b/src/postorius/templates/postorius/lib/form-horizontal.html @@ -0,0 +1,48 @@ +{% load i18n %} +{% load bootstrap_tags %} + +{% if form.non_field_errors %} +
{{ form.non_field_errors }}
+{% endif %} + +{% csrf_token %} +{% for hidden in form.hidden_fields %} + {{ hidden }} +{% endfor %} + +{% for field in form.visible_fields %} +
+ +
+ {% if field|fieldtype == 'RadioSelect' %} + {% for choice in field %} + + {% endfor %} + {% else %} + {{ field|add_form_control }} + {% endif %} + {% for error in field.errors %} +
{{ error }}
+ {% endfor %} +
+ {% if field.help_text %} +

+ {{ field.help_text }} +

+ {% endif %} +
+{% endfor %} +{% if button %} +
+
+ +
+
+{% endif %} diff --git a/src/postorius/templates/postorius/lists/mass_removal.html b/src/postorius/templates/postorius/lists/mass_removal.html index 5e5b3c6..f1185dd 100644 --- a/src/postorius/templates/postorius/lists/mass_removal.html +++ b/src/postorius/templates/postorius/lists/mass_removal.html @@ -8,21 +8,7 @@ {% list_nav 'mass_removal' 'Mass Removal' %}
- {% csrf_token %} - {% if form.non_field_errors %} -
- {{ form.non_field_errors }} -
- {% endif %} -
- {% if form.emails.errors %} -
- {{ form.emails.errors }} -
- {% endif %} - -
{{ form.emails|add_form_control }}
-
+ {% render_form_horizontal form 2 8 %}
diff --git a/src/postorius/templates/postorius/lists/mass_subscribe.html b/src/postorius/templates/postorius/lists/mass_subscribe.html index aff0d83..7f77b1e 100644 --- a/src/postorius/templates/postorius/lists/mass_subscribe.html +++ b/src/postorius/templates/postorius/lists/mass_subscribe.html @@ -12,24 +12,7 @@ {% list_nav 'mass_subscribe' 'Mass Subscription' %} - {% csrf_token %} - {% if form.non_field_errors %} -
- {{ form.non_field_errors }} -
- {% endif %} -
- {% if form.emails.errors %} -
{{ form.emails.errors }}
- {% endif %} - -
{{ form.emails|add_form_control }}
-
-
-
- -
-
+ {% render_form_horizontal form 2 8 'Subscribe users' %} {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/memberoptions.html b/src/postorius/templates/postorius/lists/memberoptions.html index 47ade42..542581e 100644 --- a/src/postorius/templates/postorius/lists/memberoptions.html +++ b/src/postorius/templates/postorius/lists/memberoptions.html @@ -16,38 +16,7 @@

{% trans 'You are not the owner for this list' %}

{% else %}
- {% csrf_token %} - {% for field in settingsform %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
- {% if field|fieldtype == 'RadioSelect' %} - {% for choice in field %} - - {% endfor %} - - {% else %} - {{ field|add_form_control }} - {% endif %} -
-

- {{ field.help_text }} -

-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal settingsform 3 8 'Save changes' %}
{% endif %} diff --git a/src/postorius/templates/postorius/lists/new.html b/src/postorius/templates/postorius/lists/new.html index 3560ee2..5ac9807 100644 --- a/src/postorius/templates/postorius/lists/new.html +++ b/src/postorius/templates/postorius/lists/new.html @@ -13,32 +13,7 @@
- {% csrf_token %} - {% for field in form %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
- {% if field|fieldtype == 'RadioSelect' %} - {% for choice in field %} - - {% endfor %} - {% else %} - {{ field|add_form_control }} - {% endif %} -
-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal form 2 8 'Create list' %}
{% endblock %} diff --git a/src/postorius/templates/postorius/lists/settings.html b/src/postorius/templates/postorius/lists/settings.html index d37311b..84ddaf9 100644 --- a/src/postorius/templates/postorius/lists/settings.html +++ b/src/postorius/templates/postorius/lists/settings.html @@ -17,38 +17,9 @@ {% endfor %} -
- {% csrf_token %} - {% for field in form %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
- {% if field|fieldtype == 'RadioSelect' %} - {% for choice in field %} - - {% endfor %} - {% else %} - {{ field|add_form_control }} - {% endif %} -
-

- {{ field.help_text }} -

-
- {% endfor %} -
-
- -
-
+ + {% render_form_horizontal form 3 8 'Save changes' %}
{% endblock %} diff --git a/src/postorius/templates/postorius/lists/summary.html b/src/postorius/templates/postorius/lists/summary.html index 8974803..23343dc 100644 --- a/src/postorius/templates/postorius/lists/summary.html +++ b/src/postorius/templates/postorius/lists/summary.html @@ -35,24 +35,7 @@ {% trans 'You are subscribed to this list with the following address:' %} {{ subscribed_address }}

- {% csrf_token %} - {% if change_subscription_form.non_field_errors %} -
{{ change_subscription_form.non_field_errors }}
- {% endif %} - {% for field in change_subscription_form %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
{{ field|add_form_control }}
-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal change_subscription_form 2 8 'Change subscription' %}

@@ -62,24 +45,7 @@ {% else %}

{% trans 'Subscribe to this list' %}

- {% csrf_token %} - {% if subscribe_form.non_field_errors %} -
{{ subscribe_form.non_field_errors }}
- {% endif %} - {% for field in subscribe_form %} -
- {% if field.errors %} -
{{ field.errors }}
- {% endif %} - -
{{ field|add_form_control }}
-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal subscribe_form 2 8 'Subscribe' %}
{% endif %} {% else %} diff --git a/src/postorius/templates/postorius/login.html b/src/postorius/templates/postorius/login.html index 5db5ddf..4a25a97 100644 --- a/src/postorius/templates/postorius/login.html +++ b/src/postorius/templates/postorius/login.html @@ -17,28 +17,7 @@
- {% csrf_token %} - {% if form.non_field_errors %} -
{{ form.non_field_errors }}
- {% endif %} - {% for field in form %} - {% if field.errors %} -
{{ field.errors }}
- {% endif %} -
- -
- {{ field|add_form_control }} -
-
- {% endfor %} -
-
- -
-
+ {% render_form_horizontal form 4 8 'Log in' %}