aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/admin
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
committerMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
commit987124b09a32248414faf4d0d6615d43b29ac6f6 (patch)
treea549db8af723c981d3b346e855f25d6fd5ff8aa7 /templates/web/base/admin
parentdbf56159e44c1560a413022451bf1a1c4cb22a52 (diff)
parenta085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff)
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r--templates/web/base/admin/bodies.html4
-rw-r--r--templates/web/base/admin/body.html4
-rw-r--r--templates/web/base/admin/category-multiselect.html10
-rw-r--r--templates/web/base/admin/config_page.html6
-rw-r--r--templates/web/base/admin/defecttypes/edit.html37
-rw-r--r--templates/web/base/admin/defecttypes/index.html13
-rw-r--r--templates/web/base/admin/defecttypes/list.html35
-rw-r--r--templates/web/base/admin/exordefects/index.html36
-rw-r--r--templates/web/base/admin/index.html6
-rw-r--r--templates/web/base/admin/report-category.html14
-rw-r--r--templates/web/base/admin/report_blocks.html4
-rw-r--r--templates/web/base/admin/report_edit.html30
-rw-r--r--templates/web/base/admin/response_templates_select.html4
-rw-r--r--templates/web/base/admin/responsepriorities/edit.html10
-rw-r--r--templates/web/base/admin/state_groups_select.html3
-rw-r--r--templates/web/base/admin/template_edit.html10
-rw-r--r--templates/web/base/admin/user-form.html13
-rw-r--r--templates/web/base/admin/users.html4
18 files changed, 199 insertions, 44 deletions
diff --git a/templates/web/base/admin/bodies.html b/templates/web/base/admin/bodies.html
index e98e2d350..9bd85940b 100644
--- a/templates/web/base/admin/bodies.html
+++ b/templates/web/base/admin/bodies.html
@@ -14,9 +14,9 @@
</p>
[% ELSE %]
- [% IF c.config.STAGING_SITE and !c.config.SEND_REPORTS_ON_STAGING %]
+ [% IF c.config.STAGING_SITE and !c.config.STAGING_FLAGS.send_reports %]
<p class="fms-admin-warning">
- [% tprintf(loc("As this is a staging site and %s is false, reports made on this site will be sent to the problem reporter, not the contact given for the report’s category."), "<a class='admin-offsite-link' href='http://fixmystreet.org/customising/config/#send_reports_on_staging'><code>SEND_REPORTS_ON_STAGING</code></a>") %]
+ [% tprintf(loc("As this is a staging site and %s is false, reports made on this site will be sent to the problem reporter, not the contact given for the report’s category."), "<a class='admin-offsite-link' href='http://fixmystreet.org/customising/config/#send_reports_on_staging'><code>STAGING_FLAGS send_reports</code></a>") %]
</p>
[% END %]
diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html
index 5c9f4f9b9..5e8c6a164 100644
--- a/templates/web/base/admin/body.html
+++ b/templates/web/base/admin/body.html
@@ -59,9 +59,9 @@
<br>
[% loc("Add a contact using the form below.") %]
</p>
-[% ELSIF c.config.STAGING_SITE and !c.config.SEND_REPORTS_ON_STAGING %]
+[% ELSIF c.config.STAGING_SITE and !c.config.STAGING_FLAGS.send_reports %]
<p class="fms-admin-warning">
- [% tprintf(loc("As this is a staging site and %s is false, reports made on this site will be sent to the problem reporter, not the contact given for the report’s category."), "<a class='admin-offsite-link' href='http://fixmystreet.org/customising/config/#send_reports_on_staging'><code>SEND_REPORTS_ON_STAGING</code></a>") %]
+ [% tprintf(loc("As this is a staging site and %s is false, reports made on this site will be sent to the problem reporter, not the contact given for the report’s category."), "<a class='admin-offsite-link' href='http://fixmystreet.org/customising/config/#send_reports_on_staging'><code>STAGING_FLAGS send_reports</code></a>") %]
</p>
[% END %]
diff --git a/templates/web/base/admin/category-multiselect.html b/templates/web/base/admin/category-multiselect.html
new file mode 100644
index 000000000..98416204f
--- /dev/null
+++ b/templates/web/base/admin/category-multiselect.html
@@ -0,0 +1,10 @@
+<p>
+ <strong>[% loc('Categories:') %]</strong>
+</p>
+<p>
+ <select class="form-control js-multiple" name="categories" id="categories" multiple data-all="[% loc('All categories') %]">
+ [% FOR contact IN contacts %]
+ <option value="[% contact.id %]" [% 'selected' IF contact.active %]>[% contact.category | html %]</option>
+ [% END %]
+ </select>
+</p>
diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html
index 67661c597..f35cd6adb 100644
--- a/templates/web/base/admin/config_page.html
+++ b/templates/web/base/admin/config_page.html
@@ -118,7 +118,11 @@ running version <strong>[% git_version || 'unknown' %]</strong>.
[% INCLUDE subsection heading="Development" %]
[% INCLUDE just_value value="STAGING_SITE" %]
-[% INCLUDE just_value value="SEND_REPORTS_ON_STAGING" %]
+[% staging_conf = FOR k IN c.config.STAGING_FLAGS %]
+ [% k.key %]:[% k.value %]
+ [%- ',' IF NOT loop.last %]
+[% END %]
+[% INCLUDE just_value value="STAGING_FLAGS" conf = staging_conf %]
[% INCLUDE just_value value="UPLOAD_DIR" %]
[% INCLUDE just_value value="GEO_CACHE" %]
[% INCLUDE just_value value="TESTING_COUNCILS" %]
diff --git a/templates/web/base/admin/defecttypes/edit.html b/templates/web/base/admin/defecttypes/edit.html
new file mode 100644
index 000000000..a3b324d11
--- /dev/null
+++ b/templates/web/base/admin/defecttypes/edit.html
@@ -0,0 +1,37 @@
+[% INCLUDE 'admin/header.html' title=tprintf(('Defect Type for %s'), body.name) -%]
+[% dt = defect_type %]
+
+[% UNLESS dt.id %]<h3>[% ('New defect type') %]</h3>[% END %]
+
+<form method="post"
+ action="[% c.uri_for('', body.id, dt.id || 'new' ) %]"
+ enctype="application/x-www-form-urlencoded"
+ accept-charset="utf-8"
+ class="validate">
+
+ <p>
+ <strong>[% ('Name:') %] </strong>
+ <input type="text" name="name" class="required form-control" size="30" value="[% dt.name | html %]">
+ </p>
+ <p>
+ <strong>[% ('Description:') %] </strong>
+ <input type="text" name="description" class="form-control" size="30" value="[% dt.description | html %]">
+ </p>
+
+ <div class="admin-hint">
+ <p>
+ [% ('If you only want this defect type to be an option for specific categories, pick them here. By default they will show for all categories.') %]
+ </p>
+ </div>
+
+ [% INCLUDE 'admin/category-multiselect.html' %]
+
+ [% TRY %][% INCLUDE 'admin/defecttypes/extra_fields.html' %][% CATCH file %][% END %]
+
+ <p>
+ <input type="hidden" name="token" value="[% csrf_token %]" >
+ <input type="submit" class="btn" name="save" value="[% dt.id ? ('Save changes') : ('Create defect type') %]" >
+ </p>
+</form>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/defecttypes/index.html b/templates/web/base/admin/defecttypes/index.html
new file mode 100644
index 000000000..c45a09e6e
--- /dev/null
+++ b/templates/web/base/admin/defecttypes/index.html
@@ -0,0 +1,13 @@
+[% INCLUDE 'admin/header.html' title=('Defect Types') -%]
+
+<ul>
+ [% FOR body IN bodies %]
+ <li>
+ <a href="[% c.uri_for('', body.id) %]">[% body.name %]</a>
+ [% defect_types_count = body.defect_types.count %]
+ [% IF defect_types_count %]([% defect_types_count %])[% END %]
+ </li>
+ [% END %]
+</ul>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/defecttypes/list.html b/templates/web/base/admin/defecttypes/list.html
new file mode 100644
index 000000000..783bd085c
--- /dev/null
+++ b/templates/web/base/admin/defecttypes/list.html
@@ -0,0 +1,35 @@
+[% INCLUDE 'admin/header.html' title=tprintf(('Defect Types for %s'), body.name) -%]
+
+<table>
+ <thead>
+ <tr>
+ <th> [% ('Name') %] </th>
+ <th> [% ('Description') %] </th>
+ <th> [% ('Categories') %] </th>
+ <th> &nbsp; </th>
+ </tr>
+ </thead>
+ <tbody>
+ [% PROCESS 'defect_type/format.html' %]
+ [% FOR d IN defect_types %]
+ <tr>
+ <td> [% defect_type_format(defect_type=d) %] </td>
+ <td> [% d.description | html %] </td>
+ <td>
+ [% UNLESS d.contacts.size %]
+ <em>[% ('All categories') %]</em>
+ [% ELSE %]
+ [% FOR contact IN d.contacts %]
+ [% contact.category %][% ',' UNLESS loop.last %]
+ [% END %]
+ [% END %]
+ </td>
+ <td> <a href="[% c.uri_for('', body.id, d.id) %]" class="btn">[% ('Edit') %]</a> </td>
+ </tr>
+ [% END %]
+ </tbody>
+</table>
+
+<a href="[% c.uri_for('', body.id, 'new') %]" class="btn">[% ('New defect type') %]</a>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/exordefects/index.html b/templates/web/base/admin/exordefects/index.html
new file mode 100644
index 000000000..dba58198d
--- /dev/null
+++ b/templates/web/base/admin/exordefects/index.html
@@ -0,0 +1,36 @@
+[% INCLUDE 'admin/header.html' title=('Download Exor RDI') -%]
+
+[% IF error_message %]
+ <h2>Error</h2>
+ <p>[% error_message %]</p>
+[% END %]
+
+<form method="get" action="[% c.uri_for('download') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <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 %]" />
+ </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 %]" />
+ </p>
+
+ <p>
+ [% ('Inspector:') %] <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>
+
+ <p>
+ <input type="submit" class="btn" size="30" value="Download RDI file" />
+ </p>
+</form>
+
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html
index f573f0e7a..8498055b1 100644
--- a/templates/web/base/admin/index.html
+++ b/templates/web/base/admin/index.html
@@ -20,14 +20,18 @@ and to receive notices of updates.
</p>
[% END %]
+<div class="admin-index-search form-txt-submit-box clearfix">
+
<form method="get" action="[% c.uri_for('reports') %]" accept-charset="utf-8">
<p><label for="search_reports">[% loc('Search Reports') %]</label>
<input type="text" class="form-control" name="search" size="30" id="search_reports" value="[% searched | html %]">
+ <input type="submit" class="btn" value="[% loc('Go') %]">
</form>
<form method="get" action="[% c.uri_for('users') %]" accept-charset="utf-8">
<p><label for="search_users">[% loc('Search Users') %]</label>
<input type="text" class="form-control" name="search" size="30" id="search_users" value="[% searched | html %]">
+ <input type="submit" class="btn" value="[% loc('Go') %]">
</form>
[% IF c.user.is_superuser %]
@@ -46,6 +50,8 @@ and to receive notices of updates.
</form>
[% END %]
+</div>
+
[% IF unsent_reports.size %]
<h2>[% loc('Reports waiting to be sent') %]</h2>
diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html
new file mode 100644
index 000000000..1e39236d7
--- /dev/null
+++ b/templates/web/base/admin/report-category.html
@@ -0,0 +1,14 @@
+<select class="form-control" name="category" id="category">
+ [% IF NOT problem.category OR NOT categories_hash.${problem.category} %]
+ <optgroup label="[% loc('Existing category') %]">
+ <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option>
+ </optgroup>
+ [% END %]
+ [% IF categories.size %]
+ <optgroup label="[% loc('Available categories') %]">
+ [% FOREACH cat IN categories %]
+ <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option>
+ [% END %]
+ </optgroup>
+ [% END %]
+</select>
diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html
index 3561d865d..9231dd1c2 100644
--- a/templates/web/base/admin/report_blocks.html
+++ b/templates/web/base/admin/report_blocks.html
@@ -1,5 +1,7 @@
[%
+SET report_blocks_included = 1;
+
SET state_pretty = {
'confirmed' = loc('Open')
'investigating' = loc('Investigating')
@@ -9,7 +11,7 @@ SET state_pretty = {
'fixed' = loc('Fixed')
'fixed - user' = loc('Fixed - User')
'fixed - council' = loc('Fixed - Council')
- 'unable to fix' = loc('Unable to fix')
+ 'unable to fix' = loc('No further action')
'not responsible' = loc('Not Responsible')
'duplicate' = loc('Duplicate')
'closed' = loc('Closed')
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html
index 02e75563c..3c8134b80 100644
--- a/templates/web/base/admin/report_edit.html
+++ b/templates/web/base/admin/report_edit.html
@@ -112,31 +112,13 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a>
<li><label for='detail'>[% loc('Details:') %]</label>
<textarea class="form-control" name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
-<li><label class="inline-text" for="state">[% loc('State:') %]</label>
-<select class="form-control" name="state" id="state">
-[% FOREACH group IN state_groups %]
- <optgroup label="[% group.0 %]">
- [% FOREACH state IN group.1 %]
- <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option>
- [% END %]
- </optgroup>
-[% END %]
-</select></li>
+<li>
+ <label class="inline-text" for="state">[% loc('State:') %]</label>
+ [% INCLUDE 'admin/state_groups_select.html' %]
+</li>
<li><label class="inline-text" for="category">[% loc('Category:') %]</label>
-<select class="form-control" name="category" id="category">
- [% IF NOT problem.category OR NOT categories.grep(problem.category).size %]
- <optgroup label="[% loc('Existing category') %]">
- <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option>
- </optgroup>
- [% END %]
- [% IF categories.size %]
- <optgroup label="[% loc('Available categories') %]">
- [% FOREACH cat IN categories %]
- <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option>
- [% END %]
- </optgroup>
- [% END %]
-</select></li>
+ [% INCLUDE 'admin/report-category.html' %]
+</li>
<li><label class="inline-text" for="anonymous">[% loc('Anonymous:') %]</label>
<select class="form-control" name="anonymous" id="anonymous">
<option [% 'selected ' IF problem.anonymous %]value="1">[% loc('Yes') %]</option>
diff --git a/templates/web/base/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html
index 417be9add..ec50b2401 100644
--- a/templates/web/base/admin/response_templates_select.html
+++ b/templates/web/base/admin/response_templates_select.html
@@ -1,10 +1,8 @@
[% IF problem.response_templates %]
-<div class="response_templates_select">
<select id="templates_for_[% for %]" class="form-control js-template-name" data-for="[% for %]" name="response_template">
<option value="">[% loc('--Choose a template--') %]</option>
[% FOR t IN problem.response_templates %]
- <option value="[% t.text | html %]"> [% t.title | html %] </option>
+ <option value="[% t.text | html %]" data-problem-state="[% t.state | html %]"> [% t.title | html %] </option>
[% END %]
</select>
-</div>
[% END %]
diff --git a/templates/web/base/admin/responsepriorities/edit.html b/templates/web/base/admin/responsepriorities/edit.html
index 4d838eed2..07d6906ba 100644
--- a/templates/web/base/admin/responsepriorities/edit.html
+++ b/templates/web/base/admin/responsepriorities/edit.html
@@ -20,6 +20,16 @@
<div class="admin-hint">
<p>
+ [% loc('If this priority is passed to an external service (e.g. Exor/Confirm) enter the priority code to use with that service here.') %]
+ </p>
+ </div>
+ <p>
+ <strong>[% loc('External ID') %]:</strong>
+ <input type="text" name="external_id" class="form-control" size="30" value="[% rp.external_id | html %]">
+ </p>
+
+ <div class="admin-hint">
+ <p>
[% loc('If you only want this priority to be an option for specific categories, pick them here. By default they will show for all categories.') %]
</p>
</div>
diff --git a/templates/web/base/admin/state_groups_select.html b/templates/web/base/admin/state_groups_select.html
new file mode 100644
index 000000000..9a70cd2c9
--- /dev/null
+++ b/templates/web/base/admin/state_groups_select.html
@@ -0,0 +1,3 @@
+[% PROCESS 'admin/report_blocks.html'; # For state_groups %]
+[% DEFAULT current_state = problem.state %]
+[% INCLUDE 'report/_state_select_field.html' %]
diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html
index b2e734756..76de70dcc 100644
--- a/templates/web/base/admin/template_edit.html
+++ b/templates/web/base/admin/template_edit.html
@@ -31,6 +31,16 @@
</div>
[% INCLUDE 'admin/category-checkboxes.html' %]
+ <div class="admin-hint">
+ <p>
+ [% loc('If you want to use this template to prefill the update field when changing a report&rsquo;s state, select the state here.') %]
+ </p>
+ </div>
+ <p>
+ <label for="state">[% loc('State') %]</label>
+ [% INCLUDE 'admin/state_groups_select.html' current_state=rt.state include_empty=1 %]
+ </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') %]" >
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html
index 17230e940..dbd554b1e 100644
--- a/templates/web/base/admin/user-form.html
+++ b/templates/web/base/admin/user-form.html
@@ -47,7 +47,7 @@
[% loc("Staff users have permission to log in to the admin.") %]
</p>
</div>
- [% loc('Staff:') %] <input type="checkbox" id="body" name="body" value="[% c.user.from_body.id %]" [% user.from_body.id == c.user.from_body.id ? ' checked' : '' %] [% 'disabled' UNLESS c.user.is_superuser OR c.user.has_body_permission_to('user_assign_body') %]>
+ [% loc('Staff:') %] <input type="checkbox" id="body" name="body" value="[% c.user.from_body.id %]" [% user.from_body.id == c.user.from_body.id ? ' checked' : '' %] [% 'disabled' UNLESS c.user.has_body_permission_to('user_assign_body') %]>
</li>
[% END %]
@@ -121,14 +121,6 @@
</label>
[% END %]
</li>
- <li>
- <div class="admin-hint">
- <p>
- [% loc("Reports from users with high enough reputation will be sent immediately without requiring inspection. Each category's threshold can be managed on its edit page. Users earn reputation when a report they have made is marked as inspected by inspectors.") %]
- </p>
- </div>
- [% loc('Reputation:') %] [% user.get_extra_metadata('reputation') %]
- </li>
[% END %]
[% IF c.user.is_superuser %]
@@ -162,7 +154,7 @@
[% FOREACH permission IN group.value %]
<li>
<label class="inline">
- <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF user.has_body_permission_to(permission.key) %]>
+ <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF NOT user.is_superuser AND user.has_body_permission_to(permission.key) %]>
[% permission.value %]
</label>
</li>
@@ -173,6 +165,7 @@
</ul>
[% END %]
[% END %]
+ [% TRY %][% INCLUDE 'admin/user-form-extra-fields.html' %][% CATCH file %][% END %]
</ul>
<input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" >
</form>
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html
index 757046bcf..8e35e1c31 100644
--- a/templates/web/base/admin/users.html
+++ b/templates/web/base/admin/users.html
@@ -26,7 +26,7 @@
<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 %]
- [% IF user.has_body_permission_to('moderate') %] * [% END %]
+ [% 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>
@@ -47,6 +47,8 @@
[% IF NOT searched %]
<h2>[% loc('Add user') %]</h2>
[% INCLUDE 'admin/user-form.html', user = '' %]
+[% ELSE %]
+<a href="[% c.uri_for( c.controller('Admin').action_for('user_add') ) %]">[% loc('Add user') %]</a>
[% END %]
[% INCLUDE 'admin/footer.html' %]