{% extends "base.html" %}
{% load i18n chunks %}
-{% block "titleextra" %}{{ form.form_title }} :: {% endblock %}
-
-{% block "body" %}
+{% block titleextra %}{{ form.form_title }} :: {% endblock %}
+{% block body %}
<h1>{% block contact_form_title %}{{ form.form_title }}{% endblock %}</h1>
- <div class="form-info">
- {% block contact_form_description %}
- {% chunk "contact_form__"|add:form.form_tag %}
- {% endblock %}
- </div>
+{% if not form.started %}
+ {# Not yet started. #}
+ <div class="form-info">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__not_started" %}
+ </div>
+{% else %}
+ {# Already started. #}
{% if form.limit_reached %}
- <div class="warning">
- {% chunk "contact_form__"|add:form.form_tag|add:"__full" %}
+ {# Already closed. #}
+ <div class="form-info">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__closed" %}
</div>
{% else %}
+ {# Still running. #}
+ <div class="form-info">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__running" %}
+ </div>
<form method="POST" action="." enctype="multipart/form-data" class="submit-form">
- {% csrf_token %}
- <table>
- {{ form.as_table }}
+ {% csrf_token %}
+ <table>
+ {% if form.non_field_errors %}<tr><td colspan="2">{{ form.non_field_errors }}</td></tr>{% endif %}
+ {% for field in form.main_fields %}
+ {% include "snippets/field_as_table_row.html" %}
+ {% endfor %}
+ {% if form.survey_fields %}
+ <tr><td colspan="2"><h3>{% trans "We would be grateful if you could answer our questions below. This will allow us to better adapt to your expectations in the future." %}</h3></td></tr>
+ {% for field in form.survey_fields %}
+ {% include "snippets/field_as_table_row.html" %}
+ {% endfor %}
+ {% endif %}
+ <tr><td colspan="2"></td></tr>
+ {% for field in form.agreement_fields %}
+ {% include "snippets/field_as_table_row.html" %}
+ {% endfor %}
+ <tr><td></td><td>{% chunk "contact_form__"|add:form.form_tag|add:"__data_processing" %}</td></tr>
<tr><td></td><td><button>{% block contact_form_submit %}{{ form.submit_label }}{% endblock %}</button></td></tr>
- </table>
+ </table>
</form>
{% endif %}
+{% endif %}
+
+<script type="text/javascript">
+ var travelGrantCountries = [
+ {% for country in form.travel_grant_countries %}
+ '{{ country }}'{% if not forloop.last %},{% endif %}
+ {% endfor %}
+ ];
+</script>
{% endblock %}