{% 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_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 %}
{% endif %} {% for header in table_headers %} {% if forloop.counter == 1 %} | {{ header }} | {% else %}{{ header }} | {% endif %} {% endfor %}|
---|---|---|---|
{{ questiongroup.label }} | {% endif %} {% for k, values in qg %} {% if forloop.counter == 2 and qg|length == 2 %}{% 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 and qg|length == 3 %}{% 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 %} {% endfor %}