aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/admin
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r--templates/web/base/admin/body-form.html3
-rw-r--r--templates/web/base/admin/config_page.html2
-rw-r--r--templates/web/base/admin/exordefects/index.html17
-rw-r--r--templates/web/base/admin/report_blocks.html2
-rw-r--r--templates/web/base/admin/report_edit.html15
-rw-r--r--templates/web/base/admin/stats.html106
-rw-r--r--templates/web/base/admin/stats/fix_rate.html (renamed from templates/web/base/admin/stats_fix_rate.html)0
-rw-r--r--templates/web/base/admin/stats/index.html10
-rw-r--r--templates/web/base/admin/stats/questionnaire.html (renamed from templates/web/base/admin/questionnaire.html)0
-rw-r--r--templates/web/base/admin/stats/state.html (renamed from templates/web/base/admin/stats_by_state.html)0
-rw-r--r--templates/web/base/admin/template_edit.html39
-rw-r--r--templates/web/base/admin/templates.html24
-rw-r--r--templates/web/base/admin/update_edit.html6
-rw-r--r--templates/web/base/admin/user-form.html20
-rw-r--r--templates/web/base/admin/users.html2
15 files changed, 104 insertions, 142 deletions
diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html
index 55d0e500c..54445a282 100644
--- a/templates/web/base/admin/body-form.html
+++ b/templates/web/base/admin/body-form.html
@@ -75,8 +75,7 @@
</div>
<p>
<label for="area_ids">[% loc('Area covered') %]</label>
- <select class="form-control" name="area_ids" id="area_ids" multiple>
- <option value=""> -- [% loc('Select an area') %] -- </option>
+ <select class="form-control js-multiple" name="area_ids" id="area_ids" multiple data-none="-- [% loc('Select an area') %] --">
[% SET body_areas = body.areas %]
[% FOR area IN areas %]
[% SET aid = area.id %]
diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html
index 87032b0b6..d448d2a63 100644
--- a/templates/web/base/admin/config_page.html
+++ b/templates/web/base/admin/config_page.html
@@ -55,7 +55,7 @@ running version <strong>[% git_version || 'unknown' %]</strong>.
</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(', '))
+ conf = c.config.EXAMPLE_PLACES.join(', ')
cob = c.cobrand.example_places %]
[% INCLUDE with_cobrand value="LANGUAGES"
cob = c.cobrand.languages %]
diff --git a/templates/web/base/admin/exordefects/index.html b/templates/web/base/admin/exordefects/index.html
index dba58198d..65b2aa486 100644
--- a/templates/web/base/admin/exordefects/index.html
+++ b/templates/web/base/admin/exordefects/index.html
@@ -6,26 +6,29 @@
[% END %]
<form method="get" action="[% c.uri_for('download') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <div class="filters">
<p>
- <label for="start_date">[% ('Start Date:') %]</label><input type="text" class="form-control"
- placeholder="[% ('Click here or enter as dd/mm/yyyy') %]" name="start_date" id="start_date"
- value="[% start_date ? start_date.strftime( '%d/%m/%Y') : '' | html %]" />
+ <label for="start_date">[% ('Start Date:') %]</label><input type="date" class="form-control"
+ name="start_date" id="start_date"
+ value="[% start_date ? start_date.strftime( '%Y-%m-%d') : '' | html %]" />
</p>
<p>
- <label for="end_date">[% ('End Date:') %]</label><input type="text" class="form-control"
- placeholder="[% ('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 %]" />
+ <label for="end_date">[% ('End Date:') %]</label><input type="date" class="form-control"
+ name="end_date" id="end_date" size="5"
+ value="[% end_date ? end_date.strftime( '%Y-%m-%d') : '' | html %]" />
</p>
<p>
- [% ('Inspector:') %] <select class="form-control" id='user_id' name='user_id'>
+ <label for="user_id">[% ('Inspector:') %]</label>
+ <select class="form-control" id='user_id' name='user_id'>
<option value=''>[% ('All inspectors') %]</option>
[% FOR inspector IN inspectors %]
<option value="[% inspector.id %]" [% 'selected' IF user_id == inspector.id %]>[% inspector.name %] ([% inspector.get_extra_metadata('initials') %])</option>
[% END %]
</select>
</p>
+ </div>
<p>
<input type="submit" class="btn" size="30" value="Download RDI file" />
diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html
index f5896b88f..4c52b14bb 100644
--- a/templates/web/base/admin/report_blocks.html
+++ b/templates/web/base/admin/report_blocks.html
@@ -15,7 +15,7 @@ SET state_groups = c.cobrand.state_groups_admin;
[% BLOCK abuse_button -%]
[% IF allowed_pages.abuse_edit -%]
-[% IF email_in_abuse %]<small>[% loc('(Email in abuse table)') %]</small>[% ELSE %]<input type="submit" class="btn" name="banuser" value="[% loc('Ban email address') %]" />[% END %]
+[% IF username_in_abuse %]<small>[% loc('User in abuse table') %]</small>[% ELSE %]<input type="submit" class="btn" name="banuser" value="[% loc('Ban user') %]" />[% END %]
[%- END %]
[%- END %]
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html
index 3c8134b80..ff99bb907 100644
--- a/templates/web/base/admin/report_edit.html
+++ b/templates/web/base/admin/report_edit.html
@@ -1,8 +1,8 @@
[%
PROCESS "maps/${map.type}.html" admin = 1;
+ SET bodyclass = 'mappage with-notes';
INCLUDE 'admin/header.html'
- title = tprintf(loc('Editing problem %d'), problem.id ),
- bodyclass = 'mappage with-notes';
+ title = tprintf(loc('Editing problem %d'), problem.id );
PROCESS 'admin/report_blocks.html'
-%]
@@ -126,12 +126,17 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a>
</select></li>
<li><label for="name">[% loc('Name:') %]</label>
<input type='text' class="form-control" name='name' id='name' value='[% problem.name | html %]'></li>
-<li><label for="email">[% loc('Email:') %]</label>
- <input type='text' class="form-control" id='email' name='email' value='[% problem.user.email | html %]'>
+<li><label for="username">[% loc('User:') %]</label>
+ <input type='text' class="form-control" id='username' name='username' value='[% problem.user.username | html %]'>
[% PROCESS abuse_button %]
[% PROCESS flag_button user=problem.user %]
</li>
-<li>[% loc('Phone:') %] [% problem.user.phone | html %]</li>
+[% IF problem.user.phone_display != problem.user.username %]
+<li>[% loc('Phone:') %] [% problem.user.phone_display | html %]</li>
+[% END %]
+[% IF problem.user.email != problem.user.username %]
+<li>[% loc('Email:') %] [% problem.user.email | html %]</li>
+[% END %]
<li><label class="inline-text" for="flagged">[% loc('Flagged:') %]</label>
<input type="checkbox" id="flagged" name="flagged"[% ' checked' IF problem.flagged %]></li>
<li><label class="inline-text" for="non_public">[% loc('Private') %]:</label>
diff --git a/templates/web/base/admin/stats.html b/templates/web/base/admin/stats.html
deleted file mode 100644
index 150afd619..000000000
--- a/templates/web/base/admin/stats.html
+++ /dev/null
@@ -1,106 +0,0 @@
-[% 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 %]
-[% ELSE %]
-<ul>
-<li><a href="stats/questionnaire">[% loc('Survey Results') %]</a></li>
-<li><a href="stats/state">[% loc('Problem breakdown by state') %]</a></li>
-<li><a href="stats/fix-rate">[% loc('Category fix rate for problems > 4 weeks old') %]</a></li>
-</ul>
-
-[% 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" class="form-control"
- 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" class="form-control"
- 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>
-
- [% IF c.user.is_superuser %]
- <p>
- [% loc('Council:') %] <select class="form-control" 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>
- [% END %]
-
- <p>
- <input type="submit" class="btn" name="getcounts" size="30" id="getcounts" value="[% loc('Get Count') %]" />
- </p>
-</form>
-
-[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/stats_fix_rate.html b/templates/web/base/admin/stats/fix_rate.html
index fb88a1c06..fb88a1c06 100644
--- a/templates/web/base/admin/stats_fix_rate.html
+++ b/templates/web/base/admin/stats/fix_rate.html
diff --git a/templates/web/base/admin/stats/index.html b/templates/web/base/admin/stats/index.html
new file mode 100644
index 000000000..6ea1ae403
--- /dev/null
+++ b/templates/web/base/admin/stats/index.html
@@ -0,0 +1,10 @@
+[% INCLUDE 'admin/header.html' title=loc('Stats') %]
+
+<ul>
+<li><a href="[% c.uri_for_action('admin/stats/questionnaire') %]">[% loc('Survey Results') %]</a></li>
+<li><a href="[% c.uri_for_action('admin/stats/state') %]">[% loc('Problem breakdown by state') %]</a></li>
+<li><a href="[% c.uri_for_action('admin/stats/fix_rate') %]">[% loc('Category fix rate for problems > 4 weeks old') %]</a></li>
+<li><a href="[% c.uri_for_action('dashboard/index') %]">[% loc('Summary statistics') %]</a></li>
+</ul>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/questionnaire.html b/templates/web/base/admin/stats/questionnaire.html
index 680e0d214..680e0d214 100644
--- a/templates/web/base/admin/questionnaire.html
+++ b/templates/web/base/admin/stats/questionnaire.html
diff --git a/templates/web/base/admin/stats_by_state.html b/templates/web/base/admin/stats/state.html
index 6bcd35f88..6bcd35f88 100644
--- a/templates/web/base/admin/stats_by_state.html
+++ b/templates/web/base/admin/stats/state.html
diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html
index 76de70dcc..3e436dbf9 100644
--- a/templates/web/base/admin/template_edit.html
+++ b/templates/web/base/admin/template_edit.html
@@ -9,20 +9,30 @@
accept-charset="utf-8"
class="validate">
+ [% IF errors %]
+ <p class="error">[% loc('Please correct the errors below') %]</p>
+ [% END %]
+
+
+ <div class="admin-hint">
+ <p>
+ [% loc('This is a <strong>private</strong> name for this template so you can identify it when updating reports or editing in the admin.') %]
+ </p>
+ </div>
<p>
<strong>[% loc('Title:') %] </strong>
<input type="text" name="title" class="required form-control" size="30" value="[% rt.title| html %]">
</p>
+
+ <div class="admin-hint">
+ <p>
+ [% loc('This is the <strong>public</strong> text that will be shown on the site.') %]
+ </p>
+ </div>
<p>
<strong>[% loc('Text:') %] </strong>
<textarea class="form-control" name="text" class="required">[% rt.text |html %]</textarea>
</p>
- <p>
- <label>
- <strong>[% loc('Auto-response:') %]</strong>
- <input type="checkbox" name="auto_response" [% 'checked' IF rt.auto_response %] />
- </label>
- </p>
<div class="admin-hint">
<p>
@@ -41,13 +51,28 @@
[% INCLUDE 'admin/state_groups_select.html' current_state=rt.state include_empty=1 %]
</p>
+ [% IF errors.auto_response %]
+ <div class="form-error">[% errors.auto_response %]</div>
+ [% END %]
+ <div class="admin-hint">
+ <p>
+ [% loc('If ticked, this template will be used for Open311 updates that put problems in this state.') %]
+ </p>
+ </div>
+ <p>
+ <label>
+ <strong>[% loc('Auto-response:') %]</strong>
+ <input type="checkbox" name="auto_response" [% 'checked' IF rt.auto_response %] />
+ </label>
+ </p>
+
<p>
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="submit" class="btn" name="Edit templates" value="[% rt.id ? loc('Save changes') : loc('Create template') %]" >
</p>
[% IF rt.id %]
<p>
- <input class="delete btn-danger" type="submit" name="delete_template" value="[% loc('Delete template') %]">
+ <input class="delete btn-danger" type="submit" name="delete_template" value="[% loc('Delete template') %]" data-confirm="[% loc('Are you sure?') %]">
</p>
[% END %]
</form>
diff --git a/templates/web/base/admin/templates.html b/templates/web/base/admin/templates.html
index f9dda7a4c..444f2734d 100644
--- a/templates/web/base/admin/templates.html
+++ b/templates/web/base/admin/templates.html
@@ -1,24 +1,30 @@
[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Templates for %s'), body.name) -%]
-[% IF c.cobrand.moniker == 'zurich' %]
- <h2> [% tprintf(loc('Response Templates for %s'), body.name) %] </h2>
-[% END %]
-
<table>
<thead>
<tr>
<th> [% loc('Title') %] </th>
- <th> [% loc('Text') %] </th>
- <th> [% loc('Created') %] </th>
+ <th> [% loc('Categories') %] </th>
+ <th> [% loc('State') %] </th>
+ <th> [% loc('Auto Response') %] </th>
<th> &nbsp; </th>
</tr>
</thead>
<tbody>
[% FOR t IN response_templates %]
<tr>
- <td> [% t.title %] </td>
- <td> [% t.text %] </td>
- <td> [% t.created %] </td>
+ <td> [% t.title | html %] </td>
+ <td>
+ [% UNLESS t.contacts.size %]
+ <em>[% loc('All categories') %]</em>
+ [% ELSE %]
+ [% FOR contact IN t.contacts %]
+ [% contact.category_display %][% ',' UNLESS loop.last %]
+ [% END %]
+ [% END %]
+ </td>
+ <td> [% t.state | html %] </td>
+ <td> [% IF t.auto_response %]X[% END %] </td>
<td> <a href="[% c.uri_for('templates', body.id, t.id) %]" class="btn">[% loc('Edit') %]</a> </td>
</tr>
[% END %]
diff --git a/templates/web/base/admin/update_edit.html b/templates/web/base/admin/update_edit.html
index 2b20c50b3..34e64310f 100644
--- a/templates/web/base/admin/update_edit.html
+++ b/templates/web/base/admin/update_edit.html
@@ -31,8 +31,10 @@
<option [% 'selected ' IF state.0 == update.state %] value="[% state.0 %]">[% state.1 %]</option>
[% END %]
</select></li>
-<li>[% loc('Name:') %] <input type='text' class="form-control" name='name' id='name' value='[% update.name | html %]'></li>
-<li>[% loc('Email:') %] <input type='text' class="form-control" id='email' name='email' value='[% update.user.email | html %]'>
+<li><label for="name">[% loc('Name:') %]</label>
+ <input type='text' class="form-control" name='name' id='name' value='[% update.name | html %]'></li>
+<li><label for="username">[% loc('User:') %]</label>
+ <input type='text' class="form-control" id='username' name='username' value='[% update.user.username | 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 -%]
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html
index dbd554b1e..9a2c0b9e2 100644
--- a/templates/web/base/admin/user-form.html
+++ b/templates/web/base/admin/user-form.html
@@ -18,8 +18,26 @@
</li>
<li><label for="email">[% loc('Email:') %]</label>
<input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'></li>
+ [% IF c.config.SMS_AUTHENTICATION %]
+ <li><label class="inline" for="email_verified">[% loc('Email verified:') %]</label>
+ <input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]>
+ [% ELSE %]
+ <input type="hidden" name="email_verified" value="1">
+ [% END %]
<li><label for="phone">[% loc('Phone:') %]</label>
<input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li>
+ [% IF c.config.SMS_AUTHENTICATION %]
+ <li><label class="inline" for="phone_verified">[% loc('Phone verified:') %]</label>
+ <input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]>
+ [% ELSE %]
+ <input type="hidden" name="phone_verified" value="0">
+ [% END %]
+
+ [% IF username_in_abuse %]
+ <li>
+ <p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p>
+ </li>
+ [% END %]
[% IF c.user.is_superuser || c.cobrand.moniker == 'zurich' %]
<li>
@@ -109,7 +127,7 @@
</div>
[% IF c.user.is_superuser %]
[% loc('Trusted by bodies:') %]<br />
- <select class="form-control" id='body' name='trusted_bodies' multiple>
+ <select class="form-control js-multiple" id='body' name='trusted_bodies' multiple>
[% FOR body IN bodies %]
<option value="[% body.id %]"[% ' selected' IF user.has_permission_to('trusted', body.id) %]>[% body.name %]</option>
[% END %]
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html
index 8e35e1c31..6dfcf4204 100644
--- a/templates/web/base/admin/users.html
+++ b/templates/web/base/admin/users.html
@@ -29,7 +29,7 @@
[% IF user.is_superuser %] * [% END %]
</td>
[% IF c.cobrand.moniker != 'zurich' %]
- <td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
+ <td>[% user.flagged == 2 ? loc('User in abuse table') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
[% END %]
<td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td>
</tr>