{% comment %} Basically the same as table_4 but without the
. Table where each questiongroup occupies one row. The first column is filled with the label of the questiongroup. If there are more than XY questions, the first two are rendered in the first td Further questions are rendered either before the table (questiongroup_config.layout == 'before_table') or after the table. {% endcomment %} {% load floppyforms %} {% load list_to_columns %} {% if config.next_level == 'subcategories' %}

{{ config.label }}

{% for sub_config, sub_formsets in formsets %} {% form form using sub_config.form_template with config=sub_config formsets=sub_formsets %} {% endfor %} {% else %}

{{ config.label }}

{% for questiongroup_config, questiongroup_formset in formsets %} {% if questiongroup_config.keyword not in config.table_grouping.0 and questiongroup_config.layout == 'before_table' %} {% include "form/helptext.html" with helptext=questiongroup_config.helptext helptext_length=questiongroup_config.helptext_length %} {% form form using "form/questiongroup/default.html" with config=questiongroup_config formset=questiongroup_formset %} {% endif %} {% endfor %} {% if config.layout != 'no_label_row' %} {% endif %} {% for header in config.table_headers %} {% endfor %} {% for questiongroup_config, questiongroup_formset in formsets %} {% if questiongroup_config.keyword in config.table_grouping.0 %} {{ questiongroup_formset.management_form }} {% for qg_form in questiongroup_formset.forms %} {% if questiongroup_config.layout != 'no_label_row' %} {% endif %} {% for field in qg_form.visible_fields %} {% endfor %} {% for field in qg_form.hidden_fields %}{% formfield field %}{% endfor %} {% endfor %} {% endif %} {% endfor %}
{% with helptext=config.table_helptexts|get_by_index:forloop.counter0 %} {% if helptext %} {{ header }} {% else %} {{ header }} {% endif %} {% endwith %}
{% if questiongroup_config.helptext %} {{ questiongroup_config.label }} {% else %} {{ questiongroup_config.label }} {% endif %} {% if qg_form.visible_fields|length == 3 %} {% endif %} {% formrow field using "form/question/no_label.html" %}
{% for questiongroup_config, questiongroup_formset in formsets %} {% if questiongroup_config.keyword not in config.table_grouping.0 and questiongroup_config.layout != 'before_table' %} {% include "form/helptext.html" with helptext=questiongroup_config.helptext helptext_length=questiongroup_config.helptext_length %} {% form form using "form/questiongroup/default.html" with config=questiongroup_config formset=questiongroup_formset %} {% endif %} {% endfor %} {% endif %}