Use seperate form dir

This commit is contained in:
sonny 2020-05-14 21:08:38 +02:00
parent b866f48e3b
commit 880ae577bd
3 changed files with 10 additions and 8 deletions

View file

@ -0,0 +1,3 @@
<section class="section form__section form__section--errors">
{{ form.non_field_errors }}
</section>

View file

@ -4,20 +4,16 @@
{% csrf_token %} {% csrf_token %}
{% if form.non_field_errors %} {% if form.non_field_errors %}
<section class="section form__errors"> {% include "form/errors.html" title=title %}
{{ form.non_field_errors }}
</section>
{% endif %} {% endif %}
{% if title %} {% if title %}
<section class="section form__header"> {% include "form/title.html" title=title %}
<h1 class="h1 form__title">{{ title }}</h1>
</section>
{% endif %} {% endif %}
<section class="section form__section"> <section class="section form__section">
{% for field in form %} {% for field in form %}
<fieldset class="form__fieldset"> <fieldset class="fieldset form__fieldset">
<label class="label form__label" for="{{ field.name }}"> <label class="label form__label" for="{{ field.name }}">
{{ field.label }} {{ field.label }}
</label> </label>
@ -30,7 +26,7 @@
</section> </section>
<section class="section form__section--last"> <section class="section form__section--last">
<fieldset class="form__fieldset"> <fieldset class="fieldset form__fieldset">
{% if cancel_url %} {% if cancel_url %}
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a> <a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
{% endif %} {% endif %}

View file

@ -0,0 +1,3 @@
<section class="section form__header">
<h1 class="h1 form__title">{{ title }}</h1>
</section>