Commit 9485eea3 authored by Zachary Seguin's avatar Zachary Seguin

Sort affected areas alphabetically (Resolves #28)

parent 913b0153
Pipeline #156 passed with stages
in 7 minutes and 32 seconds
......@@ -94,7 +94,7 @@
<h2 id="title" class="page-title">{{ _('Affected areas') }}</h2>
<ul class="no-bullet">
{% for area in info.areas %}
{% for area in info.areas | sort(attribute='description') %}
<li>{{ area.description }}</li>
{% endfor %}
</ul>
......@@ -102,7 +102,7 @@
<a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
{% else %}
{% for area in info.areas %}
{% for area in info.areas | sort(attribute='description') %}
<dd>{{ area.description }}</dd>
{% endfor %}
{% endif %}
......
......@@ -30,7 +30,7 @@
<dt>{{ _('Effective') }} &mdash; {{ _('Expires') }}</dt>
<dd>{{ info.effective | localize | short_datetime }} &mdash; {{ info.expires | localize | short_datetime }}</dd>
<dt>{{ _('Affected areas') }}</dt>
<dd>{% if 'layer:EC-MSC-SMC:1.0:Alert_Coverage' in info.parameters and len(info.areas) > 6 %} {{ info.parameters['layer:EC-MSC-SMC:1.0:Alert_Coverage'] }} ({{ info.areas | length }} {{ _('affected areas') }}) {% else %} {% for area in info.areas %}{% if not loop.first %}{% if loop.last %} {{ 'AND' | translate }} {% else %}, {% endif %}{% endif %}{{ area.description }}{% endfor %} {% endif %}</dd>
<dd>{% if 'layer:EC-MSC-SMC:1.0:Alert_Coverage' in info.parameters and len(info.areas) > 6 %} {{ info.parameters['layer:EC-MSC-SMC:1.0:Alert_Coverage'] }} ({{ info.areas | length }} {{ _('affected areas') }}) {% else %} {% for area in info.areas | sort(attribute='description') %}{% if not loop.first %}{% if loop.last %} {{ 'AND' | translate }} {% else %}, {% endif %}{% endif %}{{ area.description }}{% endfor %} {% endif %}</dd>
</dl>
</div>
<div class="medium-5 columns text-right-if-not-small uppercase">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment