{% extends "base.html" %} {% comment %}This view is used to create or edit a ``mtp.apps.surveys.Pool`` instance. The author field is not displayed: it must be set to the current user when saving the pool, by the view. Context ------- user : instance of ``mtp.apps.accounts.MTPUser`` The user is expected to be a superuser or a trainer. pool : instance of ``mtp.apps.surveys.models.Pool`` The pool to edit or create. form : instance of ``django.forms.models.ModelForm`` The form to created/edit the pool (pre-filled if it's an edition). Notes ----- If ``pool.pk`` is "falsy", then we assume that's it's new pool to be created, else it's an existing pool to update. {% endcomment %} {% load i18n %} {% block body_class %}{{ block.super }} page-cms-surveys page-cms-surveys-pools{% endblock %} {% block subtitle %} {% if pool.pk %} {% blocktrans with pool_name=pool.name %}Edit the pool of questions "{{ pool_name }}"{% endblocktrans %} {% else %} {% if user.is_superuser %} {% trans 'New global pool of questions' %} {% else %} {% trans 'New pool of questions' %} {% endif %} {% endif %} {% endblock %} {% block actions %} {% trans 'Back to the list of pools' %} {% if pool.pk %} {% trans 'Manage questions' %} {% endif %} {% endblock %} {% block main %} {% if form.errors %}
{% trans 'Please correct errors below.' %} {% if form.non_field_errors %} {{ form.non_field_errors }} {% endif %}
{% endif %}
{% csrf_token %} {{ form.media }} {% for field in form %} {% endfor %}
{{ field.label_tag }} {% if field.errors %}
{{ field.errors }}
{% endif %} {{ field }}
{% if pool.pk %} {% trans 'Delete this pool' %} {% else %} {% endif %}
{% endblock %}