aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/default/admin
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/default/admin')
-rw-r--r--templates/web/default/admin/bodies.html50
-rw-r--r--templates/web/default/admin/body-form.html85
-rw-r--r--templates/web/default/admin/body.html (renamed from templates/web/default/admin/council_contacts.html)84
-rw-r--r--templates/web/default/admin/body_edit.html (renamed from templates/web/default/admin/council_edit.html)43
-rw-r--r--templates/web/default/admin/council_list.html47
-rw-r--r--templates/web/default/admin/edit-league.html14
-rw-r--r--templates/web/default/admin/flagged.html (renamed from templates/web/default/admin/list_flagged.html)2
-rw-r--r--templates/web/default/admin/list_updates.html4
-rw-r--r--templates/web/default/admin/problem_row.html8
-rw-r--r--templates/web/default/admin/report_blocks.html7
-rw-r--r--templates/web/default/admin/report_edit.html32
-rw-r--r--templates/web/default/admin/reports.html (renamed from templates/web/default/admin/search_reports.html)6
-rw-r--r--templates/web/default/admin/stats.html6
-rw-r--r--templates/web/default/admin/timeline.html8
-rw-r--r--templates/web/default/admin/update_edit.html9
-rw-r--r--templates/web/default/admin/user-form.html18
-rw-r--r--templates/web/default/admin/user_edit.html16
-rw-r--r--templates/web/default/admin/users.html (renamed from templates/web/default/admin/search_users.html)21
18 files changed, 272 insertions, 188 deletions
diff --git a/templates/web/default/admin/bodies.html b/templates/web/default/admin/bodies.html
new file mode 100644
index 000000000..a1555cac9
--- /dev/null
+++ b/templates/web/default/admin/bodies.html
@@ -0,0 +1,50 @@
+[% INCLUDE 'admin/header.html' title=loc('Bodies') -%]
+
+[% INCLUDE 'admin/edit-league.html' %]
+
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Name') %]</th>
+ [% IF c.cobrand.moniker == 'zurich' %]
+ <th>[% loc('Email') %]</th>
+ [% ELSE %]
+ <th>[% loc('Category') %]</th>
+ [% END %]
+ </tr>
+[%- FOREACH body IN bodies %]
+ [%- SET id = body.id %]
+ [% NEXT IF c.cobrand.moniker == 'zurich' AND admin_type == 'dm' AND (body.parent OR body.bodies) %]
+ <tr>
+ <td>
+ [% IF c.cobrand.moniker == 'zurich' %]
+ [% FILTER repeat(4*body.api_key) %]&nbsp;[% END %]
+ [% END %]
+ <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a>
+ [% IF c.cobrand.moniker != 'zurich' %]
+ [%- ', ' _ body.parent.name IF body.parent -%]
+ [% END %]
+ </td>
+ [% IF c.cobrand.moniker == 'zurich' %]
+ <td>[% body.endpoint %]</td>
+ [% ELSE %]
+ <td>
+ [% IF counts.$id %]
+ [% tprintf( loc('%d addresses'), counts.$id.c) IF c.cobrand.moniker != 'emptyhomes' %]
+ [% IF counts.$id.deleted %]
+ (1+ deleted)
+ [% ELSIF counts.$id.confirmed != counts.$id.c %]
+ (some unconfirmed)
+ [% END %]
+ [% ELSE %]
+ no categories
+ [% END %]
+ </td>
+ [% END %]
+ </tr>
+[%- END %]
+</table>
+
+<h2>[% loc('Add body') %]</h2>
+[% INCLUDE 'admin/body-form.html', body='' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/body-form.html b/templates/web/default/admin/body-form.html
new file mode 100644
index 000000000..039d83ae2
--- /dev/null
+++ b/templates/web/default/admin/body-form.html
@@ -0,0 +1,85 @@
+ <form method="post" action="[% body ? c.uri_for('body', body.id) : c.uri_for('bodies') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+
+ <p>
+ <label for="name">[% loc('Name') %]</label>
+ <input type="text" name="name" id="name" value="[% body.name %]" size="50">
+ </p>
+
+ <p>
+ <label for="parent">[% loc('Parent') %]</label>
+ <select name="parent" id="parent">
+ <option value=""> -- [% loc('Select a body') %] -- </option>
+ [% FOR b IN bodies %]
+ <option value="[% b.id %]"[% ' selected' IF body.parent.id == b.id %]>[% b.name %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <label for="area_ids">[% loc('Area covered') %]</label>
+ <select name="area_ids" id="area_ids" multiple>
+ <option value=""> -- [% loc('Select an area') %] -- </option>
+ [% FOR area IN areas %]
+ [% SET aid = area.id %]
+ <option value="[% area.id %]"[% ' selected' IF body.areas.$aid %]>[% area.name %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <label for="send_method">Send Method</label>
+ <select name="send_method" id="send_method">
+ <option value=""> -- Select a method -- </option>
+ [% FOR method IN send_methods %]
+ <option value="[% method %]"[% ' selected' IF body.send_method == method %]>[% method %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <label for="endpoint">[% loc('Endpoint') %]</label>
+ <input type="text" name="endpoint" id="endpoint" value="[% body.endpoint %]" size="50">
+ </p>
+
+ <p>
+ <label for="jurisdiction">Open311 Jurisdiction</label>
+ <input type="text" name="jurisdiction" id="jurisdiction" value="[% body.jurisdiction %]" size="50">
+ </p>
+
+ <p>
+ <label for="api_key">Open311 API Key</label>
+ <input type="text" name="api_key" id="api_key" value="[% body.api_key %]" size="25">
+ </p>
+
+ <p>
+ <input type="checkbox" id="send_comments" name="send_comments"[% ' checked' IF body.send_comments %]>
+ <label for="send_comments" class="inline">Use Open311 comment sending extension</label>
+ </p>
+
+ <p>
+ <label for"comment_user_id">User ID to attribute fetched comments to</label>
+ <input type="text" name="comment_user_id" value="[% body.comment_user_id %]">
+ </p>
+
+ <p>
+ <input type="checkbox" id="suppress_alerts" name="suppress_alerts"[% ' checked' IF body.suppress_alerts %]>
+ <label for="suppress_alerts" class="inline">Do not send email alerts on fetched comments to problem creator</label>
+ </p>
+
+ <p>
+ <input type="checkbox" id="can_be_devolved" name="can_be_devolved"[% ' checked' IF body.can_be_devolved %]>
+ <label for="can_be_devolved" class="inline">Endpoint lookup can be devolved to contacts</label>
+ </p>
+
+ <p>
+ <label for="send_extended_statuses">Send extended open311 statuses with service request updates</label>:
+ <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF conf.send_extended_statuses %]>
+ </p>
+
+ <p>
+ <input type="hidden" name="posted" value="body">
+ <input type="hidden" name="token" value="[% token %]">
+ <input type="submit" value="[% body ? loc('Update body') : loc('Add body') %]">
+ </p>
+ </form>
+
diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/body.html
index 56850a82b..120a07da9 100644
--- a/templates/web/default/admin/council_contacts.html
+++ b/templates/web/default/admin/body.html
@@ -1,6 +1,4 @@
-[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%]
-
-[% conf = open311.next %]
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
[% IF updated %]
<p>
@@ -13,14 +11,14 @@
<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> |
[% END %]
[% IF c.cobrand.moniker == 'emptyhomes' %]
-<a href="[% c.uri_for( 'search_reports', search => 'area:' _ area_id ) %]">[% loc('List all reported problems' ) %]</a>
+<a href="[% c.uri_for( 'reports', search => 'body:' _ body_id ) %]">[% loc('List all reported problems' ) %]</a>
[% ELSE %]
-<a href="[% c.uri_for_email( '/reports/' _ area_id ) %]">[% loc('List all reported problems' ) %]</a>
+<a href="[% c.uri_for_email( '/reports/' _ body_id ) %]">[% loc('List all reported problems' ) %]</a>
[% END %]
-<a href="[% c.uri_for( 'council_contacts', area_id, { text => 1 } ) %]">[% loc('Text only version') %]</a>
+<a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a>
</p>
-[% IF open311.count > 0 %]
+[% IF body.send_method == 'Open311' %]
<h2>
Council contacts configured via Open311
</h2>
@@ -30,7 +28,7 @@
<p class="error">Do not give these out except to people at the council.</p>
[% END %]
-<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<table cellspacing="0" cellpadding="2" border="1">
<tr>
@@ -47,11 +45,11 @@
</tr>
[% WHILE ( contact = contacts.next ) %]
<tr>
- <td><a href="[% c.uri_for( 'council_edit', area_id, contact.category ) %]">[% contact.category %]</a></td>
+ <td><a href="[% c.uri_for( 'body_edit', body_id, contact.category ) %]">[% contact.category %]</a></td>
<td>[% contact.email | html %]</td>
<td>[% IF contact.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% IF contact.deleted %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
- <td>[% IF conf.can_be_devolved && contact.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
+ <td>[% IF body.can_be_devolved && contact.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% contact.editor %]</td>
<td>[% contact.note | html %]</td>
<td>[% contact.non_public ? loc('Non Public') : loc('Public') %]</td>
@@ -62,7 +60,6 @@
</table>
<p>
- <input type="hidden" name="area_id" value="[% area_id %]">
<input type="hidden" name="posted" value="update">
<input type="hidden" name="token" value="[% token %]">
<input type="submit" name="Update statuses" value="[% loc('Update statuses') %]">
@@ -71,7 +68,7 @@
<h2>[% loc('Add new category') %]</h2>
- <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
[% IF c.cobrand.moniker != 'emptyhomes' %]
<p>
@@ -101,7 +98,6 @@
</p>
<p>
- <input type="hidden" name="area_id" value="[% area_id %]" >
<input type="hidden" name="posted" value="new" >
<input type="hidden" name="token" value="[% token %]" >
<input type="submit" name="Create category" value="[% loc('Create category') %]" >
@@ -113,65 +109,7 @@
</div>
</form>
- <h2>[% loc('Configure Open311 integration') %]</h2>
- <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- <p>
- <label for="endpoint">Endpoint</label>
- <input type="text" name="endpoint" id="endpoint" value="[% conf.endpoint %]" size="50">
- </p>
-
- <p>
- <label for="jurisdiction">Jurisdiction</label>
- <input type="text" name="jurisdiction" id="jurisdiction" value="[% conf.jurisdiction %]" size="50">
- </p>
-
- <p>
- <label for="api_key">Api Key</label>
- <input type="text" name="api_key" id="api_key" value="[% conf.api_key %]" size="25">
- </p>
-
- <p>
- <label for="send_method">Send Method</label>
- <select name="send_method">
- <option value=""> -- Select a method -- </option>
- [% FOR method IN send_methods %]
- <option value="[% method %]"[% ' selected' IF conf.send_method == method %]>[% method %]</option>
- [% END %]
- </select>
- </p>
-
- <p>
- <input type="checkbox" name="send_comments"[% ' checked' IF conf.send_comments %]>
- <label for="send_comments" class="inline">Use Open311 comment sending extension</label>
- </p>
-
- <p>
- <label for"comment_user_id">User to attribute fetched comments to</label>
- <input type="text" name="comment_user_id" value="[% conf.comment_user_id %]">
- </p>
-
- <p>
- <input type="checkbox" name="suppress_alerts"[% ' checked' IF conf.suppress_alerts %]>
- <label for="suppress_alerts" class="inline">Do not send email alerts on fetched comments to problem creator</label>
- </p>
-
- <p>
- <input type="checkbox" name="devolved"[% ' checked' IF conf.can_be_devolved %]>
- <label for="devolved" class="inline">Endpoint lookup can be devolved to contacts</label>
- </p>
-
- <p>
- <label for="extended_statuses">Send extended open311 statuses with service request updates</label>:
- <input type="checkbox" name="extended_statuses"[% ' checked' IF conf.send_extended_statuses %]>
- </p>
-
- <p>
- <input type="hidden" name="open311_id" value="[% conf.id %]">
- <input type="hidden" name="area_id" value="[% area_id %]">
- <input type="hidden" name="posted" value="open311">
- <input type="hidden" name="token" value="[% token %]">
- <input type="submit" name="Configure Open311" value="[% loc('Configure Open311') %]">
- </p>
- </form>
+ <h2>[% loc('Edit body details') %]</h2>
+ [% INCLUDE 'admin/body-form.html' %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/council_edit.html b/templates/web/default/admin/body_edit.html
index 408466b51..1eeff9ab5 100644
--- a/templates/web/default/admin/council_edit.html
+++ b/templates/web/default/admin/body_edit.html
@@ -1,4 +1,4 @@
-[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%]
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
[% BLOCK highlightchanged_yesno %]
[%- output = loc('No') %]
@@ -19,37 +19,50 @@
[% END %]
</p>
-<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- <strong>[% loc('Category:') %] </strong>[% contact.category | html %]
+<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p><strong>[% loc('Category:') %] </strong>[% contact.category | html %]
<input type="hidden" name="category" value="[% contact.category | html %]" >
<input type="hidden" name="token" value="[% token %]" >
- <strong>[% loc('Email:') %] </strong>
+ <p><strong>[% loc('Email:') %] </strong>
<input type="text" name="email" value="[% contact.email | html %]" size="30">
- <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed %]> <label for="confirmed">[% loc('Confirmed' ) %]</label>
- <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]> <label for="deleted">[% loc('Deleted') %]</label>
- <input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]> <label for="non_public">[% loc('Private') %]</label><br>
- <strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea> <br>
+ <p>
+ [% IF c.cobrand.moniker != 'zurich' %]
+ <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed %]>
+ <label class="inline" for="confirmed">[% loc('Confirmed' ) %]</label>
+ [% ELSE %]
+ <input type="hidden" name="confirmed" value="1">
+ [% END %]
+ <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]>
+ <label class="inline" for="deleted">[% loc('Deleted') %]</label>
+ [% IF c.cobrand.moniker != 'zurich' %]
+ <input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]>
+ <label class="inline" for="non_public">[% loc('Private') %]</label>
+ [% END %]
+ </p>
+
+ <p><strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea>
+ [% IF body.can_be_devolved %]
<h2>[% loc('Configure Endpoint') %]</h2>
- <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<p>
- <label for="endpoint">Endpoint</label>:
+ <label for="endpoint">Endpoint</label>
<input type="text" name="endpoint" id="endpoint" value="[% contact.endpoint %]" size="50">
</p>
<p>
- <label for="jurisdiction">Jurisdiction</label>:
+ <label for="jurisdiction">Jurisdiction</label>
<input type="text" name="jurisdiction" id="jurisdiction" value="[% contact.jurisdiction %]" size="50">
</p>
<p>
- <label for="api_key">Api Key</label>:
+ <label for="api_key">Api Key</label>
<input type="text" name="api_key" id="api_key" value="[% contact.api_key %]" size="25">
</p>
<p>
- <label for="send_method">Send Method</label>:
+ <label for="send_method">Send Method</label>
<select name="send_method">
<option value=""> -- Select a method -- </option>
[% FOR method IN send_methods %]
@@ -57,10 +70,10 @@
[% END %]
</select>
</p>
+ [% END %]
- <input type="hidden" name="area_id" value="[% area_id %]">
<input type="hidden" name="posted" value="new">
- <input type="submit" name="Save changes" value="[% loc('Save changes') %]">
+ <p><input type="submit" name="Save changes" value="[% loc('Save changes') %]">
</form>
<h2>[% loc('History') %]</h2>
diff --git a/templates/web/default/admin/council_list.html b/templates/web/default/admin/council_list.html
deleted file mode 100644
index ac99368fe..000000000
--- a/templates/web/default/admin/council_list.html
+++ /dev/null
@@ -1,47 +0,0 @@
-[% INCLUDE 'admin/header.html' title=loc('Council contacts') -%]
-
-[%- BLOCK details %]
-[%- IF councils.size == 0 %]
- [%- loc('None') %]
-[%- ELSE %]
-[%- FOREACH council IN councils %]
- [%- IF council.parent_area %]
- [%-
- p_area = areas.$council.parent_area
- parent = ', ' _ areas.$parent.name
- %]
- [%- ELSE %]
- [%- parent = '' %]
- [%- END %]
- [%- '<ul>' IF loop.first %]
- <li><a href="[% c.uri_for( 'council_contacts', council ) %]">[% areas.$council.name %] [% parent %][% tprintf( loc('%d addresses'), counts.$council.c) IF counts.$council && c.cobrand.moniker != 'emptyhomes' %]</a>
- [%- '</ul>' IF loop.last %]
-[%- END %]
-[%- END %]
-[%- END %]
-
-<h2>[% loc('Diligency prize league table') %]</h2>
-[% IF edit_activity.count %]
-<ul>
- [% WHILE ( editor = edit_activity.next ) %]
- <li>[% tprintf( loc('%d edits by %s'), editor.get_column('c'), editor.editor ) %]</li>
- [% END %]
-</ul>
-[% ELSE %]
-<p>
-[% loc('No edits have yet been made.') %]
-</p>
-[% END %]
-
-<h2>[% loc('Councils') %]</h2>
-
-<h3>[% loc('No info at all') %]</h3>
-[% PROCESS details councils=no_info %]
-<h3>[% loc('Currently has 1+ deleted') %]</h3>
-[% PROCESS details councils=one_plus_deleted %]
-<h3>[% loc('Some unconfirmeds') %]</h3>
-[% PROCESS details councils=unconfirmeds %]
-<h3>[% loc('All confirmed') %]</h3>
-[% PROCESS details councils=all_confirmed %]
-
-[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/edit-league.html b/templates/web/default/admin/edit-league.html
new file mode 100644
index 000000000..6bf71537e
--- /dev/null
+++ b/templates/web/default/admin/edit-league.html
@@ -0,0 +1,14 @@
+<h2>[% loc('Diligency prize league table') %]</h2>
+[% IF edit_activity.count %]
+<ul>
+ [% WHILE ( editor = edit_activity.next ) %]
+ <li>[% tprintf( loc('%d edits by %s'), editor.get_column('c'), editor.editor ) %]</li>
+ [% END %]
+</ul>
+[% ELSE %]
+<p>
+[% loc('No edits have yet been made.') %]
+</p>
+[% END %]
+
+
diff --git a/templates/web/default/admin/list_flagged.html b/templates/web/default/admin/flagged.html
index 0b22bccb2..5af92a23c 100644
--- a/templates/web/default/admin/list_flagged.html
+++ b/templates/web/default/admin/flagged.html
@@ -38,7 +38,7 @@
<tr>
<td>[% user.name | html %]</td>
<td>[% user.email | html %]</td>
- <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">list content</a></td>
+ <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">list content</a></td>
</tr>
[%- END %]
</table>
diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html
index d21919b16..ff0ec2f31 100644
--- a/templates/web/default/admin/list_updates.html
+++ b/templates/web/default/admin/list_updates.html
@@ -29,10 +29,10 @@
<td>[% PROCESS format_time time=update.created %]</td>
<td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% IF update.user.id == update.problem.user_id %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
- <td>[% IF update.user.belongs_to_council( update.problem.council ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
+ <td>[% IF update.user.belongs_to_body( update.problem.bodies_str ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td>
<td>[% update.text | html %]</td>
<td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td>
- <tr>
+ </tr>
[% END -%]
</table>
diff --git a/templates/web/default/admin/problem_row.html b/templates/web/default/admin/problem_row.html
index 5aa8bbfee..1533f8dd2 100644
--- a/templates/web/default/admin/problem_row.html
+++ b/templates/web/default/admin/problem_row.html
@@ -10,10 +10,12 @@
<td>[% PROCESS value_or_nbsp value=problem.title %]</td>
<td>[% PROCESS value_or_nbsp value=problem.name %]</td>
<td>[% PROCESS value_or_nbsp value=problem.user.email %]</td>
- <td>[%- IF edit_council_contacts -%]
- <a href="[% c.uri_for('council_contacts', problem.council ) %]">[% PROCESS value_or_nbsp value=problem.council %]</a>
+ <td>[%- 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>
+ [% END %]
[%- ELSE -%]
- [%- PROCESS value_or_nbsp value=problem.council -%]
+ [%- PROCESS value_or_nbsp value=problem.bodies_str -%]
[%- END -%]</td>
<td>[% PROCESS value_or_nbsp value=problem.category %]</td>
<td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
diff --git a/templates/web/default/admin/report_blocks.html b/templates/web/default/admin/report_blocks.html
index f08529ce7..bb9f34cb9 100644
--- a/templates/web/default/admin/report_blocks.html
+++ b/templates/web/default/admin/report_blocks.html
@@ -15,3 +15,10 @@
[% BLOCK flag_button -%]
[% IF user.flagged || user_flagged %]<input type="submit" name="removeuserflag" value="[% loc('Remove flag') %]">[% ELSE %]<input type="submit" name="flaguser" value="[% loc('Flag user') %]" />[% END %]
[%- END %]
+
+[%# note: date format here (i.e., dd.mm.YYYY) currently used by Zurich %]
+[% BLOCK format_date -%]
+ [%- IF this_date %]
+ [% this_date.strftime('%d.%m.%Y') %]
+ [% ELSE %][% no_time || '&nbsp;' %][% END %][% no_time = '' %]
+[%- END %]
diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html
index ea98a9be9..cd5072d00 100644
--- a/templates/web/default/admin/report_edit.html
+++ b/templates/web/default/admin/report_edit.html
@@ -11,19 +11,27 @@
[%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %]
<li><a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% loc('View report on site' )%]</a></li>
<li><label for='title'>[% loc('Subject:') %]</label> <input size=60 type='text' id='title' name='title' value='[% problem.title | html %]'></li>
-<li><label for='detail'>[% loc('Details:') %]</label><br><textarea name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
-<li>[% loc('Co-ordinates:') %] [% problem.latitude %], [% problem.longitude %] ( [% loc('originally entered') %] [% problem.postcode | html %] , [% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li>
-<li>[% loc('For council(s):') %] [% IF problem.council %][% problem.council %][% ELSE %]<em>[% loc('None' ) %]</em>[% END %] ([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) %])</li>
-<li><label for="state">[% loc('State:') %]</label> <select name="state" id="state">
+<li><label for='detail'>[% loc('Details:') %]</label>
+<textarea name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
+
+<li>[% loc('Co-ordinates:') %] [% problem.latitude %], [% problem.longitude %]
+( [%
+ SET postcode_safe = problem.postcode | html;
+ tprintf( loc('originally entered: &ldquo;%s&rdquo;'), postcode_safe )
+%],
+[% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li>
+
+<li>[% loc('For council(s):') %] [% IF problem.bodies_str %][% problem.bodies_str %][% ELSE %]<em>[% loc('None' ) %]</em>[% END %] ([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) %])</li>
+<li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state">
[% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating',
loc('Investigating')], ['planned', loc('Planned')], ['in progress',
- loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')], ['fixed - user',
+ loc('In progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')], ['fixed - user',
loc('Fixed - User')], ['fixed - council', loc('Fixed - Council')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %]
<option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
[% END %]
</select></li>
<li>[% loc('Category:') %] [% problem.category | html %] </li>
-<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous">
+<li><label class="inline" for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous">
<option [% 'selected ' IF problem.anonymous %]value="1">[% loc('Yes') %]</option>
<option [% 'selected ' IF !problem.anonymous %]value="0">[% loc('No') %]</option>
</select></li>
@@ -39,19 +47,19 @@
<li>[% loc('Cobrand data:') %] [% problem.cobrand_data %]</li>
<li>[% loc('Extra data:') %] [% problem.extra ? 'Yes' : 'No' %]</li>
<li>[% loc('Going to send questionnaire?') %] [% IF problem.send_questionnaire %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</li>
-<li><label for="flagged">[% loc('Flagged:') %]</label> <input type="checkbox" name="flagged"[% ' checked' IF problem.flagged %]></li>
-<li><label for="non_public">[% loc('Private') %]:</label> <input type="checkbox" name="non_public"[% ' checked' IF problem.non_public %]></li>
+<li><label class="inline" for="flagged">[% loc('Flagged:') %]</label> <input type="checkbox" name="flagged"[% ' checked' IF problem.flagged %]></li>
+<li><label class="inline" for="non_public">[% loc('Private') %]:</label> <input type="checkbox" name="non_public"[% ' checked' IF problem.non_public %]></li>
[% IF problem.photo %]
[% photo = problem.get_photo_params %]
<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %][% photo.url %]">
<br>
-[% IF rotated %]Photo may be cached. View image directly to check<br>[% END %]
-<input type="submit" name="rotate_photo" value="Rotate Left" />
-<input type="submit" name="rotate_photo" value="Rotate Right" />
+[% IF rotated %]Photo may be cached for a while.<br>[% END %]
+<input type="submit" name="rotate_photo" value="[% loc('Rotate Left') %]">
+<input type="submit" name="rotate_photo" value="[% loc('Rotate Right') %]">
<br>
<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
-<label for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li>
+<label class="inline" for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li>
[% END %]
</ul>
<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/reports.html
index 9702c16a7..600f2b436 100644
--- a/templates/web/default/admin/search_reports.html
+++ b/templates/web/default/admin/reports.html
@@ -1,8 +1,8 @@
[% INCLUDE 'admin/header.html' title=loc('Search Reports') %]
[% PROCESS 'admin/report_blocks.html' %]
-<form method="get" action="[% c.uri_for('search_reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search">
+<form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search">
</form>
@@ -13,7 +13,7 @@
<th>[% loc('Title') %]</th>
<th>[% loc('Name') %]</th>
<th>[% loc('Email') %]</th>
- <th>[% loc('Council') %]</th>
+ <th>[% loc('Body') %]</th>
<th>[% loc('Category') %]</th>
<th>[% loc('Anonymous') %]</th>
<th>[% loc('Cobrand') %]</th>
diff --git a/templates/web/default/admin/stats.html b/templates/web/default/admin/stats.html
index 234600837..bb42d5b7d 100644
--- a/templates/web/default/admin/stats.html
+++ b/templates/web/default/admin/stats.html
@@ -81,10 +81,10 @@
</p>
<p>
- [% loc('Council:') %] <select id='council' name='council'>
+ [% loc('Council:') %] <select id='body' name='body'>
<option value=''>[% loc('No council') %]</option>
- [% FOR council IN council_ids %]
- <option value="[% council %]"[% ' selected' IF council == selected_council %]>[% council_details.$council.name %]</option>
+ [% FOR body IN bodies %]
+ <option value="[% body.id %]"[% ' selected' IF body.id == selected_body %]>[% body.name %]</option>
[% END %]
</select>
</p>
diff --git a/templates/web/default/admin/timeline.html b/templates/web/default/admin/timeline.html
index 95120e48c..4058f7f06 100644
--- a/templates/web/default/admin/timeline.html
+++ b/templates/web/default/admin/timeline.html
@@ -1,6 +1,4 @@
[% INCLUDE 'admin/header.html' title=loc('Timeline') %]
-[%- USE f = DateTime::Format('DateTime::Format::Strptime', { pattern => "%A, %e %B %Y" }) %]
-[%- USE alert_format = DateTime::Format('DateTime::Format::Strptime', { pattern => "%H:%M:%S %e %B %Y" }) %]
[%- BLOCK problem_name %]
[%- tprintf(loc('by %s'), problem.name) | html %] &lt;[% problem.user.email | html %]&gt;, '[% problem.title | html %]'
@@ -8,7 +6,7 @@
[%- date = '' %]
[% FOREACH moment IN time.keys.sort.reverse %]
- [%- curdate = f.format(time.$moment.0.date) -%]
+ [%- curdate = time.$moment.0.date.strftime('%A, %e %B %Y') -%]
[%- IF date != curdate %]
[% '</dl>' IF date %]
<h2>[% curdate %]</h2>
@@ -25,7 +23,7 @@
[% CASE 'problemConfirmed' %]
[%- tprintf( loc('Problem %s confirmed'), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>') %]; [% PROCESS problem_name problem=item.obj -%]
[% CASE 'problemSent' %]
- [% tprintf(loc("Problem %s sent to council %s"), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>', item.obj.council ) %]
+ [% tprintf(loc("Problem %s sent to council %s"), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>', item.obj.bodies_str ) %]
[% CASE 'quesSent' %]
[% tprintf(loc("Questionnaire %d sent for problem %d"), item.obj.id, item.obj.problem_id ) %]
[% CASE 'quesAnswered' %]
@@ -36,7 +34,7 @@
[% CASE 'alertSub' %]
[% tprintf(loc("Alert %d created for %s, type %s, parameters %s / %s"), item.obj.id, item.obj.user.email, item.obj.alert_type.ref, item.obj.parameter, item.obj.parameter2) | html %]
[% CASE 'alertDel' %]
- [% tprintf(loc("Alert %d disabled (created %s)"), item.obj.id, alert_format.format( item.obj.whensubscribed_local ) ) %]
+ [% tprintf(loc("Alert %d disabled (created %s)"), item.obj.id, item.obj.whensubscribed_local.strftime('%H:%M:%S %e %B %Y') ) %]
[%- END %]
<br />
[%- END %]
diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html
index 1d5ee80b4..26d262f73 100644
--- a/templates/web/default/admin/update_edit.html
+++ b/templates/web/default/admin/update_edit.html
@@ -10,7 +10,10 @@
[%- cobrand_data = update.cobrand_data %]
[%- cobrand_data = c.data_for_generic_update IF !update.cobrand %]
<li><a href="[% c.uri_for_email( '/report', update.problem_id, cobrand_data ) %]#update_[% update.id %]">[% loc('View report on site' )%]</a></li>
-<li><label for='detail'>[% loc('Text:') %]</label><br><textarea name='text' id='text' cols=60 rows=10>[% update.text | html %]</textarea></li>
+
+<li><label for='detail'>[% loc('Text:') %]</label>
+<textarea name='text' id='text' cols=60 rows=10>[% update.text | html %]</textarea></li>
+
<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous">
<option [% 'selected ' IF update.anonymous %]value="1">[% loc('Yes') %]</option>
<option [% 'selected ' IF !update.anonymous %]value="0">[% loc('No') %]</option>
@@ -22,8 +25,8 @@
</select></li>
<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% update.name | html %]'></li>
<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% update.user.email | html %]'>
-[%- IF update.user.from_council && update.user.from_council == update.problem.council %]
-[% ' (' _ tprintf(loc('user is from same council as problem - %d'), update.user.from_council ) _')' %]
+[%- IF update.user.from_body && update.user.from_body.id == update.problem.bodies_str %]
+[% ' (' _ tprintf(loc('user is from same council as problem - %d'), update.user.from_body.id ) _')' %]
[% END -%]
[%- IF update.user.id == update.problem.user.id %]
[% ' (' _ loc('user is problem owner') _')' %]
diff --git a/templates/web/default/admin/user-form.html b/templates/web/default/admin/user-form.html
new file mode 100644
index 000000000..eec54d447
--- /dev/null
+++ b/templates/web/default/admin/user-form.html
@@ -0,0 +1,18 @@
+<form method="post" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <input type="hidden" name="token" value="[% token %]" >
+ <input type="hidden" name="submit" value="1" >
+ <ul>
+ <li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li>
+ <li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li>
+ <li>[% loc('Body:') %] <select id='body' name='body'>
+ <option value=''>[% loc('No body') %]</option>
+ [% FOR body IN bodies %]
+ <option value="[% body.id %]"[% ' selected' IF body.id == user.from_body.id %]>[% body.name %]</option>
+ [% END %]
+ </select>
+ [% IF c.cobrand.moniker != 'zurich' %]
+ <li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li>
+ [% END %]
+ </ul>
+ <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" >
+</form>
diff --git a/templates/web/default/admin/user_edit.html b/templates/web/default/admin/user_edit.html
index a03a4b734..d69c873a3 100644
--- a/templates/web/default/admin/user_edit.html
+++ b/templates/web/default/admin/user_edit.html
@@ -3,20 +3,6 @@
[% status_message %]
-<form method="post" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- <input type="hidden" name="token" value="[% token %]" >
- <input type="hidden" name="submit" value="1" >
-<ul>
-<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li>
-<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li>
-<li>[% loc('Council:') %] <select id='council' name='council'>
- <option value=''>[% loc('No council') %]</option>
-[% FOR council IN council_ids %]
- <option value="[% council %]"[% ' selected' IF council == user.from_council %]>[% council_details.$council.name %]</option>
-[% END %]
-</select>
-<li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li>
-</ul>
-<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
+[% INCLUDE 'admin/user-form.html' %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/search_users.html b/templates/web/default/admin/users.html
index 0b4ba88e7..de0b74746 100644
--- a/templates/web/default/admin/search_users.html
+++ b/templates/web/default/admin/users.html
@@ -1,31 +1,40 @@
[% INCLUDE 'admin/header.html' title=loc('Search Users') %]
[% PROCESS 'admin/report_blocks.html' %]
-<form method="get" action="[% c.uri_for('search_users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search">
+<form method="get" action="[% c.uri_for('users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search" value="[% searched | html %]">
</form>
-
[% IF searched %]
+
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<th>[% loc('Name') %]</th>
<th>[% loc('Email') %]</th>
- <th>[% loc('Council') %]</th>
+ <th>[% loc('Body') %]</th>
+ [% IF c.cobrand.moniker != 'zurich' %]
<th>[% loc('Flagged') %]</th>
+ [% END %]
<th>*</th>
</tr>
[%- FOREACH user IN users %]
<tr>
<td>[% PROCESS value_or_nbsp value=user.name %]</td>
- <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
- <td>[% PROCESS value_or_nbsp value=user.from_council %]</td>
+ <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
+ <td>[% PROCESS value_or_nbsp value=user.from_body.name %]</td>
+ [% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
+ [% END %]
<td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td>
</tr>
[%- END -%]
</table>
+[% ELSE %]
+
+<h2>[% loc('Add user') %]</h2>
+[% INCLUDE 'admin/user-form.html' %]
+
[% END %]
[% INCLUDE 'admin/footer.html' %]