aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web')
-rw-r--r--templates/web/base/admin/response_templates_select.html (renamed from templates/web/zurich/admin/response_templates_select.html)2
-rw-r--r--templates/web/base/admin/template_edit.html50
-rw-r--r--templates/web/base/admin/templates.html (renamed from templates/web/zurich/admin/templates.html)4
-rw-r--r--templates/web/base/admin/templates_index.html11
-rw-r--r--templates/web/base/admin/user-form.html4
-rw-r--r--templates/web/base/admin/users.html2
-rw-r--r--templates/web/base/report/update/form_update.html3
-rw-r--r--templates/web/oxfordshire/header.html2
8 files changed, 72 insertions, 6 deletions
diff --git a/templates/web/zurich/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html
index 853956a0d..664d1d20a 100644
--- a/templates/web/zurich/admin/response_templates_select.html
+++ b/templates/web/base/admin/response_templates_select.html
@@ -1,6 +1,6 @@
<div class="response_templates_select">
<select id="templates_for_[% for %]" class="js-template-name" data-for="[% for %]">
- <option value="">[% loc('Choose a template') %]</option>
+ <option value="">[% loc('--Choose a template--') %]</option>
[% FOR t IN problem.response_templates %]
<option value="[% t.text | html %]"> [% t.title | html %] </option>
[% END %]
diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html
new file mode 100644
index 000000000..54058a04c
--- /dev/null
+++ b/templates/web/base/admin/template_edit.html
@@ -0,0 +1,50 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Template for %s'), body.name) -%]
+[% rt = response_template %]
+
+[% UNLESS rt.id %]<h3>[% loc('New template') %]</h3>[% END %]
+
+<form method="post"
+ action="[% c.uri_for('templates', body.id, rt.id || 'new' ) %]"
+ enctype="application/x-www-form-urlencoded"
+ accept-charset="utf-8"
+ class="validate">
+
+ <p>
+ <strong>[% loc('Title:') %] </strong>
+ <input type="text" name="title" class="required" size="30" value="[% rt.title| html %]">
+ </p>
+ <p>
+ <strong>[% loc('Text:') %] </strong>
+ <textarea 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>
+ <p>
+ <strong>[% loc('Categories:') %]</strong>
+ <ul>
+ [% FOR contact IN contacts %]
+ <li>
+ <label>
+ <input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/>
+ [% contact.category %]
+ </label>
+ </li>
+ [% END %]
+ </ul>
+ </p>
+ <p>
+ <input type="hidden" name="token" value="[% csrf_token %]" >
+ <input type="submit" name="Edit templates" value="[% rt.id ? loc('Save changes') : loc('Create template') %]" >
+ </p>
+ [% IF rt.id %]
+ <p>
+ <input class="delete" type="submit" name="delete_template" value="[% loc('Delete template') %]">
+ </p>
+ [% END %]
+</form>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/admin/templates.html b/templates/web/base/admin/templates.html
index d3b334022..25cd181aa 100644
--- a/templates/web/zurich/admin/templates.html
+++ b/templates/web/base/admin/templates.html
@@ -1,6 +1,8 @@
[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Templates for %s'), body.name) -%]
-<h2> [% tprintf(loc('Response Templates for %s'), body.name) %] </h2>
+[% IF c.cobrand.moniker == 'zurich' %]
+ <h2> [% tprintf(loc('Response Templates for %s'), body.name) %] </h2>
+[% END %]
<table>
<thead>
diff --git a/templates/web/base/admin/templates_index.html b/templates/web/base/admin/templates_index.html
new file mode 100644
index 000000000..1f45b84de
--- /dev/null
+++ b/templates/web/base/admin/templates_index.html
@@ -0,0 +1,11 @@
+[% INCLUDE 'admin/header.html' title=loc('Response Templates') -%]
+
+<ul>
+ [% FOR body IN bodies %]
+ <li>
+ <a href="/admin/templates/[% body.id %]">[% body.name %]</a>
+ </li>
+ [% END %]
+</ul>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html
index c22480011..b05f15355 100644
--- a/templates/web/base/admin/user-form.html
+++ b/templates/web/base/admin/user-form.html
@@ -49,7 +49,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.has_permission_to('user_assign_body', c.user.from_body.id) %]>
+ [% 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') %]>
</li>
[% END %]
@@ -116,7 +116,7 @@
[% FOREACH permission IN group.value %]
<li>
<label>
- <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF user.has_permission_to(permission.key, user.from_body.id) %]>
+ <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF user.has_body_permission_to(permission.key) %]>
[% permission.value %]
</label>
</li>
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html
index 19a3de03c..dfff77ee6 100644
--- a/templates/web/base/admin/users.html
+++ b/templates/web/base/admin/users.html
@@ -25,7 +25,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.from_body AND user.has_permission_to('moderate', user.from_body.id) %] * [% END %]
+ [% IF user.has_body_permission_to('moderate') %] * [% END %]
</td>
[% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index 007bd68d8..ef87d9de0 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -25,6 +25,9 @@
[% END %]
<label for="form_update">[% loc( 'Update' ) %]</label>
+[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+ [% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
+[% END %]
[% IF field_errors.update %]
<div class='form-error'>[% field_errors.update %]</div>
[% END %]
diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html
index e347c8677..d5884272b 100644
--- a/templates/web/oxfordshire/header.html
+++ b/templates/web/oxfordshire/header.html
@@ -42,7 +42,7 @@
<[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END
%]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]>
</li>
- [% IF c.user_exists AND c.user.has_permission_to('planned_reports', c.user.from_body.id) %]
+ [% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') %]
<li>
<[% IF c.req.uri.path == '/my/planned' %]span[% ELSE %]a href="/my/planned"[% END
%]>[% loc('Planned reports') %]</[% c.req.uri.path == '/my/planned' ? 'span' : 'a' %]>