|
| 1 | +<h2 class="usa-sr-only">{{ "alerts.heading+aria.alerts.01" | t }}</h2> |
| 2 | +<div class="grid-container padding-x-2 desktop:padding-x-4"> |
| 3 | + <div class="grid-row"> |
| 4 | + <div class="grid-col-12"> |
| 5 | + <wx-alerts class="display-block"> |
| 6 | + {% for alert in alerts %} |
| 7 | + <div class="usa-accordion usa-accordion--bordered margin-bottom-1" id="alert_{{ alert.id }}"> |
| 8 | + <h3 class="usa-accordion__heading font-heading-lg"> |
| 9 | + <button |
| 10 | + type="button" |
| 11 | + class="usa-accordion__button text-ls-1" |
| 12 | + aria-expanded="true" |
| 13 | + aria-controls="a{{ alert.id }}" |
| 14 | + data-button-for="#alert_{{alert.id}}"> |
| 15 | + {{ alert.event | t }} |
| 16 | + </button> |
| 17 | + </h3> |
| 18 | + <div id="a{{alert.id}}" class="usa-accordion__content usa-prose"> |
| 19 | + <p class="font-sans-md text-bold text-primary-darker margin-y-0" > |
| 20 | + {% if alert.timing.end %} |
| 21 | + {% trans_with_args "alerts.text.in-effect-from-until.01" with start=alert.timing.start end=alert.timing.end %} |
| 22 | + {% else %} |
| 23 | + {% trans_with_args "alerts.text.in-effect-from.01" with start=alert.timing.start %} |
| 24 | + {% endif %} |
| 25 | + </p> |
| 26 | + <p class="margin-y-05"> |
| 27 | + {% trans_with_args "alerts.text.issued-by.01" with sender=alert.sender %} |
| 28 | + </p> |
| 29 | + |
| 30 | + {% comment %} |
| 31 | + # We don't translate alert descriptions for now. There is a larger |
| 32 | + # effort to do those translations in realtime and we will try to hook |
| 33 | + # into that when the time comes. For now... we can't really do anything. |
| 34 | + {% endcomment %} |
| 35 | + {% for element in alert.description %} |
| 36 | + {% if element.type == "heading" %} |
| 37 | + <h4 class="wx-visual-h3 text-normal text-primary-dark">{{ element.text | title }}</h4> |
| 38 | + {% elif element.type == "paragraph" %} |
| 39 | + <p> |
| 40 | + {% for node in element.nodes %} |
| 41 | + {% if node.type == "link" %} |
| 42 | + <a href="{{node.url}}" class="usa-link{% if node.external %} usa-link--external{% endif %}"> |
| 43 | + {{node.url}} |
| 44 | + </a> |
| 45 | + {% else %} |
| 46 | + {{ node.content }} |
| 47 | + {% endif %} |
| 48 | + {% endfor %} |
| 49 | + </p> |
| 50 | + {% else %} |
| 51 | + {{ node }} |
| 52 | + {% endif %} |
| 53 | + {% endfor %} |
| 54 | + |
| 55 | + {% if alert.instruction %} |
| 56 | + <h4 class="wx-visual-h3 text-normal text-primary-dark">{{ "alerts.labels.what-to-do.01" | t }}</h4> |
| 57 | + <p> |
| 58 | + {{ alert.instruction | normalize_alert_whitespace }} |
| 59 | + </p> |
| 60 | + {% endif %} |
| 61 | + |
| 62 | + <hr class="border-base-light"> |
| 63 | + |
| 64 | + <div class="grid-container margin-0 padding-0"> |
| 65 | + <div class="grid-row"> |
| 66 | + <div class="grid-col-12 tablet-lg:grid-col-6"> |
| 67 | + <h4 class="wx-visual-h3 text-normal text-primary-dark margin-bottom-05">{{ "alerts.labels.areas-impacted.01" |t }}</h4> |
| 68 | + {% comment %} |
| 69 | + # Some alerts come with location information in the description text |
| 70 | + # in a common text formatting. In those cases, the location information |
| 71 | + # is lists of counties by region of the state, and sometimes a list of |
| 72 | + # impacted cities as well. When we have that more fine-grained data, |
| 73 | + # we will display it. |
| 74 | + {% endcomment %} |
| 75 | + {% if alert.locations != false %} |
| 76 | + {% for area in alert.locations.regions %} |
| 77 | + <wx-alert-county-region> |
| 78 | + <h5 class="wx-visual-h4 text-normal text-primary-dark margin-top-205 margin-bottom-0"> |
| 79 | + {% trans_with_args "alerts.text.counties-in.01" with area=area.area %} |
| 80 | + </h5> |
| 81 | + <ul class="usa-list margin-top-1 {% if area.counties|length > 7 %} wx-col-2 {% endif %}"> |
| 82 | + {% for county in area.counties %} |
| 83 | + <li class="">{{ county }}</li> |
| 84 | + {% endfor %} |
| 85 | + </ul> |
| 86 | + </wx-alert-county-region> |
| 87 | + {% endfor %} |
| 88 | + {% if alert.locations.cities|length > 0 %} |
| 89 | + <wx-alert-cities> |
| 90 | + <h5 class="wx-visual-h4 text-normal text-primary-dark margin-top-105 margin-bottom-0"> |
| 91 | + {{ "alerts.text.including-cities.01" | t }} |
| 92 | + </h5> |
| 93 | + <ul class="usa-list margin-top-1 {% if alert.locations.cities|length > 7 %} wx-col-2 {% endif %}"> |
| 94 | + |
| 95 | + {% for city in alert.locations.cities %} |
| 96 | + <li class="">{{ city }}</li> |
| 97 | + {% endfor %} |
| 98 | + </ul> |
| 99 | + </wx-alert-cities> |
| 100 | + {% endif %} |
| 101 | + |
| 102 | + {% comment %} |
| 103 | + # If the alert doesn't have that location information in the description |
| 104 | + # text, we can use the list of impacted areas provided by AWIPS. This |
| 105 | + # list is based on the alert polygon drawn by a forecaster, and then |
| 106 | + # AWIPS identifies the areas. |
| 107 | + {% endcomment %} |
| 108 | + {% else %} |
| 109 | + <ul class="usa-list {% if alert.area|length > 7 %} wx-col-2 {% endif %}"> |
| 110 | + {% for areaName in alert.area %} |
| 111 | + <li class="">{{ areaName }}</li> |
| 112 | + {% endfor %} |
| 113 | + </ul> |
| 114 | + {% endif %} |
| 115 | + </div> |
| 116 | + |
| 117 | + <div class="grid-col-12 tablet-lg:grid-col-6 margin-top-3"> |
| 118 | + <wx-alert-map class="display-block grid-col-12 wx-radar-container wx-isolation-isolate" |
| 119 | + data-geo-json="{{ alert.geometry | json_encode | urlencode }}" |
| 120 | + data-alert-id="{{ alert.id }}" |
| 121 | + data-alert-level="{{ alert.metadata.level.text }}" |
| 122 | + data-lat="{{ point.point.latitude }}" |
| 123 | + data-lon="{{ point.point.longitude }}" |
| 124 | + data-alert-name="{{ alert.event }}" |
| 125 | + > |
| 126 | + <div id="wx_alert_map_{{ alert.id }}" class="height-full"></div> |
| 127 | + <div class="wx_alert_map_legend margin-top-3 display-flex flex-align-center"> |
| 128 | + <div class="wx_alert_map_legend_impact_area display-block width-3 height-3 border-2px margin-right-1"></div><span>{{ "alerts.legend.impacted-area.01" | t }}</span> |
| 129 | + </div> |
| 130 | + </wx-alert-map> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + </div> |
| 134 | + |
| 135 | + <hr class="border-base-light"> |
| 136 | + |
| 137 | + <!-- Dynamic Safety Information should go here! --> |
| 138 | + {#{ drupal_block("weathergov_dynamic_safety_information", { weather_event: alert.event }) }#} |
| 139 | + |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + {% endfor %} |
| 143 | + </wx-alerts> |
| 144 | + </div> |
| 145 | + </div> |
| 146 | +</div> |
0 commit comments