aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/admin
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-07-07 16:59:23 +0100
committerMatthew Somerville <matthew@mysociety.org>2014-07-08 17:59:17 +0100
commitba8d2c4ba6f6c0216d618e77d368b640a2b92d1e (patch)
tree8b9e1a960f91c006606b5e0767a84a400dfc2fb0 /templates/web/base/admin
parent8f2c5942e3aa5d3b85e76b7353ab7ada87f97fc6 (diff)
Rename 'default' web directory to 'base'.
This should reduce confusion with the Default cobrand and override order.
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r--templates/web/base/admin/bodies.html75
-rw-r--r--templates/web/base/admin/body-form.html236
-rw-r--r--templates/web/base/admin/body.html192
-rw-r--r--templates/web/base/admin/body_edit.html103
-rw-r--r--templates/web/base/admin/config_page.html146
-rw-r--r--templates/web/base/admin/council_contacts.txt4
-rw-r--r--templates/web/base/admin/edit-league.html21
-rw-r--r--templates/web/base/admin/flagged.html62
-rw-r--r--templates/web/base/admin/footer.html1
-rw-r--r--templates/web/base/admin/header.html16
-rw-r--r--templates/web/base/admin/index.html50
-rw-r--r--templates/web/base/admin/list_updates.html46
-rw-r--r--templates/web/base/admin/problem_row.html43
-rw-r--r--templates/web/base/admin/questionnaire.html30
-rw-r--r--templates/web/base/admin/report_blocks.html42
-rw-r--r--templates/web/base/admin/report_edit.html101
-rw-r--r--templates/web/base/admin/reports.html33
-rw-r--r--templates/web/base/admin/stats.html97
-rw-r--r--templates/web/base/admin/timeline.html44
-rw-r--r--templates/web/base/admin/update_edit.html67
-rw-r--r--templates/web/base/admin/user-form.html56
-rw-r--r--templates/web/base/admin/user_edit.html8
-rw-r--r--templates/web/base/admin/users.html49
23 files changed, 1522 insertions, 0 deletions
diff --git a/templates/web/base/admin/bodies.html b/templates/web/base/admin/bodies.html
new file mode 100644
index 000000000..8bf7954f3
--- /dev/null
+++ b/templates/web/base/admin/bodies.html
@@ -0,0 +1,75 @@
+[% INCLUDE 'admin/header.html' title=loc('Bodies') -%]
+
+[% INCLUDE 'admin/edit-league.html' %]
+
+[% IF bodies.size == 0 %]
+ <p class="fms-admin-info">
+ [% loc('Currently no bodies have been created.') %]
+ <br>
+ [% loc('You need to add bodies (such as councils or departments) so that you can then add
+ the categories of problems they can handle (such as potholes or streetlights) and the
+ contacts (such as an email address) to which reports are sent.') %]
+ </p>
+[% ELSE %]
+ <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 %]
+ <th>[% loc('Deleted') %]</th>
+ </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[% IF body.deleted %] class="adminhidden"[% END %]>
+ <td>
+ [% IF c.cobrand.moniker == 'zurich' %]
+ [% FILTER repeat(4*body.api_key) %]&nbsp;[% END %]
+ [% IF admin_type == 'super' %]
+ <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a>
+ [% ELSE %]
+ [% body.name %]
+ [% END %]
+ [% ELSE %] [%# not Zurich: all bodies should be links %]
+ <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a>
+ [%- ', ' _ 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 %]
+ <td>[% IF body.deleted %][% loc('Yes') %][% END %]</td>
+ </tr>
+ [%- END %]
+ </table>
+[% END %]
+
+[% IF c.cobrand.moniker == 'zurich' %]
+ [% IF admin_type == 'super' %]
+ <h2>[% loc('Add body') %]</h2>
+ [% INCLUDE 'admin/body-form.html', body='' %]
+ [% END %]
+[% ELSE %]
+ <div class="admin-box">
+ <h2>[% loc('Add body') %]</h2>
+ [% INCLUDE 'admin/body-form.html', body='' %]
+ </div>
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html
new file mode 100644
index 000000000..608a77dc2
--- /dev/null
+++ b/templates/web/base/admin/body-form.html
@@ -0,0 +1,236 @@
+ <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">
+ <div class="fms-admin-info">
+ [% loc(
+ "Add a <strong>body</strong> for each administrative body, such as a council or department
+ to which problem reports can be sent. You can add one or more contacts (for different
+ categories of problem) to each body."
+ ) %]
+ </div>
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "The body's <strong>name</strong> identifies the body (for example, <em>Borsetshire District Council</em>)
+ and may be displayed publically."
+ ) %]
+ </p>
+ </div>
+ <p>
+ <label for="name">[% loc('Name') %]</label>
+ <input type="text" name="name" id="name" value="[% body.name %]" size="50">
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "Identify a <strong>parent</strong> if this body is itself part of another body.
+ For basic installations, you don't need to join bodies in this way."
+ ) %]
+ </p>
+ </div>
+ <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>
+
+ [% IF areas.size == 0 AND c.config.MAPIT_URL AND (NOT c.config.MAPIT_TYPES OR c.config.MAPIT_TYPES.size==O) %]
+ <p class="fms-admin-warning">
+ [% tprintf( loc(
+ '<code>MAPIT_URL</code> is set (<code>%s</code>) but no <code>MAPIT_TYPES</code>.<br>
+ This is probably why "area covered" is empty (below).<br>
+ Maybe add some <code>MAPIT_TYPES</code> to your config file?'), c.config.MAPIT_URL)
+ %]
+ </p>
+ [% END %]
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "This body will only be sent reports for problems that are located in the <strong>area covered</strong>.
+ A body will not receive any reports unless it covers at least one area."
+ ) %]
+ <br>
+ [% IF c.config.MAPIT_URL %]
+ [% tprintf( loc("The list of available areas is being provided by the MapIt service at %s."), c.config.MAPIT_URL) %]
+ [% ELSE %]
+ [% loc(
+ "No specific areas are currently available, because the <code>MAPIT_URL</code> in
+ your config file is not pointing to a live MapIt service.") %]
+ [% END %]
+ <br>
+ [% loc("For more information, see <a href='http://fixmystreet.org/customising/fms_and_mapit' class='admin-offsite-link'>How FixMyStreet uses Mapit</a>.")%]
+ </p>
+ </div>
+ <p>
+ <label for="area_ids">[% loc('Area covered') %]</label>
+ <select name="area_ids" id="area_ids" multiple>
+ <option value=""> -- [% loc('Select an area') %] -- </option>
+ [% SET body_areas = body.areas %]
+ [% FOR area IN areas %]
+ [% SET aid = area.id %]
+ <option value="[% area.id %]"[% ' selected' IF body_areas.$aid %]>[% area.name %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <div class="admin-hint">
+ <p>[% loc( "You can mark a body as deleted if you do not want it to be active on the site." ) %]</p>
+ </div>
+ <p>
+ <label for="deleted">[% loc('Flag as deleted') %]</label>
+ <input type="checkbox" name="deleted" id="deleted" value="1"[% ' checked' IF body.deleted %]>
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "The <strong>send method</strong> determines how problem reports will be sent to the body.
+ If you leave this blank, <strong>send method defaults to email</strong>."
+ ) %]
+ </p>
+ </div>
+ <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>
+
+ <div class="admin-open311-only">
+ <p class="fms-admin-info">
+ [% loc(
+ "These settings are for bodies that use Open311 (or other back-end integration) to receive problem reports.<br>
+ <strong>You don't need to set them if the Send Method is email.</strong>.
+ For more information on Open311, see
+ <a href='https://www.mysociety.org/2013/01/17/open311-explained/' class='admin-offsite-link'>this article</a>.
+ "
+ ) %]
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "The <strong>endpoint</strong> is the URL of the service that FixMyStreet will connect to
+ when sending reports to this body."
+ ) %]
+ </p>
+ </div>
+ <p>
+ <label for="endpoint">[% loc('Endpoint') %]</label>
+ <input type="text" name="endpoint" id="endpoint" value="[% body.endpoint %]" size="50">
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "The <strong>jurisdiction</strong> is only needed if the endpoint is serving more
+ than one. If the body is running its own endpoint, you can usually leave this blank."
+ ) %]
+ </p>
+ </div>
+ <p>
+ <label for="jurisdiction">Open311 Jurisdiction</label>
+ <input type="text" name="jurisdiction" id="jurisdiction" value="[% body.jurisdiction %]" size="50">
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "Some endpoints require an <strong>API key</strong> to indicate that the reports are being
+ sent from your FixMyStreet installation."
+ ) %]
+ </p>
+ </div>
+ <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>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "Enable <strong>Open311 update-sending</strong> if the endpoint will send and receive
+ updates to existing reports. If you're not sure, it probably does not, so leave this unchecked.
+ For more information, see
+ <a href='https://www.mysociety.org/2013/02/20/open311-extended/' class='admin-offsite-link'>this article</a>."
+ ) %]
+ </p>
+ </div>
+ <p>
+ <input type="checkbox" id="send_comments" name="send_comments"[% ' checked' IF body.send_comments %]>
+ <label for="send_comments" class="inline">Use Open311 update-sending extension</label>
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "If you've enabled Open311 update-sending above, you must identify which
+ FixMyStreet <strong>user</strong> will be attributed as the creator of those updates
+ when they are shown on the site. Enter the ID (number) of that user."
+ ) %]
+ </p>
+ </div>
+ <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>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "If you've enabled Open311 update-sending above, enable <strong>suppression of alerts</strong>
+ if you do <strong>not</strong> want that user to be notified whenever these updates are created."
+ ) %]
+ </p>
+ </div>
+ <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>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "If you've enabled Open311 update-sending above, Open311 usually only accepts OPEN or CLOSED status in
+ its updates. Enable <strong>extended Open311 stauses</strong> if you want to allow extra states to be passed.
+ Check that your cobrand supports this feature before switching it on."
+ ) %]
+ </p>
+ </div>
+ <p>
+ <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF conf.send_extended_statuses %]>
+ <label for="send_extended_statuses" class="inline">Send extended Open311 statuses with service request updates</label>
+ </p>
+ </div>
+
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "Enable this <strong>can be devolved</strong> setting if one or more contacts have a
+ different endpoint (and send method) from the body's. For example, if reports for some categories of
+ problem must be emailed, while others can be sent over Open311."
+ ) %]
+ <br>
+ [%# NB 'email' is a literal setting, so not translating it in following string? %]
+ [% tprintf( loc('Leave this blank if all reports to this body should be sent using the same send method (e.g., "%s").'), body.send_method or 'email' ) %]
+ </p>
+ </div>
+ <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">Send method or endpoints can be devolved to contacts (i.e, can be different from the body's)</label>
+ </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/base/admin/body.html b/templates/web/base/admin/body.html
new file mode 100644
index 000000000..b207d18ca
--- /dev/null
+++ b/templates/web/base/admin/body.html
@@ -0,0 +1,192 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
+
+[% IF updated %]
+ <p>
+ <em>[% updated %]</em>
+ </p>
+[% END %]
+
+<p>
+ [% IF example_pc %]
+ <a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]" class="admin-offsite-link">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> |
+ [% END %]
+ [% IF c.cobrand.moniker == 'emptyhomes' %]
+ <a href="[% c.uri_for( 'reports', search => 'body:' _ body_id ) %]">[% loc('List all reported problems' ) %]</a> |
+ [% ELSE %]
+ <a href="[% c.uri_for_email( '/reports/' _ body_id ) %]" class="admin-offsite-link">[% loc('List all reported problems' ) %]</a> |
+ [% END %]
+ <a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a>
+</p>
+
+[% IF body.send_method == 'Open311' %]
+ <h2>
+ Council contacts configured via Open311
+ </h2>
+[% END %]
+
+[% IF c.cobrand.moniker == 'fixmystreet' %]
+ <p class="error">Do not give these out except to people at the council.</p>
+[% END %]
+
+[% IF body.areas.size == 0 %]
+ <p class="fms-admin-warning">
+ [% loc("This body covers no area. This means that it has no jurisdiction over problems reported <em>at any location</em>.
+ Consequently, none of its categories will appear in the drop-down category menu when users report problems.
+ Currently, users <strong>cannot report problems to this body</strong>.") %]
+ <br>
+ [% loc("Fix this by choosing an <strong>area covered</strong> in the <em>Edit body details</em> form below.") %]
+ </p>
+[% END %]
+
+[% IF live_contacts == 0 %]
+ <p class="fms-admin-warning">
+ [% loc("This body has no contacts. This means that currently problems reported to this body <strong>will not be sent</strong>.") %]
+ <br>
+ [% loc("Add a contact using the form below.") %]
+ </p>
+[% END %]
+
+<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>
+ <th>[% loc('Category') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('Confirmed') %]</th>
+ <th>[% loc('Deleted') %]</th>
+ <th>[% loc('Devolved') %]</th>
+ <th>[% loc('Last editor') %]</th>
+ <th>[% loc('Note') %]</th>
+ <th>[% loc('Public') %]</th>
+ <th>[% loc('When edited') %]</th>
+ <th>[% loc('Confirm') %]</th>
+ </tr>
+ [% WHILE ( contact = contacts.next ) %]
+ <tr [% IF contact.deleted %]class="is-deleted"[% END %]>
+ <td class="contact-category"><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 %]<strong>[% loc('Yes') %]</strong>[% 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>
+ <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td>
+ <td><input type="checkbox" name="confirmed" value="[% contact.category %]"></td>
+ </tr>
+ [% END %]
+ </table>
+
+ <p>
+ <input type="hidden" name="posted" value="update">
+ <input type="hidden" name="token" value="[% token %]">
+ <input type="submit" name="Update statuses" value="[% loc('Update statuses') %]">
+ </p>
+</form>
+
+<div class="admin-box">
+ <h2>[% loc('Add new category') %]</h2>
+ <p class="fms-admin-info">
+ [% loc("Each contact for the body has a category, which is displayed to the public.
+ Different categories <strong>can have the same contact</strong> (email address).
+ This means you can add many categories even if you only have one contact for the body.
+ ") %]
+ </p>
+
+ <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' %]
+ <div class="admin-hint">
+ <p>
+ [% loc('Choose a <strong>category</strong> name that makes sense to the public (e.g., "Pothole", "Street lighting") but is helpful
+ to the body too. These will appear in the drop-down menu on the report-a-problem page.') %]
+ <br>
+ [% loc("If two or more bodies serve the same location, FixMyStreet combines identical categories into a single entry in
+ the menu. Make sure you use the same category name in the bodies if you want this to happen.") %]
+ </p>
+ </div>
+ <p>
+ <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30">
+ </p>
+ [% END %]
+
+ <div class="admin-hint">
+ <p>
+ [% loc("The <strong>email address</strong> is the destination to which reports about this category will be sent.
+ Other categories for this body may have the same email address.") %]
+ </p>
+ [% IF (body.send_method AND body.send_method != 'Email') OR body.can_be_devolved %]
+ <p>
+ [% loc("If you're using <strong>a send method that is not email</strong>, enter the service ID (Open311) or equivalent identifier here.") %]
+ </p>
+ [% END %]
+ </div>
+
+ <p>
+ <strong>[% loc('Email address:') %] </strong><input type="text" name="email" size="30">
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc("Check <strong>confirmed</strong> to indicate that this contact has been confirmed as correct.
+ If you are not sure of the origin or validity of the contact, leave this unchecked.") %]
+ </p>
+ </div>
+ <p>
+ <input type="checkbox" name="confirmed" value="1" id="confirmed">
+ <label for="confirmed" class="inline">[% loc('Confirmed') %]</label>
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc("Check <strong>deleted</strong> to remove the category from use.
+ It will not appear as an available category in the drop-down menu on the report-a-problem page.") %]
+ </p>
+ </div>
+ <p>
+ <input type="checkbox" name="deleted" value="1" id="deleted">
+ <label for="deleted" class="inline">[% loc('Deleted') %]</label>
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc("Use the <strong>note</strong> to record details that are only displayed in the admin. Notes are not shown publicly, and are not sent to the body.") %]
+ </p>
+ </div>
+ <p>
+ <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea>
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc("Check <strong>private</strong> if reports in this category should <strong>never be displayed on the website</strong>.
+ <br>
+ Normally, categories are not private.
+ <br>
+ This is suitable for issues that you want to allow users to report to the body, but for which there is no public
+ interest in displaying the report. In the UK, we've used this for services like requesting an extra rubbish bin
+ at a specific address.") %]
+ </p>
+ </div>
+ <p>
+ <input type="checkbox" name="non_public" value="1" id="non_public">
+ <label for="non_public" class="inline">[% loc('Private') %]</label>
+ </p>
+
+ <p>
+ <input type="hidden" name="posted" value="new" >
+ <input type="hidden" name="token" value="[% token %]" >
+ <input type="submit" name="Create category" value="[% loc('Create category') %]" >
+ </p>
+
+ <div>
+ <input type="hidden" name=".cgifields" value="confirmed" >
+ <input type="hidden" name=".cgifields" value="deleted" >
+ </div>
+ </form>
+</div>
+<div class="admin-box">
+ <h2>[% loc('Edit body details') %]</h2>
+ [% INCLUDE 'admin/body-form.html' %]
+</div>
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/body_edit.html b/templates/web/base/admin/body_edit.html
new file mode 100644
index 000000000..f2bae0c0b
--- /dev/null
+++ b/templates/web/base/admin/body_edit.html
@@ -0,0 +1,103 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
+
+[% BLOCK highlightchanged_yesno %]
+[%- output = loc('No') %]
+[%- IF new.$value %][% output = loc('Yes') %][% END %]
+[%- IF old && old.$value != new.$value %]<strong>[% output %]</strong>[% ELSE %][% output %][% END %]
+[%- END %]
+
+[% BLOCK highlightchanged %]
+[%- IF old && old.$value != new.$value %]<strong>[% new.$value %]</strong>[% ELSE %][% new.$value %][% END %]
+[%- END %]
+<p>
+<em>[% updated %]</em>
+</p>
+
+<p>
+[% IF example_pc %]
+<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]" class="admin-offsite-link">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a>
+[% END %]
+</p>
+
+<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 %]" >
+ <p><strong>[% loc('Email:') %] </strong>
+ <input type="text" name="email" value="[% contact.email | html %]" size="30">
+
+ <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('body', body_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="[% contact.endpoint %]" size="50">
+ </p>
+
+ <p>
+ <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>
+ <input type="text" name="api_key" id="api_key" value="[% contact.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 contact.send_method == method %]>[% method %]</option>
+ [% END %]
+ </select>
+ </p>
+ [% END %]
+
+ <input type="hidden" name="posted" value="new">
+ <p><input type="submit" name="Save changes" value="[% loc('Save changes') %]">
+</form>
+
+<h2>[% loc('History') %]</h2>
+<table border="1">
+ <tr>
+ <th>[% loc('When edited') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('Confirmed') %]</th>
+ <th>[% loc('Deleted') %]</th>
+ <th>[% loc('Editor') %]</th>
+ <th>[% loc('Note') %]</th>
+ </tr>
+ [%- prev = '' %]
+ [%- WHILE ( contact = history.next ) %]
+ <tr>
+ <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td>
+ <td>[% PROCESS highlightchanged old=prev new=contact value='email' %]</td>
+ <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='confirmed' %]</td>
+ <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='deleted' %]</td>
+ <td>[% contact.editor %]</td>
+ <td>[% contact.note | html %]</td>
+ </tr>
+ [%- prev = contact %]
+ [%- END %]
+</table>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html
new file mode 100644
index 000000000..83300e4db
--- /dev/null
+++ b/templates/web/base/admin/config_page.html
@@ -0,0 +1,146 @@
+[% INCLUDE 'admin/header.html' title=loc('Configuration') -%]
+
+[% BLOCK subsection %]
+<tr><td colspan=3><strong>[% heading %]</strong></td></tr>
+[% END %]
+
+[% BLOCK just_value %]
+[% SET conf = c.config.$value IF NOT conf;
+ conf = conf.join(', ') IF conf.size %]
+<tr>
+ <td>[% value %]</td>
+ <td colspan=2>[% conf or conf_default %]</td>
+</tr>
+[% END %]
+
+[% BLOCK with_cobrand %]
+[% SET conf = c.config.$value IF NOT conf;
+ conf = conf.join(', ') IF conf.size;
+ cob = cob.join(', ') IF conf.size %]
+<tr>
+ <td>[% value %]</td>
+ <td>[% conf %]</td>
+ <td>[% cob IF cob != conf %]</td>
+</tr>
+[% END %]
+
+<p>A summary of this site's configuration,
+running version <strong>[% git_version || 'unknown' %]</strong>.
+</p>
+
+<table>
+<tr><th>Variable</th>
+ <th>general.yml value</th>
+ <th>Cobrand module override</th>
+</tr>
+
+[% INCLUDE subsection heading="URLs" %]
+[% INCLUDE with_cobrand value="BASE_URL" cob=c.cobrand.base_url %]
+[% INCLUDE with_cobrand value="ADMIN_BASE_URL" cob=c.cobrand.admin_base_url %]
+
+[% INCLUDE subsection heading="Display" %]
+[% allowed_conf = FOR k IN c.config.ALLOWED_COBRANDS %]
+ [% IF k.keys %][% k.items.join(':') %][% ELSE %][% k %][% END %]
+ [%- ',' IF NOT loop.last %]
+[% END %]
+[% INCLUDE just_value value="ALLOWED_COBRANDS" conf = allowed_conf %]
+<tr>
+<td>Web templates</td>
+<td colspan=2>[% c.cobrand.path_to_web_templates.join('<br>') %]</td>
+</tr>
+[% INCLUDE with_cobrand value="MAP_TYPE" cob=c.cobrand.map_type %]
+[% INCLUDE with_cobrand value="EXAMPLE_PLACES"
+ conf = decode(c.config.EXAMPLE_PLACES.join(', '))
+ cob = c.cobrand.example_places %]
+[% INCLUDE with_cobrand value="LANGUAGES"
+ cob = c.cobrand.languages %]
+<tr><td>Language override</td>
+ <td>-</td>
+ <td>
+ [% 'domain=' _ c.cobrand.language_domain IF c.cobrand.language_domain %]
+ [% 'language=' _ c.cobrand.language_override IF c.cobrand.language_override %]
+ </td>
+</tr>
+[% INCLUDE with_cobrand value="ALL_REPORTS_PER_PAGE" cob=c.cobrand.reports_per_page %]
+[% INCLUDE just_value value="RSS_LIMIT" %]
+[% INCLUDE just_value value="AREA_LINKS_FROM_PROBLEMS" %]
+
+[% INCLUDE subsection heading="Geocoder" %]
+[% INCLUDE just_value value="GEOCODER"
+ conf_default = '<em>(None; default Nominatim OSM)</em>'
+%]
+[% disconf = FOR k IN c.config.GEOCODING_DISAMBIGUATION %]
+ [% k.key %]=[% k.value %][% ',' IF NOT loop.last %]
+[% END %]
+[% discob = FOR k IN c.cobrand.disambiguate_location %]
+ [% k.key %]=[% k.value %][% ',' IF NOT loop.last %]
+[% END %]
+[% INCLUDE with_cobrand value="GEOCODING_DISAMBIGUATION"
+ conf = disconf
+ cob = discob %]
+
+[% INCLUDE subsection heading="MapIt" %]
+[% INCLUDE just_value value="MAPIT_URL" %]
+[% INCLUDE with_cobrand value="MAPIT_TYPES"
+ cob = c.cobrand.area_types %]
+[% INCLUDE just_value value="MAPIT_ID_WHITELIST" %]
+[% INCLUDE just_value value="MAPIT_GENERATION" %]
+[% INCLUDE with_cobrand value="MAPIT_TYPES_CHILDREN"
+ cob = c.cobrand.area_types_children %]
+
+[% INCLUDE subsection heading="Database" %]
+[% INCLUDE just_value value="FMS_DB_HOST" %]
+[% INCLUDE just_value value="FMS_DB_PORT" %]
+[% INCLUDE just_value value="FMS_DB_NAME" %]
+[% INCLUDE just_value value="FMS_DB_USER" %]
+
+[% INCLUDE subsection heading="Email" %]
+[% INCLUDE just_value value="EMAIL_DOMAIN" %]
+[% INCLUDE with_cobrand value="CONTACT_NAME" cob=c.cobrand.contact_name %]
+[% INCLUDE with_cobrand value="CONTACT_EMAIL" cob=c.cobrand.contact_email %]
+[% INCLUDE just_value value="DO_NOT_REPLY_EMAIL" %]
+
+[% INCLUDE subsection heading="Development" %]
+[% INCLUDE just_value value="STAGING_SITE" %]
+[% INCLUDE just_value value="SEND_REPORTS_ON_STAGING" %]
+[% INCLUDE just_value value="UPLOAD_DIR" %]
+[% INCLUDE just_value value="GEO_CACHE" %]
+[% INCLUDE just_value value="TESTING_COUNCILS" %]
+[% INCLUDE just_value value="SMTP_SMARTHOST" %]
+[% INCLUDE just_value value="TIME_ZONE" %]
+[% INCLUDE just_value value="GAZE_URL" %]
+
+</table>
+
+<h2>Cobrand module</h2>
+
+Other things can be changed on a cobrand basis by using functions in an
+(optional) Cobrand .pm module, as explained in the
+<a href="http://fixmystreet.org/customising/" class="admin-offsite-link">customising section of our
+documentation</a>. If you wish to add new functionality just for your cobrand
+that can't be done simply by changes to your cobrand's templates, you might
+need to add a new Cobrand function.
+
+<p>Examples of cobrand functions are below; this is not exhaustive.
+Many were added for one specific cobrand, so didn't need a general
+configuration option. Please feel free to discuss on <a
+href="http://fixmystreet.org/community/" class="admin-offsite-link">our mailing list</a> if you think
+something should be moved to the general.yml file, done differently,
+or have any questions.</p>
+
+<ul style="font-size: 80%">
+<li>allow_photo_upload: [% c.cobrand.allow_photo_upload %],
+ allow_photo_display: [% c.cobrand.allow_photo_display %]</li>
+<li>send_questionnaires: [% c.cobrand.send_questionnaires %],
+ ask_ever_reported: [% c.cobrand.ask_ever_reported %]</li>
+<li>default_map_zoom: [% c.cobrand.default_map_zoom or '-' %]</li>
+<li>default_show_name: [% c.cobrand.default_show_name %]</li>
+<li>users_can_hide: [% c.cobrand.users_can_hide %]</li>
+<li>report_sent_confirmation_email: [% c.cobrand.report_sent_confirmation_email %]</li>
+<li>never_confirm_reports: [% c.cobrand.never_confirm_reports %],
+ allow_anonymous_reports: [% c.cobrand.allow_anonymous_reports %],
+ show_unconfirmed_reports: [% c.cobrand.show_unconfirmed_reports %]</li>
+</ul>
+
+[% INCLUDE 'admin/footer.html' %]
+
diff --git a/templates/web/base/admin/council_contacts.txt b/templates/web/base/admin/council_contacts.txt
new file mode 100644
index 000000000..2d1e04bfa
--- /dev/null
+++ b/templates/web/base/admin/council_contacts.txt
@@ -0,0 +1,4 @@
+[% WHILE ( contact = contacts.next ) -%]
+[%- NEXT IF contact.deleted || ! contact.confirmed %]
+[% contact.category %] [% contact.email %]
+[%- END %]
diff --git a/templates/web/base/admin/edit-league.html b/templates/web/base/admin/edit-league.html
new file mode 100644
index 000000000..4f31eeb2e
--- /dev/null
+++ b/templates/web/base/admin/edit-league.html
@@ -0,0 +1,21 @@
+<div class="admin-hint">
+ <p>
+ [% loc(
+ "The diligency prize league table shows editors' activity (who's been editing the most records)."
+ ) %]
+ </p>
+</div>
+<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/base/admin/flagged.html b/templates/web/base/admin/flagged.html
new file mode 100644
index 000000000..518d1b14e
--- /dev/null
+++ b/templates/web/base/admin/flagged.html
@@ -0,0 +1,62 @@
+[% INCLUDE 'admin/header.html' title=loc('Flagged reports and users') %]
+[% PROCESS 'admin/report_blocks.html' %]
+
+<p class="fms-admin-info">
+ [% loc("You can flag any report or user by editing them, and they will be listed on this page.
+ For example, this can useful if you want to keep an eye on a user who has posted inappropriate
+ reports in the past.") %]
+</p>
+
+<h2>[% loc( 'Problems' ) %]</h2>
+[% IF problems.size > 0 %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Title') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Body') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>*</th>
+ </tr>
+ [% INCLUDE 'admin/problem_row.html' %]
+</table>
+[% ELSE %]
+ <p class="fms-admin-warning">
+ [% loc('No flagged problems found.') %]
+ </p>
+[% END %]
+
+<h2>[% loc( 'Users' ) %]</h2>
+<p class="fms-admin-info">
+ [% loc("Flagged users are not restricted in any way. This is just a list of users that have been marked for attention.") %]
+</p>
+
+[% IF users.size %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('In abuse table?') %]</th>
+ <th>&nbsp;</th>
+ </tr>
+ [%- FOREACH user IN users %]
+ <tr [% IF user.flagged == 2 %]class="is-deleted"[% END %]>
+ <td>[% user.name | html %]</td>
+ <td>[% user.email | html %]</td>
+ <td>
+ [% IF user.flagged == 2 %] <strong>[% loc('Yes') %]</strong> [% ELSE %] &nbsp; [% END %]
+ </td>
+ <td>
+ <a href="[% c.uri_for( 'reports', search => user.email ) %]">list content</a>
+ [% IF user.id %] | <a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('edit user') %]</a>[% END %]
+ </td>
+ </tr>
+ [%- END %]
+</table>
+[%- ELSE %]
+<p class="fms-admin-warning">
+ [% loc('No flagged users found.') %]
+</p>
+[%- END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/footer.html b/templates/web/base/admin/footer.html
new file mode 100644
index 000000000..4c891c4ff
--- /dev/null
+++ b/templates/web/base/admin/footer.html
@@ -0,0 +1 @@
+[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/admin/header.html b/templates/web/base/admin/header.html
new file mode 100644
index 000000000..9f3503e20
--- /dev/null
+++ b/templates/web/base/admin/header.html
@@ -0,0 +1,16 @@
+[% INCLUDE 'header.html' admin = 1, bodyclass = 'fullwidthpage admin show-admin-notes' %]
+<style type="text/css">
+dt { clear: left; float: left; font-weight: bold; }
+dd { margin-left: 8em; }
+.adminhidden { color: #666666; }
+.error { color: red; }
+select { width: auto; }
+</style>
+
+ <p><strong>[% loc('FixMyStreet admin:') %]</strong>
+ [%- FOREACH link IN allowed_links %]
+ <a href="[% c.uri_for( link ) %]">[% allowed_pages.$link.0 %]</a>
+ [% IF NOT loop.last %]|[% END %]
+ [% END %]</p>
+
+ <h1>[% title %]</h1>
diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html
new file mode 100644
index 000000000..ad5932d97
--- /dev/null
+++ b/templates/web/base/admin/index.html
@@ -0,0 +1,50 @@
+[% INCLUDE 'admin/header.html' title=loc('Summary') -%]
+
+[% IF total_bodies == 0 %]
+ <p class="fms-admin-info">
+ [% loc('Currently no bodies have been created.') %]
+ <br>
+ [% tprintf( loc('You need to <a href="%s">add some bodies</a> (such as councils or departments) before any reports can be sent.'), c.uri_for('bodies')) %]
+ </p>
+[% END %]
+
+[%- BLOCK states -%]
+<h2>[% title %]</h2>
+
+[%- FOREACH state IN object.keys.sort %]
+[%- '<ul>' IF loop.first %]
+ <li>[% object.$state %] [% state %]</li>
+[%- "\n</ul>" IF loop.last %]
+[%- END %]
+[% END -%]
+
+ <ul>
+ <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %];
+ [% tprintf( loc('from %d different users'), total_problems_users ) %]</li>
+ <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li>
+ <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li>
+ <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li>
+ <li>[% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li>
+ </ul>
+
+[% IF c.cobrand.admin_show_creation_graph -%]
+ <p>
+ <a href="[% c.config.BASE_URL %]/fms-live-creation.png" class="admin-offsite-link">[% loc('Graph of problem creation by status over time') %]</a>
+ </p>
+[% END -%]
+
+[% PROCESS states title=loc('Problem breakdown by state') object=problems %]
+
+[% PROCESS states title=loc('Update breakdown by state') object=comments %]
+
+[% FOREACH category IN categories %]
+ [% IF loop.first %]
+ <h2>[% loc('Category fix rate for problems > 4 weeks old') %]</h2>
+ <table>
+ <tr><th>[% loc('Category') %]</th><th>[% loc('Total') %]</th><th>[% loc('Fixed') %]</th></tr>
+ [% END %]
+ <tr><td>[% category.key %]</td><td>[% category.value.total %]</td><td>[% category.value.fixed / category.value.total * 100 | format('%.1f') %]%</td></tr>
+ [% '</table>' IF loop.last %]
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html
new file mode 100644
index 000000000..02845b0ee
--- /dev/null
+++ b/templates/web/base/admin/list_updates.html
@@ -0,0 +1,46 @@
+[% IF updates.size %]
+<h2>[% loc('Updates') %]</h2>
+
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Owner') %]</th>
+ <th>[% loc('Council') %]</th>
+ <th>[% loc('Cobrand') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>[% loc('Text') %]</th>
+ <th>*</th>
+ </tr>
+[% FOREACH update IN updates -%]
+ <tr[% ' class="adminhidden"' IF update.state == 'hidden' || update.problem.state == 'hidden' %]>
+ <td>[%- IF update.state == 'confirmed' && update.problem.state != 'hidden' -%]
+ [%- cobrand_data = update.cobrand_data;
+ cobrand_data = c.data_for_generic_update IF !update.cobrand;
+ IF cobrand_data;
+ uri = c.uri_for_email( '/report', update.problem.id, cobrand_data );
+ ELSE;
+ uri = c.uri_for_email( '/report', update.problem.id );
+ END;
+ %]
+ <a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% update.id %]</a>
+ [%- ELSE %]
+ [%- update.id %]
+ [%- END -%]</td>
+ <td>[% PROCESS value_or_nbsp value=update.name %]
+ <br>[% PROCESS value_or_nbsp value=update.user.email %]
+ <br>[% loc('Anonymous') %]: [% 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_body( update.problem.bodies_str ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
+ <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td>
+ <td>[% update.state %]<br><small>
+ [% loc('Created:') %] [% PROCESS format_time time=update.created %]
+ <br>[% loc('Confirmed:') %] [% PROCESS format_time time=update.confirmed %]
+ </small></td>
+ <td>[% update.text | html %]</td>
+ <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td>
+ </tr>
+[% END -%]
+</table>
+[% END %]
diff --git a/templates/web/base/admin/problem_row.html b/templates/web/base/admin/problem_row.html
new file mode 100644
index 000000000..2413a6062
--- /dev/null
+++ b/templates/web/base/admin/problem_row.html
@@ -0,0 +1,43 @@
+[%- FOR problem IN problems %]
+ <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]>
+ <td class="record-id">[%- IF problem.is_visible -%]
+ [%- cobrand_data = problem.cobrand_data;
+ cobrand_data = c.data_for_generic_problem IF !problem.cobrand;
+ IF cobrand_data;
+ uri = c.uri_for_email( '/report', problem.id, cobrand_data );
+ ELSE;
+ uri = c.uri_for_email( '/report', problem.id );
+ END;
+ %]
+ <a href="[% uri %]" class="admin-offsite-link">[% problem.id %]</a>
+ [%- ELSE %]
+ [%- problem.id %]
+ [%- END -%]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.title %]</td>
+ <td>
+ [% PROCESS value_or_nbsp value=problem.name %]
+ <br>[% PROCESS value_or_nbsp value=problem.user.email %]
+ <br>[% loc('Anonymous') %]: [% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]
+ </td>
+ <td>
+ [% PROCESS value_or_nbsp value=problem.category %]
+ <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>
+ [% END %]
+ [%- ELSE -%]
+ [%- PROCESS value_or_nbsp value=problem.bodies_str -%]
+ [%- END -%]
+ <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %]
+ </td>
+ <td>[% problem.state %]<br><small>
+ [% loc('Created') %]:&nbsp;[% PROCESS format_time time=problem.created %]
+ <br>[% loc('When sent') %]:&nbsp;[% PROCESS format_time time=problem.whensent %]
+ [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %]&nbsp;[% PROCESS format_time time=problem.confirmed %][% END -%]
+ [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]
+ [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]
+ [%- IF problem.is_open %]<br>[% loc('Last&nbsp;update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]
+ </small></td>
+ <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
+ </tr>
+[%- END -%]
diff --git a/templates/web/base/admin/questionnaire.html b/templates/web/base/admin/questionnaire.html
new file mode 100644
index 000000000..680e0d214
--- /dev/null
+++ b/templates/web/base/admin/questionnaire.html
@@ -0,0 +1,30 @@
+[% INCLUDE 'admin/header.html' title=loc('Survey Results') %]
+
+<table border="1">
+ <tr>
+ <th>[% loc('Reported before') %]</th>
+ <th>[% loc('Not reported before') %]</th>
+ </tr>
+ [% IF questionnaires.total > 0 %]
+ <tr>
+ <td>[% questionnaires.1 %] ([% 100 * questionnaires.1 / questionnaires.total | format('%.1f') %]%)</td>
+ <td>[% questionnaires.0 %] ([% 100 * questionnaires.0 / questionnaires.total | format('%.1f') %]%)</td>
+ </tr>
+ [% ELSE %]
+ <tr>
+ <td>[% loc('n/a') %]</td>
+ <td>[% loc('n/a') %]</td>
+ </tr>
+ [% END %]
+</table>
+
+<h2>[% loc('Problem state change based on survey results') %]</h2>
+
+<table>
+<tr><th>[% loc('Old state') %]</th><th>[% loc('New state') %]</th><th>[% loc('Total') %]</th></tr>
+[% WHILE ( s = state_changes.next ) %]
+<tr><td>[% s.old_state %]</td><td>[% s.new_state %]</td><td>[% s.get_column('c') %] ([% 100 * s.get_column('c') / state_changes_count | format('%.1f') %]%)</td></tr>
+[% END %]
+</table>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html
new file mode 100644
index 000000000..c2cffc352
--- /dev/null
+++ b/templates/web/base/admin/report_blocks.html
@@ -0,0 +1,42 @@
+[% BLOCK value_or_nbsp -%]
+ [%- IF value %][% value | html %][% ELSE %]&nbsp;[% END %]
+[%- END %]
+
+[% BLOCK format_time -%]
+ [%- IF time %][% time.ymd %]&nbsp;[% time.hms %][% ELSE %][% no_time || '&nbsp;' %][% END %][% no_time = '' %]
+[%- END %]
+
+[% BLOCK abuse_button -%]
+[% IF allowed_pages.abuse_edit -%]
+[% IF email_in_abuse %]<small>[% loc('(Email in abuse table)') %]</small>[% ELSE %]<input type="submit" name="banuser" value="[% loc('Ban email address') %]" />[% END %]
+[%- END %]
+[%- END %]
+
+[% 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 %]
+
+[% BLOCK sort_link %][% IF order == choice %][% c.uri_with( d => 1 - dir ) %][% ELSE %][% c.uri_with( { o => choice, d => 0 } ) %][% END %][% END %]
+
+[% BLOCK sort_arrow %]
+ [% IF order == choice %]
+ <span style="font-size:50%">
+ [% IF dir %]
+ &#9660;
+ [% ELSE %]
+ &#9650;
+ [% END %]
+ </span>
+ [% ELSE %]
+ <span style="font-size:50%; color: #999;">
+ &#9650;
+ </span>
+ [% END %]
+[% END %]
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html
new file mode 100644
index 000000000..12560fdf3
--- /dev/null
+++ b/templates/web/base/admin/report_edit.html
@@ -0,0 +1,101 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing problem %d'), problem.id ) -%]
+[% PROCESS 'admin/report_blocks.html' %]
+
+[% status_message %]
+
+<form method="post" action="[% c.uri_for( 'report_edit', problem.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>
+ [%- cobrand_data = problem.cobrand_data;
+ cobrand_data = c.data_for_generic_problem IF !problem.cobrand;
+ IF cobrand_data;
+ uri = c.uri_for_email( '/report', problem.id, cobrand_data );
+ ELSE;
+ uri = c.uri_for_email( '/report', problem.id );
+ END;
+ %]
+<li><a href="[% uri %]" class="admin-offsite-link">[% 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>
+<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>
+[% IF problem.extra.address %]
+<li>[% loc('Property address:') %] [% problem.extra.address | html %]</li>
+[% END %]
+<li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state">
+[% FOREACH group IN [
+ [ loc('Open'), [
+ [ 'confirmed', loc('Open') ], [ 'investigating', loc('Investigating') ],
+ [ 'planned', loc('Planned') ], [ 'in progress', loc('In progress') ],
+ [ 'action scheduled', loc('Action Scheduled') ],
+ ] ],
+ [ loc('Fixed'), [
+ [ 'fixed', loc('Fixed') ], [ 'fixed - user', loc('Fixed - User') ],
+ [ 'fixed - council', loc('Fixed - Council') ]
+ ] ],
+ [ loc('Closed'), [
+ [ 'unable to fix', loc('Unable to fix') ], [ 'not responsible', loc('Not Responsible') ],
+ [ 'duplicate', loc('Duplicate') ], [ 'closed', loc('Closed') ],
+ [ 'internal referral', loc('Internal referral') ],
+ ] ],
+ [ loc('Hidden'), [
+ [ 'hidden', loc('Hidden') ], [ 'partial', loc('Partial') ], [ 'unconfirmed',loc('Unconfirmed') ]
+ ] ]
+] %]
+ <optgroup label="[% group.0 %]">
+ [% FOREACH state IN group.1 %]
+ <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
+ [% END %]
+ </optgroup>
+[% END %]
+</select></li>
+<li>[% loc('Category:') %] [% problem.category | html %] </li>
+<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>
+<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% problem.name | html %]'></li>
+<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% problem.user.email | html %]'> [% PROCESS abuse_button %] [% PROCESS flag_button user=problem.user %]</li>
+<li>[% loc('Phone:') %] [% problem.user.phone | html %]</li>
+<li>[% loc('Created:') %] [% PROCESS format_time time=problem.created %]</li>
+<li>[% loc('Confirmed:') %] [% PROCESS format_time time=problem.confirmed no_time='-' %]</li>
+<li>[% loc('Sent:') %] [% PROCESS format_time time=problem.whensent %] [% IF problem.state == 'confirmed' %]<input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]">[% END %]</li>
+<li>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %]</li>
+<li>[% loc('Service:') %] [% problem.service %]</li>
+<li>[% loc('Cobrand:') %] [% problem.cobrand %]</li>
+<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 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="Photo of this report" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %]
+ [%~ IF problem.photo.length == 40 ~%]
+ /photo/[% problem.photo %].temp.jpeg
+ [%~ ELSE ~%]
+ [% photo.url %]
+ [%~ END %]">
+<br>
+<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 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>
+
+[% INCLUDE 'admin/list_updates.html' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/reports.html b/templates/web/base/admin/reports.html
new file mode 100644
index 000000000..7267dd11d
--- /dev/null
+++ b/templates/web/base/admin/reports.html
@@ -0,0 +1,33 @@
+[% 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">
+ <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search" value="[% searched | html %]">
+</form>
+
+[% IF problems.size %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Title') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Body') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>*</th>
+ </tr>
+ [% INCLUDE 'admin/problem_row.html' %]
+</table>
+
+[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %]
+
+[% ELSIF searched %]
+
+<div class="fms-admin-warning">
+ [% loc("Searching found no reports.") %]
+</div>
+
+[% END %]
+
+[% INCLUDE 'admin/list_updates.html' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/stats.html b/templates/web/base/admin/stats.html
new file mode 100644
index 000000000..d143d9f28
--- /dev/null
+++ b/templates/web/base/admin/stats.html
@@ -0,0 +1,97 @@
+[% INCLUDE 'admin/header.html' title=loc('Stats') %]
+
+[% IF show_count %]
+<p>
+<strong>[% tprintf( unconfirmed ? loc( 'All reports between %s and %s' ) : loc( 'Confirmed reports between %s and %s' ), start_date.ymd, end_date.ymd ) | html %]</strong>
+</p>
+[% IF bymonth %]
+<table>
+ <thead>
+ <td style="width: 8em"><strong>[% loc('Year') %]</strong></td>
+ <td style="width: 8em"><strong>[% loc('Month') %]</strong></td>
+ <td><strong>[% loc('Count') %]</strong></td>
+ </thead>
+ [% total = 0 %]
+ [% WHILE ( state = states.next ) %]
+ [% total = total + state.get_column( 'count' ) %]
+ <tr>
+ <td>[% state.get_column( 'c_year') | html %]</td>
+ <td>[% state.get_column( 'c_month') | html %]</td>
+ <td>[% state.get_column( 'count' ) %]</td>
+ </tr>
+ [% END %]
+ <tr>
+ <td colspan="2"><strong>[% loc( 'Total' ) %]</strong></td>
+ <td><strong>[% total %]</strong></td>
+ </tr>
+</table>
+[% ELSE %]
+<table>
+ <thead>
+ <td style="width: 8em"><strong>[% loc('Current state') %]</strong></td>
+ <td><strong>[% loc('Count') %]</strong></td>
+ </thead>
+ [% total = 0 %]
+ [% WHILE ( state = states.next ) %]
+ [% total = total + state.get_column( 'count' ) %]
+ <tr>
+ <td>[% state.state | html %]</td>
+ <td>[% state.get_column( 'count' ) %]</td>
+ </tr>
+ [% END %]
+ <tr>
+ <td><strong>[% loc( 'Total' ) %]</strong></td>
+ <td><strong>[% total %]</strong></td>
+ </tr>
+</table>
+[% END %]
+
+[% IF unconfirmed %]
+ <p>
+ <small>[% loc( 'Note that when including unconfirmed reports we use the date the report was created which may not be in the same month the report was confirmed so the numbers may jump about a little' ) %]</small>
+ </p>
+[% END %]
+[% END %]
+
+[% IF errors %]
+ [% FOREACH error IN errors %]
+ <p class="error">[% error %]</p>
+ [% END %]
+[% END %]
+
+<form method="post" action="[% c.uri_for('stats') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p>
+ <label for="start_date">[% loc('Start Date:') %]</label><input type="text"
+ placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="start_date" id="start_date"
+ value="[% start_date ? start_date.strftime( '%d/%m/%Y') : '' | html %]" />
+ </p>
+
+ <p>
+ <label for="end_date">[% loc('End Date:') %]</label><input type="text"
+ placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="end_date" id="end_date" size="5"
+ value="[% end_date ? end_date.strftime( '%d/%m/%Y') : '' | html %]" />
+ </p>
+
+ <p>
+ <input type="checkbox" name="unconfirmed" id="unconfirmed"[% unconfirmed ? ' checked' : '' %] /><label class="inline" for="unconfirmed">[% loc('Include unconfirmed reports') %]</label>
+ </p>
+
+ <p>
+ <input type="checkbox" name="bymonth" id="bymonth"[% bymonth ? ' checked' : '' %] /><label class="inline" for="bymonth">[% loc('By Date') %]</label>
+ </p>
+
+ <p>
+ [% loc('Council:') %] <select id='body' name='body'>
+ <option value=''>[% loc('No council') %]</option>
+ [% FOR body IN bodies %]
+ <option value="[% body.id %]"[% ' selected' IF body.id == selected_body %]>[% body.name %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <input type="submit" name="getcounts" size="30" id="getcounts" value="Get Count" />
+ </p>
+</form>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/timeline.html b/templates/web/base/admin/timeline.html
new file mode 100644
index 000000000..6bf350a58
--- /dev/null
+++ b/templates/web/base/admin/timeline.html
@@ -0,0 +1,44 @@
+[% INCLUDE 'admin/header.html' title=loc('Timeline') %]
+
+[%- BLOCK problem_name %]
+ [%- tprintf(loc('by %s'), problem.name) | html %] &lt;[% problem.user.email | html %]&gt;, '[% problem.title | html %]'
+[%- END %]
+
+[%- 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>
+ [%- date = curdate -%]
+ [%- END -%]
+ <dt><b>[% time.$moment.0.date.hms %]</b></dt>
+ <dd>
+ [% FOREACH item IN time.$moment %]
+ [%- SWITCH item.type -%]
+ [% CASE 'problemCreated' %]
+ [%- tprintf(loc('Problem %d created'), item.obj.id) %]; [% PROCESS problem_name problem=item.obj -%]
+ [% CASE 'problemConfirmed' %]
+ [%- tprintf( loc('Problem %s confirmed'), '<a href="' _ c.uri_for_email( '/report', item.obj.id ) _ '" class="admin-offsite-link">' _ 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 ) _ '" class="admin-offsite-link">' _ 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' %]
+ [% tprintf(loc("Questionnaire %d answered for problem %d, %s to %s"), item.obj.id, item.obj.problem_id, item.obj.old_state, item.obj.new_state ) %]
+ [% CASE 'update' %]
+ [% name = ( item.obj.name || 'anonymous' ) | html %]
+ [% tprintf(loc("Update %s created for problem %d; by %s"), "<a href='" _ c.uri_for_email( '/report', item.obj.problem_id ) _ "#update_" _ item.obj.id _ "' class='admin-offsite-link'>" _ item.obj.id _ "</a>", item.obj.problem_id, name) %] &lt;[% item.obj.user.email | html %]&gt;
+ [% 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, item.obj.whensubscribed.strftime('%H:%M:%S %e %B %Y') ) %]
+ [%- END %]
+ <br />
+ [%- END %]
+ </dd>
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/update_edit.html b/templates/web/base/admin/update_edit.html
new file mode 100644
index 000000000..5ffce8bc4
--- /dev/null
+++ b/templates/web/base/admin/update_edit.html
@@ -0,0 +1,67 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing update %d'), update.id ) -%]
+[% PROCESS 'admin/report_blocks.html' %]
+
+[% status_message %]
+
+<form method="post" action="[% c.uri_for( 'update_edit', update.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>
+ [%- cobrand_data = update.cobrand_data;
+ cobrand_data = c.data_for_generic_update IF !update.cobrand;
+ IF cobrand_data;
+ uri = c.uri_for_email( '/report', update.problem_id, cobrand_data );
+ ELSE;
+ uri = c.uri_for_email( '/report', update.problem_id );
+ END;
+ %]
+<li><a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% loc('View report on site' )%]</a></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>
+</select></li>
+<li><label for="state">[% loc('State:') %]</label> <select name="state" id="state">
+ [% FOREACH state IN [ ['confirmed', loc('Open')], ['hidden', loc('Hidden')], ['unconfirmed',loc('Unconfirmed')] ] %]
+ <option [% 'selected ' IF state.0 == update.state %] value="[% state.0 %]">[% state.1 %]</option>
+ [% END %]
+</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_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') _')' %]
+[% END -%]
+</li>
+[% IF update.problem_state %]
+<li>[% tprintf(loc('Update changed problem state to %s'), update.problem_state) %]</li>
+[% ELSIF update.mark_fixed %]
+<li>[% loc('Update marked problem as fixed') %]</li>
+[% ELSIF update.user.id == update.problem.user.id && update.mark_open %]
+<li>[% loc('Update reopened problem') %]</li>
+[% END %]
+[% PROCESS abuse_button %] [% PROCESS flag_button user=update.user %]</li>
+<li>[% loc('Cobrand:') %] [% update.cobrand %]</li>
+<li>[% loc('Cobrand data:') %] [% update.cobrand_data %]</li>
+<li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li>
+
+[% IF update.photo %]
+[% photo = update.get_photo_params %]
+<li><img alt="Photo of this update" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %]
+ [%~ IF update.photo.length == 40 ~%]
+ /photo/[% update.photo %].temp.jpeg
+ [%~ ELSE ~%]
+ [% photo.url %]
+ [%~ END ~%]">
+<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
+<label for="remove_photo" class="inline">[% loc("Remove photo (can't be undone!)") %]</label></li>
+[% END %]
+</ul>
+<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html
new file mode 100644
index 000000000..4a57b05a0
--- /dev/null
+++ b/templates/web/base/admin/user-form.html
@@ -0,0 +1,56 @@
+<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" >
+
+ [% IF c.cobrand.moniker == 'zurich' AND field_errors.email %]
+ <p class='error'>[% field_errors.email %]</p>
+ [% END %]
+ <ul class="no-bullets">
+ <li>
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>.
+ Names are not necessarily unique.")
+ %]
+ </p>
+ </div>
+ [% 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>
+ <div class="admin-hint">
+ <p>
+ [% loc(
+ "Normal (public) users should not be associated with any <strong>body</strong>.<br>
+ Authorised staff users can be associated with the body they represent.<br>
+ Depending on the implementation, staff users may have access to the dashboard (summary of
+ activity across their body), the ability to hide reports or set special report statuses.")
+ %]
+ </p>
+ </div>
+ [% 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 %]
+ </li>
+ </select>
+ [% IF c.cobrand.moniker != 'zurich' %]
+ <li>
+ <div class="admin-hint">
+ <p>
+ [% loc("Mark users whose behaviour you want to keep a check on as <strong>flagged</strong>.") %]
+ <br>
+ [% tprintf(loc("Flagged users are listed on the <a href='%s'>flagged</a> page."), c.uri_for( 'flagged' )) %]
+ <br>
+ [% loc("You can add an abusive user's email to the abuse list, which automatically hides (and never sends) reports they create.") %]
+ </p>
+ </div>
+
+ [% 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/base/admin/user_edit.html b/templates/web/base/admin/user_edit.html
new file mode 100644
index 000000000..d69c873a3
--- /dev/null
+++ b/templates/web/base/admin/user_edit.html
@@ -0,0 +1,8 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing user %d'), user.id ) -%]
+[% PROCESS 'admin/report_blocks.html' %]
+
+[% status_message %]
+
+[% INCLUDE 'admin/user-form.html' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html
new file mode 100644
index 000000000..db97c7d59
--- /dev/null
+++ b/templates/web/base/admin/users.html
@@ -0,0 +1,49 @@
+[% INCLUDE 'admin/header.html' title=loc('Search Users') %]
+[% PROCESS 'admin/report_blocks.html' %]
+
+<div class="fms-admin-info">
+ [% loc("User search finds matches in users' names and email addresses.") %]
+</div>
+<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 users.size %]
+
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Email') %]</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( '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>
+
+[% ELSIF searched %]
+
+<div class="fms-admin-warning">
+ [% loc("Searching found no users.") %]
+</div>
+
+[% END %]
+
+[% IF NOT searched %]
+<h2>[% loc('Add user') %]</h2>
+[% INCLUDE 'admin/user-form.html', user = '' %]
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]