-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalerts.njk
46 lines (38 loc) · 1.92 KB
/
alerts.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% if alerts %}
{% set numAlerts = alerts | calcNumAlerts %}
{% set currentAlert = 0 %}
<table class="{{ config.tableClass }} alert-table">
{% if config.ignoreToday %}
{% set alerts = alerts.splice(1) %}
{% endif %}
{% set alerts = alerts.slice(0, numAlerts) %}
{% for a in alerts %}
<tr {% if config.colored %} class="colored" {%else%} class="bright" {% endif %}>
<td class= "align-left {{a.event | alertColorCode}}" ><span>{{a.event}}</span></td>
{% if config.showEndTime %}
{% if config.alertTimeFormat === "relative" %}
<td class="bright light align-right">{{ "ends " + a.end.fromNow() | translate }}</td>
{% else %}
<td class="bright light align-right">{{ "until " + a.end.format(config.alertDateFormat) + " at " + a.end | formatTime }}</td>
{% endif %}
{% endif %}
</tr>
{% if config.showAlertDescription %}
<tr>
<td {% if config.staticAlertDescription %} class="static-description" {%else%} {% endif %} colSpan="2">
{% if not config.staticAlertDescription %} <marquee scrolldelay={{config.alertDescriptionScrollDelay}}}}> {% endif %}
<span>{{a.description}}</span>
{% if not config.alertDescription.static %} </marquee> {% endif %}
</td>
</tr>
{% endif %}
{% set currentAlert = currentAlert + 1 %}
{% endfor %}
</table>
{% else %}
<div class="dimmed light small">
{{ "LOADING" | translate }}
</div>
{% endif %}
<!-- Uncomment the line below to see the contents of the `alerts` object. -->
<!-- <div style="word-wrap:break-word" class="xsmall dimmed">{{alerts | dump}}</div> -->