{% comment %} A question and then a table. A table with 2 columns, each cell containing a question. If there are more than 2 questions, additional rows are created.Table headers are only created for the first 2 questions! No buttons to add or remove additional questiongroups! config: The configuration of the questiongroup formset: The (repeating) forms as formset {% endcomment %} {% load i18n %} {% load floppyforms %} {% load list_to_columns %} {{ formset.management_form }} {% include "form/errors.html" with errors=formset.non_form_errors %} {% for qg_form in formset.forms %}
{# First question #}
{% for field in qg_form.visible_fields %} {% if forloop.first %} {% with template=config.templates|get_by_keyword:field.name options=config.options|get_by_keyword:field.name %} {% if template %} {% formrow field using template %} {% else %} {% formrow field using "form/question/default.html" %} {% endif %} {% endwith %} {% endif %} {% endfor %}
{# Other questions: As table #}
{% for field in qg_form.visible_fields %} {% if forloop.counter > 1 %} {% endif %} {% endfor %} {% for field in qg_form.visible_fields %} {% if forloop.counter > 1 %} {% endif %} {% for field in qg_form.hidden_fields %}{% formfield field %}{% endfor %} {% endfor %}
{{ field.label }}
{% formrow field using "form/question/no_label.html" %}
{% endfor %}