Files
notifications-admin/app/templates/views/broadcast/macros/area-map.html
Chris Hill-Scott 2accf8434a Remove false precision from area estimates
We give estimates of the area for those who can’t see the map. These
estimates were needlessly precise, gave a false sense of accuracy and
were causing intermittent test failures between different environments.

This commit rounds them in the same way that we round the count of
phones.
2021-07-06 17:00:51 +01:00

33 lines
1.3 KiB
HTML

{% macro map(broadcast_message) %}
<div id="area-list-map"></div>
<ul>
<li class="area-list-key area-list-key--certain">
<span class="visually-hidden">
An area of {{ (broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles
</span>
Will get
<span class="visually-hidden">the</span>
alert
</li>
<li class="area-list-key area-list-key--likely">
<span class="visually-hidden">
An extra area of {{ (broadcast_message.simple_polygons_with_bleed.estimated_area - broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles is
</span>
Likely to get
<span class="visually-hidden">
the
</span>
alert
</li>
<li class="area-list-key area-list-key--phone-estimate">
{% if broadcast_message.count_of_phones == 0 %}
Unknown number of phones
{% elif broadcast_message.count_of_phones == broadcast_message.count_of_phones_likely %}
{{ broadcast_message.count_of_phones|format_thousands }} phones estimated
{% else %}
{{ broadcast_message.count_of_phones|format_thousands }} to {{ broadcast_message.count_of_phones_likely|format_thousands }} phones
{% endif %}
</li>
</ul>
{% endmacro %}