aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-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/report/new/category.html33
-rw-r--r--templates/web/fixmystreet.com/header.html43
-rw-r--r--templates/web/zurich/admin/templates.html28
5 files changed, 144 insertions, 23 deletions
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/report/new/category.html b/templates/web/base/report/new/category.html
index 16f6113f2..94d5479a6 100644
--- a/templates/web/base/report/new/category.html
+++ b/templates/web/base/report/new/category.html
@@ -1,19 +1,38 @@
-[% IF category_options.size ~%]
+[% IF category_options.size OR category_groups.size ~%]
+ [%~ BLOCK category_option ~%]
+ [% cat_op_lc = cat_op.name | lower =%]
+ <option value='[% cat_op.name | html %]'[% ' selected' IF report.category == cat_op.name || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%]
+ >[% IF loop.first %][% cat_op.value %][% ELSE %][% cat_op.value | html %][% END %]</option>
+ [%~ END ~%]
+
[% IF category;
category_lc = category | lower;
END; ~%]
<label for='form_category' id="form_category_label">
[%~ loc('Category') ~%]
</label>[% =%]
- <select class="form-control" name="category" id="form_category"
+ <select class="form-control[% IF category_groups.size %] js-grouped-select[% END %]" name="category" id="form_category"
[%~ IF c.user.from_body =%]
data-role="[% c.user.has_body_permission_to('planned_reports') ? 'inspector' : 'user' %]" data-body="[% c.user.from_body.name %]" data-prefill="[% c.cobrand.prefill_report_fields_for_inspector %]"
[%~ END ~%]
>
- [%~ FOREACH cat_op IN category_options ~%]
- [% cat_op_lc = cat_op.name | lower =%]
- <option value='[% cat_op.name | html %]'[% ' selected' IF report.category == cat_op.name || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%]
- >[% IF loop.first %][% cat_op.value %][% ELSE %][% cat_op.value | html %][% END %]</option>
- [%~ END =%]
+ [%~ IF category_groups.size ~%]
+ [%~ FOREACH group IN category_groups ~%]
+ [% IF group.name %]<optgroup label="[% group.name %]">[% END %]
+ [%~ FOREACH cat_op IN group.categories ~%]
+ [% INCLUDE category_option %]
+ [%~ END ~%]
+ [% IF group.name %]</optgroup>[% END %]
+ [%~ END =%]
+ [%~ ELSE ~%]
+ [%~ FOREACH cat_op IN category_options ~%]
+ [% INCLUDE category_option %]
+ [%~ END =%]
+ [%~ END ~%]
</select>
+ [%~ IF category_groups.size ~%]
+ <label id="form_subcategory_label" class="hidden">
+ [%~ loc('Subcategory') ~%]
+ </label>
+ [%~ END ~%]
[%~ END ~%]
diff --git a/templates/web/fixmystreet.com/header.html b/templates/web/fixmystreet.com/header.html
new file mode 100644
index 000000000..6f01f4184
--- /dev/null
+++ b/templates/web/fixmystreet.com/header.html
@@ -0,0 +1,43 @@
+[%
+ SET html_att = ' lang="' _ lang_code _ '"';
+ # For a right-to-left language, use the following line in your own header:
+ # SET html_att = html_att _ ' dir="rtl"';
+-%]
+<!doctype html>
+<!--[if IE 7]> <html class="no-js ie7 iel8"[% html_att %]><![endif]-->
+<!--[if IE 8]> <html class="no-js ie8 iel8"[% html_att %]><![endif]-->
+<!--[if IE 9]> <html class="no-js ie9"[% html_att %]><![endif]-->
+<!--[if gt IE 9]><!--><html class="no-js"[% html_att %]
+[% IF appcache ~%]
+ manifest="/offline/appcache.manifest"
+[%~ END %]><!--<![endif]-->
+ <head>
+ <meta name="viewport" content="initial-scale=1.0">
+
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
+ <meta name="HandHeldFriendly" content="true">
+ <meta name="mobileoptimized" content="0">
+
+ [% INCLUDE 'header_opengraph.html' %]
+ [% INCLUDE 'header/css.html' %]
+ [% INCLUDE 'common_header_tags.html' %]
+ [% TRY %][% PROCESS 'header_extra.html' %][% CATCH file %][% END %]
+
+ </head>
+ [% TRY %][% PROCESS 'set_body_class.html' %][% CATCH file %][% END %]
+ <body class="[% bodyclass | html IF bodyclass %]">
+ <div class="top_banner top_banner--donate"><p>
+ <strong>We’re hiring for an exciting new project.</strong>
+ <a href="https://mysociety.workable.com/">Come and join our friendly team</a>.
+ </p></div>
+
+ <div class="wrapper">
+ <div class="table-cell">
+ [% INCLUDE 'header_site.html' %]
+
+ [% pre_container_extra %]
+
+ <div class="container">
+ <div class="content[% " $mainclass" | html IF mainclass %]" role="main">
+
+ <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/zurich/admin/templates.html b/templates/web/zurich/admin/templates.html
new file mode 100644
index 000000000..2db9e2e34
--- /dev/null
+++ b/templates/web/zurich/admin/templates.html
@@ -0,0 +1,28 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Templates for %s'), body.name) -%]
+
+<h2> [% tprintf(loc('Response Templates for %s'), body.name) %] </h2>
+
+<table>
+ <thead>
+ <tr>
+ <th> [% loc('Title') %] </th>
+ <th> [% loc('Text') %] </th>
+ <th> [% loc('Created') %] </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> <a href="[% c.uri_for('templates', body.id, t.id) %]" class="btn">[% loc('Edit') %]</a> </td>
+ </tr>
+[% END %]
+ </tbody>
+</table>
+
+<a href="[% c.uri_for('templates', body.id, 'new') %]" class="btn">[% loc('New template') %]</a>
+
+[% INCLUDE 'admin/footer.html' %]