aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base')
-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
3 files changed, 73 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 ~%]