Skip to content
Snippets Groups Projects
Commit fa992b24 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Make forms more consistent and move the form templates to their own folder

parent 548ffae3
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@
</div>
</div>
{% include "forms/includes/form_errors.html" with form=form %}
<div class="wrapper wrapper--medium wrapper--inner-space-medium">
<form class="form form--with-p-tags" action="" method="post" novalidate>
{{ form.media }}
......@@ -29,7 +31,7 @@
{% endifchanged %}
{% if field.field %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% else %}
{{ field }}
{% endif %}
......
......@@ -7,19 +7,7 @@
</div>
</div>
{% if form.errors or form.non_field_errors %}
<div class="wrapper wrapper--medium wrapper--error">
<svg class="icon icon--error"><use xlink:href="#error"></use></svg>
<h5 class="heading heading--no-margin heading--regular">There were some errors with your form. Please amend the fields highlighted below</h5>
{% if form.non_field_errors %}
<ul>
{% for error in form.non_field_errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% include "forms/includes/form_errors.html" with form=form %}
<div class="wrapper wrapper--light-grey-bg wrapper--form wrapper--sidebar">
<div>
......@@ -29,7 +17,7 @@
{% for field in form %}
{% if field.field %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% else %}
{{ field }}
{% endif %}
......
......@@ -32,7 +32,7 @@
{% for field in form %}
{% if field.field %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% else %}
{{ field }}
{% endif %}
......
......@@ -8,23 +8,14 @@
</div>
</div>
{% include "forms/includes/form_errors.html" with form=form %}
<div class="wrapper wrapper--medium wrapper--inner-space-medium">
{% if not has_submitted_review %}
<form class="form form--with-p-tags form--scoreable" action="" method="post" novalidate>
{{ form.media }}
{% csrf_token %}
{% if form.non_field_errors %}
<div class="messages">
<ul>
{% for error in form.non_field_errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
......@@ -40,7 +31,7 @@
{% endifchanged %}
{% if field.field %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% else %}
{{ field }}
{% endif %}
......
{% if form.errors or form.non_field_errors %}
<div class="wrapper wrapper--medium wrapper--error">
<svg class="icon icon--error"><use xlink:href="#error"></use></svg>
<h5 class="heading heading--no-margin heading--regular">There were some errors with your form. Please amend the fields highlighted below</h5>
{% if form.non_field_errors %}
<ul>
{% for error in form.non_field_errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
......@@ -16,7 +16,7 @@
<form action="" method="post" class="form">
{% csrf_token %}
{% for field in form %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% endfor %}
<button class="button button--primary" type="submit">{% trans "Update Profile" %}</button>
</form>
......
......@@ -28,7 +28,7 @@
{% csrf_token %}
{% for field in form %}
{% include "funds/includes/field.html" %}
{% include "forms/includes/field.html" %}
{% endfor %}
<button class="button button--primary" type="submit">{% trans 'Reset password' %}</button>
......
......@@ -105,6 +105,7 @@ TEMPLATES = [
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(PROJECT_DIR, 'templates'),
os.path.join(PROJECT_DIR, 'apply', 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment