diff --git a/froide_govplan/templates/cms/mypage.html b/froide_govplan/templates/cms/mypage.html index 95d393d..a0de719 100644 --- a/froide_govplan/templates/cms/mypage.html +++ b/froide_govplan/templates/cms/mypage.html @@ -30,6 +30,7 @@ {% block css %} +
- + +
+
+
+ + + +
+ + + +
+ + + +
+
+ {% for section in sections %}
diff --git a/froide_govplan/templates/helper/forms/bootstrap_field.html b/froide_govplan/templates/helper/forms/bootstrap_field.html new file mode 100644 index 0000000..ca006b2 --- /dev/null +++ b/froide_govplan/templates/helper/forms/bootstrap_field.html @@ -0,0 +1,58 @@ +{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text required=field.field.required %} + {% if field_type == "radio" or is_checkboxmultiple %} +
+ {{ label }} +
+ {% for widget in field %}
{{ widget }}
{% endfor %} + {% if help_text %}
{{ help_text }}
{% endif %} + {% if field.errors %} +
{% include "helper/forms/errors.html" with errors=field.errors %}
+ {% endif %} +
+
+ {% elif field_type == "checkbox" %} +
+
+
+ {{ field }} + + {% if help_text %}
{{ help_text }}
{% endif %} + {% if field.errors %} +
{% include "helper/forms/errors.html" with errors=field.errors %}
+ {% endif %} +
+
+
+ {% elif label and not field.id_for_label %} +
+ {{ label }} +
+ {{ field }} + {% if help_text %}
{{ help_text }}
{% endif %} + {% if field.errors %} +
{% include "helper/forms/errors.html" with errors=field.errors %}
+ {% endif %} +
+
+ {% else %} +
+ {% if label %} + {% if field.id_for_label %} + {% endif %} + {% endif %} +
+ {{ field }} + {% if help_text %}
{{ help_text }}
{% endif %} + {% if field.errors %} +
{% include "helper/forms/errors.html" with errors=field.errors %}
+ {% endif %} +
+
+ {% endif %} +{% endwith %} + diff --git a/froide_govplan/templates/helper/forms/bootstrap_form.html b/froide_govplan/templates/helper/forms/bootstrap_form.html new file mode 100644 index 0000000..0d5e58c --- /dev/null +++ b/froide_govplan/templates/helper/forms/bootstrap_form.html @@ -0,0 +1,17 @@ +{% load form_helper %} +{% if form.non_field_errors %} +
+ {% for error in form.non_field_errors %} + {{ error }} + {% if not forloop.last %}
{% endif %} + {% endfor %} +
+{% endif %} +{% for field in form.hidden_fields %} + {% include "helper/forms/errors.html" with errors=field.errors %} +{% endfor %} +{% for field in form.visible_fields %} + {% render_field field horizontal %} +{% endfor %} +{% for field in form.hidden_fields %}{{ field }}{% endfor %} +