aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base')
-rw-r--r--templates/web/base/admin/bodies/open311-form-fields.html2
-rw-r--r--templates/web/base/admin/list_updates.html2
-rw-r--r--templates/web/base/admin/problem_row.html4
-rw-r--r--templates/web/base/admin/reports/edit.html (renamed from templates/web/base/admin/report_edit.html)4
-rw-r--r--templates/web/base/admin/reports/index.html (renamed from templates/web/base/admin/reports.html)2
-rw-r--r--templates/web/base/admin/templates/edit.html (renamed from templates/web/base/admin/template_edit.html)2
-rw-r--r--templates/web/base/admin/templates/index.html (renamed from templates/web/base/admin/templates_index.html)2
-rw-r--r--templates/web/base/admin/templates/view.html (renamed from templates/web/base/admin/templates.html)4
-rw-r--r--templates/web/base/admin/users/form.html5
-rw-r--r--templates/web/base/admin/users/import.html4
-rw-r--r--templates/web/base/admin/users/index.html7
-rw-r--r--templates/web/base/admin/users/log.html72
-rw-r--r--templates/web/base/report/inspect/information.html2
13 files changed, 94 insertions, 18 deletions
diff --git a/templates/web/base/admin/bodies/open311-form-fields.html b/templates/web/base/admin/bodies/open311-form-fields.html
index be2f13af0..dbb0f84e2 100644
--- a/templates/web/base/admin/bodies/open311-form-fields.html
+++ b/templates/web/base/admin/bodies/open311-form-fields.html
@@ -90,7 +90,7 @@
<label for"comment_user_id">[% loc('User ID to attribute fetched comments to') %]</label>
<input type="text" class="form-control" name="comment_user_id" value="[% object.comment_user_id %]">
[% IF object.comment_user_id %]
- <a href="[% c.uri_for_action('admin/users/edit', object.comment_user_id) %]">[% loc('edit user') %]</a>
+ <a href="[% c.uri_for_action('admin/users/edit', [ object.comment_user_id ]) %]">[% loc('edit user') %]</a>
[% END %]
</p>
diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html
index b23cd7ca3..e8abdddad 100644
--- a/templates/web/base/admin/list_updates.html
+++ b/templates/web/base/admin/list_updates.html
@@ -41,7 +41,7 @@
</small></td>
<td rowspan=2>
[% IF c.user.has_permission_to('report_edit', update.problem.bodies_str_ids) %]
- <a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a>
+ <a href="[% c.uri_for_action( 'admin/update_edit', [ update.id ] ) %]">[% loc('Edit') %]</a>
[% END %]
</td>
</tr>
diff --git a/templates/web/base/admin/problem_row.html b/templates/web/base/admin/problem_row.html
index 99142af4e..8d74fec13 100644
--- a/templates/web/base/admin/problem_row.html
+++ b/templates/web/base/admin/problem_row.html
@@ -23,7 +23,7 @@
[% PROCESS value_or_nbsp value=problem.category_display %]
<br>[%- IF edit_body_contacts -%]
[% FOR body IN problem.bodies.values %]
- <a href="[% c.uri_for('body', body.id ) %]">[% PROCESS value_or_nbsp value=body.name %]</a>
+ <a href="[% c.uri_for_action('admin/bodies/edit', [ body.id ] ) %]">[% PROCESS value_or_nbsp value=body.name %]</a>
[% END %]
[%- ELSE -%]
[%- PROCESS value_or_nbsp value=problem.bodies_str -%]
@@ -40,7 +40,7 @@
</small></td>
<td>
[% IF c.user.has_permission_to('report_edit', problem.bodies_str_ids) %]
- <a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a>
+ <a href="[% c.uri_for_action( '/admin/reports/edit', [ problem.id ] ) %]">[% loc('Edit') %]</a>
[% END %]
</td>
</tr>
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/reports/edit.html
index da800ff71..b4af705a9 100644
--- a/templates/web/base/admin/report_edit.html
+++ b/templates/web/base/admin/reports/edit.html
@@ -16,7 +16,7 @@
<div id="side">
-<form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="post" action="[% c.uri_for_action( '/admin/reports/edit', [ problem.id ] ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="submit" value="1" >
@@ -57,7 +57,7 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a>
[% IF problem.bodies_str %]
[% FOREACH body IN problem.bodies.values %]
[% SET body_printed = 1 %]
- <a href="[% c.uri_for('body', body.id) %]">[% body.name | html %]</a>
+ <a href="[% c.uri_for_action('admin/bodies/edit', [ body.id ]) %]">[% body.name | html %]</a>
[%- ',' IF NOT loop.last %]
[% END %]
[% IF NOT body_printed %]
diff --git a/templates/web/base/admin/reports.html b/templates/web/base/admin/reports/index.html
index 7d8fe9561..adbd50224 100644
--- a/templates/web/base/admin/reports.html
+++ b/templates/web/base/admin/reports/index.html
@@ -1,7 +1,7 @@
[% INCLUDE 'admin/header.html' title=loc('Search Reports') %]
[% PROCESS 'admin/report_blocks.html' %]
-<form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="get" action="[% c.uri_for_action('/admin/reports/index') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<p><label for="search">[% loc('Search:') %]</label>
<input class="form-control" type="text" name="search" size="30" id="search" value="[% searched | html %]">
</form>
diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/templates/edit.html
index 87218c7dd..7ce67f96f 100644
--- a/templates/web/base/admin/template_edit.html
+++ b/templates/web/base/admin/templates/edit.html
@@ -4,7 +4,7 @@
[% UNLESS rt.id %]<h3>[% loc('New template') %]</h3>[% END %]
<form method="post"
- action="[% c.uri_for('templates', body.id, rt.id || 'new' ) %]"
+ action="[% c.uri_for_action('/admin/templates/edit', body.id, rt.id || 'new' ) %]"
enctype="application/x-www-form-urlencoded"
accept-charset="utf-8"
class="validate">
diff --git a/templates/web/base/admin/templates_index.html b/templates/web/base/admin/templates/index.html
index 40e1be300..9322c6ef6 100644
--- a/templates/web/base/admin/templates_index.html
+++ b/templates/web/base/admin/templates/index.html
@@ -3,7 +3,7 @@
<ul>
[% FOR body IN bodies %]
<li>
- <a href="[% c.uri_for('templates', body.id) %]">[% body.name %]</a>
+ <a href="[% c.uri_for_action('/admin/templates/view', body.id) %]">[% body.name %]</a>
</li>
[% END %]
</ul>
diff --git a/templates/web/base/admin/templates.html b/templates/web/base/admin/templates/view.html
index 21e4eea25..6a1dd9614 100644
--- a/templates/web/base/admin/templates.html
+++ b/templates/web/base/admin/templates/view.html
@@ -28,12 +28,12 @@
[% IF t.external_status_code %][% t.external_status_code | html %] (external)[% END %]
</td>
<td> [% IF t.auto_response %]X[% END %] </td>
- <td> <a href="[% c.uri_for('templates', body.id, t.id) %]" class="btn">[% loc('Edit') %]</a> </td>
+ <td> <a href="[% c.uri_for_action('/admin/templates/edit', body.id, t.id) %]" class="btn">[% loc('Edit') %]</a> </td>
</tr>
[% END %]
</tbody>
</table>
-<a href="[% c.uri_for('templates', body.id, 'new') %]" class="btn">[% loc('New template') %]</a>
+<a href="[% c.uri_for_action('/admin/templates/index', body.id, 'new') %]" class="btn">[% loc('New template') %]</a>
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/users/form.html b/templates/web/base/admin/users/form.html
index f141dc02c..495da8648 100644
--- a/templates/web/base/admin/users/form.html
+++ b/templates/web/base/admin/users/form.html
@@ -1,4 +1,7 @@
-<form method="post" id="user_edit" action="[% c.uri_for_action( 'admin/users/edit', user.id || 'add' ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="post" id="user_edit" action="[%
+ SET action_end = user.id || 'add';
+ c.uri_for_action( 'admin/users/edit', [ action_end ] )
+ %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="submit" value="1" >
diff --git a/templates/web/base/admin/users/import.html b/templates/web/base/admin/users/import.html
index 6e11c74a9..38e4fe240 100644
--- a/templates/web/base/admin/users/import.html
+++ b/templates/web/base/admin/users/import.html
@@ -27,7 +27,7 @@
[% FOREACH user IN new_users %]
<tr>
<td>
- <a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">
+ <a href="[% c.uri_for_action( 'admin/users/edit', [ user.id ] ) %]">
[% user.name %]
</a>
</td>
@@ -50,7 +50,7 @@
[% FOREACH user IN existing_users %]
<tr>
<td>
- <a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">
+ <a href="[% c.uri_for_action( 'admin/users/edit', [ user.id ] ) %]">
[% user.name %]
</a>
</td>
diff --git a/templates/web/base/admin/users/index.html b/templates/web/base/admin/users/index.html
index f48893cb0..e573c10fe 100644
--- a/templates/web/base/admin/users/index.html
+++ b/templates/web/base/admin/users/index.html
@@ -46,7 +46,7 @@
[% IF c.cobrand.moniker != 'zurich' %]
<th>[% loc('Flagged') %]</th>
[% END %]
- <th>*</th>
+ <th colspan="2">*</th>
</tr>
[%- FOREACH user IN users %]
<tr>
@@ -57,14 +57,15 @@
[% PROCESS value_or_nbsp value=user.name %]
[% IF user.from_body %]</label>[% END %]
</td>
- <td><a href="[% c.uri_for_action( 'admin/reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
+ <td><a href="[% c.uri_for_action( 'admin/reports/index', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
<td>[% PROCESS value_or_nbsp value=user.from_body.name %]
[% IF user.is_superuser %] * [% END %]
</td>
[% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('User in abuse table') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
[% END %]
- <td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td>
+ <td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/edit', [ user.id ] ) %]">[% loc('Edit') %]</a>[% END %]</td>
+ <td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/log', [ user.id ] ) %]">[% loc('Timeline') %]</a>[% END %]</td>
</tr>
[%- END -%]
</table>
diff --git a/templates/web/base/admin/users/log.html b/templates/web/base/admin/users/log.html
new file mode 100644
index 000000000..a596d040c
--- /dev/null
+++ b/templates/web/base/admin/users/log.html
@@ -0,0 +1,72 @@
+[% INCLUDE 'admin/header.html' title=loc('Timeline') _ ', ' _ user.name %]
+
+<style>
+.timeline ul {
+ margin-bottom: 0;
+}
+.timeline dd {
+ margin-bottom: 0;
+}
+</style>
+
+[%
+action_map = {
+ add = 'Added'
+ delete = 'Deleted'
+ edit = 'Edited'
+ merge = 'Merged'
+ moderation = 'Moderated'
+ resend = 'Resent'
+ category_change = 'Changed category of'
+ state_change = 'Changed state of'
+}
+%]
+
+[%- date = '' %]
+[% FOREACH moment IN time.keys.sort.reverse %]
+ [%- curdate = time.$moment.0.date.strftime('%A, %e %B %Y') -%]
+ [%- IF date != curdate %]
+ [% '</dl>' IF date %]
+ <h2>[% curdate %]</h2>
+
+ <dl class="timeline">
+ [%- date = curdate -%]
+ [%- END -%]
+ <dt><b>[% time.$moment.0.date.hms %]</b></dt>
+ <dd><ul>
+ [% FOREACH item IN time.$moment %]
+ <li>
+ [%~ IF item.obj.problem_id %]
+ [%~ SET report_url = c.uri_for( '/report', item.obj.problem_id ) _ "#update_" _ item.obj.id %]
+ [%~ ELSE %]
+ [%~ SET report_url = c.uri_for('/report', item.obj.id) %]
+ [%~ END %]
+ [%~ SET report_link = "<a href='" _ report_url _ "'>" _ item.obj.id _ "</a>" %]
+ [%- SWITCH item.type -%]
+ [%~ CASE 'problem' %]
+ [%- tprintf(loc('Problem %s created'), report_link) %], ‘[% item.obj.title | html %]’
+ [%~ CASE 'problemContributedBy' %]
+ [%- tprintf(loc('Problem %s created on behalf of %s'), report_link, item.obj.name) %], ‘[% item.obj.title | html %]’
+ [%~ CASE 'update' %]
+ [% tprintf(loc("Update %s created for problem %d"), report_link, item.obj.problem_id) %]
+ [% item.obj.text | add_links | markup(item.obj.user) | html_para %]
+ [%~ CASE 'shortlistAdded' %]
+ [%- tprintf(loc('Problem %s added to shortlist'), report_link) %]
+ [%~ CASE 'shortlistRemoved' %]
+ [%- tprintf(loc('Problem %s removed from shortlist'), report_link) %]
+ [%~ CASE 'log' %]
+ [%~ SET object_summary = item.log.object_summary %]
+ [% IF object_summary %]
+ [%~ SET link = tprintf('<a href="%s">%s</a>', item.log.link, object_summary) %]
+ [%- tprintf('%s %s %s', action_map.${item.log.action}, item.log.actual_object_type, link) %]
+ [% ' – ' _ item.log.reason IF item.log.reason %]
+ [% ELSE %]
+ [%- tprintf('%s %s %s', action_map.${item.log.action}, item.log.actual_object_type, item.log.object_id) %]
+ [% END %]
+ [%- END %]
+ </li>
+ [%- END %]
+ </ul></dd>
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/report/inspect/information.html b/templates/web/base/report/inspect/information.html
index cc8989522..b81b37543 100644
--- a/templates/web/base/report/inspect/information.html
+++ b/templates/web/base/report/inspect/information.html
@@ -7,7 +7,7 @@
<strong>[% loc('Report ID:') %]</strong>
<span class="js-report-id">[% problem.id %]</span>
[% IF c.user_exists AND c.cobrand.admin_allow_user(c.user) AND c.user.has_permission_to('report_edit', problem.bodies_str_ids) %]
- (<a href="[% c.uri_for_action( "admin/report_edit", problem.id ) %]">[% loc('admin') %]</a>)
+ (<a href="[% c.uri_for_action( 'admin/reports/edit', [ problem.id ] ) %]">[% loc('admin') %]</a>)
[% END %]
</p>
[% IF permissions.report_inspect AND problem.user.phone %]