{% load list_to_columns %} {% comment %} Table where each questiongroup occupies one row. The first column is filled with the label of the questiongroup. Further questions are rendered either before the table (questiongroup_config.layout == 'before_table') or after the table. {% endcomment %} <{{ label_tag|default:"h5" }}{% if label_class %} class="{{ label_class }}"{% endif %}>{{ numbering|default:'' }} {% if subcategories %} {% for subcategory in subcategories %} {{ subcategory }} {% endfor %} {% else %} {% for qg_config, qg_rendered in questiongroups %} {% if qg_config.layout == 'before_table' %} {{ qg_rendered }} {% endif %} {% endfor %} {% if raw_questiongroups %} {% if layout != 'no_label_row' %} {% endif %} {% for header in table_headers %} {% if forloop.counter == 1 %} {% else %} {% endif %} {% endfor %} {% for questiongroup in raw_questiongroups %} {% if questiongroup.qg_keyword in table_grouping.0 %} {% for qg in questiongroup.data_labelled %} {% if questiongroup.layout != 'no_label_row' %} {% endif %} {% for k, values in qg %} {% if forloop.counter == 2 and qg|length == 2 %} {% elif forloop.counter == 3 and qg|length == 3 %} {% else %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% endfor %}
{{ header }}{{ header }}
{{ questiongroup.label }} {% include 'details/field/year_bar.html' with selected_months=questiongroup.data|get_by_index:forloop.parentloop.counter0|get_by_index:forloop.counter0|get_by_index:1 %} {% include 'details/field/year_bar.html' with selected_months=questiongroup.data|get_by_index:forloop.parentloop.counter0|get_by_index:forloop.counter0|get_by_index:1 %} {% for v in values %} {{ v }} {% endfor %}
{% endif %} {% for qg_config, qg_rendered in questiongroups %} {% if qg_config.layout != 'before_table' %} {{ qg_rendered }} {% endif %} {% endfor %} {% endif %}