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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
[% IF alerts.size %]
<h3>[% loc("User's alerts") %]</h3>
<form method="POST">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="update_alerts" value="1" >
<table>
<tr>
<th>[% loc('ID') %]</th>
<th>[% loc('Type') %]</th>
<th>[% loc('Confirmed') %]</th>
<th>[% loc('State') %]</th>
<th>[% loc('Details') %]</th>
<th>[% loc('Enable') %]</th>
<th>[% loc('Disable') %]</th>
<th>[% loc('Delete') %]</th>
</tr>
[% FOREACH alert IN alerts %]
<tr>
<td>[% alert.id %]</td>
<td>[% alert.alert_type.ref %]</td>
<td>[% IF alert.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% loc('Subscribed:') %] [% alert.whensubscribed %]
<br>[% loc('Disabled:') %] [% alert.whendisabled %]
</td>
<td>
[% SWITCH alert.alert_type.ref %]
[% CASE 'new_updates' %]
[% tprintf( loc('New updates on report <a href="%s">%s</a>'), c.uri_for( '/report', alert.parameter ), alert.parameter ) %]
[% CASE 'local_problems' %]
[% tprintf( loc('New problems near <a href="%s">%s,%s</a>'), c.uri_for( '/around', { lon => alert.parameter, lat => alert.parameter2 } ), alert.parameter, alert.parameter2 ) %]
[% CASE 'ward_problems' %]
[% body = alert.parameter %]
[% ward = alert.parameter2 %]
[% IF alert_areas.$ward AND body_names.$body %]
[% tprintf( loc('New problems for <a href="%s">%s</a> ward in <a href="%s">%s</a>'), c.uri_for('/reports', body_names.$body, alert_areas.$ward.name), alert_areas.$ward.name, c.uri_for('/reports', body_names.$body), body_names.$body ) %]
[% ELSE %]
[% tprintf( loc('New problems for ward id %s in body id %s'), alert.parameter2, body ) %]
[% END %]
[% CASE 'council_problems' %]
[% body = alert.parameter %]
[% IF body_names.$body %]
[% tprintf( loc('New problems for <a href="%s">%s</a>'), c.uri_for('/reports', body_names.$body) body_names.$body ) %]
[% ELSE %]
[% tprintf( loc('New problems for %s'), body ) %]
[% END %]
[% CASE 'area_problems' %]
[% tprintf( loc('New problems for area id <a href="%s">%s</a>'), c.config.MAPIT_URL _ 'area/' _ alert.parameter _ '.html', alert.parameter ) %]
[% CASE %]
[% alert.parameter %] [% alert.parameter2 %]
[% END %]
</td>
<td><input type="radio" name="edit_alert[[% alert.id %]]" value="enable"[% ' disabled' UNLESS alert.whendisabled %]></td>
<td><input type="radio" name="edit_alert[[% alert.id %]]" value="disable"[% ' disabled' IF alert.whendisabled %]></td>
<td><input type="radio" name="edit_alert[[% alert.id %]]" value="delete"></td>
</tr>
[% END %]
</table>
<input type="submit" value="[% loc('Update') %]">
</form>
[% END %]
|