Use seperate form dir
This commit is contained in:
parent
b866f48e3b
commit
880ae577bd
3 changed files with 10 additions and 8 deletions
3
src/newsreader/templates/form/errors.html
Normal file
3
src/newsreader/templates/form/errors.html
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<section class="section form__section form__section--errors">
|
||||||
|
{{ form.non_field_errors }}
|
||||||
|
</section>
|
||||||
|
|
@ -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 %}
|
||||||
3
src/newsreader/templates/form/title.html
Normal file
3
src/newsreader/templates/form/title.html
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<section class="section form__header">
|
||||||
|
<h1 class="h1 form__title">{{ title }}</h1>
|
||||||
|
</section>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue