{% 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:'' }} {{ label }} {% 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' %} {% for header in table_headers %} {% if forloop.counter == 1 %} {% elif forloop.counter == 3 %} {% elif forloop.counter == 4 %} {% endif %} {% endfor %} {% else %} {% for header in table_headers %} {% if forloop.counter == 1 %} {% elif forloop.counter == 2 %} {% elif forloop.counter == 3 %} {% endif %} {% endfor %} {% endif %} {% 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' %} {% for k, values in qg %} {% if forloop.counter == 2 or forloop.counter == 5 %} {% elif forloop.counter == 4 or forloop.counter == 7 %} {% elif forloop.counter == 3 or forloop.counter == 6 %} {% endif %} {% if forloop.counter == 4 %} {% endif %} {% endfor %} {% else %} {% if questiongroup.layout != 'no_label_row' %} {% endif %} {% for k, values in qg %} {% if forloop.counter == 1 or forloop.counter == 4 %} {% elif forloop.counter == 3 or forloop.counter == 6 %} {% else %} {% endif %} {% if forloop.counter == 3 %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{{ table_headers.0 }}{{ header }}{{ header }}{{ header }}{{ header }}
{{ qg.0.1.0 }}{{ k }} {% 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 %}
{{ questiongroup.label }}{{ k }} {% 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 %}