Files
notifications-admin/app/templates/views/broadcast/macros/area-map.html
Chris Hill-Scott 5ae53b625b Show broadcasts created by the API
Broadcasts created by the API are different in that:
- they aren’t created by any user, so don’t have a `created_by_id`
- they are created instantly, not in steps, so don’t have an
  `updated_at` time

This commit alters the views to account for when these pieces of
information aren’t present.
2021-01-27 11:34:43 +00: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 {{ "{:,.1f}".format(broadcast_message.simple_polygons.estimated_area) }} 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 {{ "{:,.1f}".format(broadcast_message.simple_polygons.bleed.estimated_area - broadcast_message.simple_polygons.estimated_area) }} 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 %}