{% set categories = component_attributes.get_unique_values("category") %}
{% for cat in categories|sort %}
-
-
-
- {{ cat }}
-
+ {# Filtering components for category #}
+ {% set filtered_components = [] %}
+ {% for component in all_components_with_incidents %}
+ {% with attrs = component.get_attributes_as_dict() %}
+ {% if 'region' in attrs and attrs['region'] == region and 'category' in attrs and attrs['category'] == cat %}
+ {% set _ = filtered_components.append(component) %}
+ {% endif %}
+ {% endwith %}
+ {% endfor %}
-
- {% for component in all_components_with_incidents %}
- {% with attrs = component.get_attributes_as_dict() %}
- {% if 'region' in attrs and attrs['region'] == region and 'category' in attrs and attrs['category'] == cat %}
-