diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-15 12:09:53 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-10-19 14:31:45 +0100 |
commit | 00db75c5734b3bd6229599e741622b25405c3b9c (patch) | |
tree | 93e27afb7b07c63dcf8d3cfbb98a0b0b46eda7c1 /templates | |
parent | 39b2948d786aaa528adbd7afb2ff6a5cbdb541cd (diff) |
list user's alerts on user edit page in admin
Include a list of alerts the user is subscribed to at the bottom of the
user_edit page in the admin.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/admin/user-alerts.html | 49 | ||||
-rw-r--r-- | templates/web/base/admin/user_edit.html | 2 |
2 files changed, 51 insertions, 0 deletions
diff --git a/templates/web/base/admin/user-alerts.html b/templates/web/base/admin/user-alerts.html new file mode 100644 index 000000000..1da9729d7 --- /dev/null +++ b/templates/web/base/admin/user-alerts.html @@ -0,0 +1,49 @@ +[% IF alerts.size %] +<h3>[% loc("User's alerts") %]</h3> +<table> +<tr> + <th>[% loc('ID') %]</th> + <th>[% loc('Type') %]</th> + <th>[% loc('Confirmed') %]</th> + <th>[% loc('State') %]</th> + <th>[% loc('Details') %]</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> +</tr> +[% END %] +</table> +[% END %] diff --git a/templates/web/base/admin/user_edit.html b/templates/web/base/admin/user_edit.html index 5bfdf341f..cc456914d 100644 --- a/templates/web/base/admin/user_edit.html +++ b/templates/web/base/admin/user_edit.html @@ -10,4 +10,6 @@ [% INCLUDE 'admin/user-form.html' %] +[% INCLUDE 'admin/user-alerts.html' %] + [% INCLUDE 'admin/footer.html' %] |