diff options
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r-- | templates/web/base/admin/report_edit.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/response_templates_select.html | 8 | ||||
-rw-r--r-- | templates/web/base/admin/template_edit.html | 50 | ||||
-rw-r--r-- | templates/web/base/admin/templates.html | 30 | ||||
-rw-r--r-- | templates/web/base/admin/templates_index.html | 11 | ||||
-rw-r--r-- | templates/web/base/admin/user-form.html | 4 | ||||
-rw-r--r-- | templates/web/base/admin/users.html | 2 |
7 files changed, 103 insertions, 4 deletions
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index 48a02593b..96e59d1c4 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -81,7 +81,7 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> ([% problem.send_method_used %]) [% END %] [% IF problem.state == 'confirmed' AND problem.whensent %] - <input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]"> + <input data-confirm="[% loc('Are you sure?') %]" type="submit" name="resend" value="[% loc('Resend report') %]"> [% ELSIF NOT problem.whensent %] <input type="submit" name="mark_sent" value="[% loc('Mark as sent') %]"> [% END %] diff --git a/templates/web/base/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html new file mode 100644 index 000000000..664d1d20a --- /dev/null +++ b/templates/web/base/admin/response_templates_select.html @@ -0,0 +1,8 @@ +<div class="response_templates_select"> + <select id="templates_for_[% for %]" class="js-template-name" data-for="[% for %]"> + <option value="">[% loc('--Choose a template--') %]</option> + [% FOR t IN problem.response_templates %] + <option value="[% t.text | html %]"> [% t.title | html %] </option> + [% END %] + </select> +</div> 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/base/admin/templates.html b/templates/web/base/admin/templates.html new file mode 100644 index 000000000..25cd181aa --- /dev/null +++ b/templates/web/base/admin/templates.html @@ -0,0 +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> </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="/admin/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' %] 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') : ' ' %]</td> |