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