{% extends "base.html" %} {% comment %}This view is used to create or edit a ``mtp.apps.surveys.Question`` instance. Context ------- pool : instance of ``mtp.apps.surveys.models.Pool`` The pool for which we display the questions. question : instance of ``mtp.apps.surveys.models.Question`` The question to edit or create. form : instance of ``django.forms.models.ModelForm`` The form to created/edit the question (pre-filled if it's an edition). choices_formset : instance of ``mtp.apps.surveys.forms.ChoicesFormSet`` The editable list of choices for the current question. Notes ----- If ``question.pk`` is "falsy", then we assume that's it's new question to be created, else it's an existing question to update. {% endcomment %} {% load i18n template_tools %} {% block body_class %}{{ block.super }} page-cms-surveys page-cms-surveys-questions{% endblock %} {% block head %} {{ block.super }} {% include "cms/includes/orderable-inline-head.html" %} {% endblock %} {% block subtitle %} {% if question.pk %} {% blocktrans trimmed with pool_name=pool.name question_title=question.title %} Edit the question "{{ question_title }}" of the pool "{{ pool_name }}" {% endblocktrans %} {% else %} {% blocktrans trimmed with pool_name=pool.name %} Add a question in the pool "{{ pool_name }}" {% endblocktrans %} {% endif %} {% endblock %} {% block actions %} {% trans 'Back to the list of questions' %} {% trans 'Back to the pool' %} {% endblock %} {% block main %} {% if form.errors or choices_formset.errors %}