diff options
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r-- | templates/web/base/admin/bodies/_category_field.html | 5 | ||||
-rw-r--r-- | templates/web/base/admin/bodies/contact-form.html | 35 | ||||
-rw-r--r-- | templates/web/base/admin/extra-metadata-item.html | 1 | ||||
-rw-r--r-- | templates/web/base/admin/report-category.html | 8 | ||||
-rw-r--r-- | templates/web/base/admin/reports/edit.html | 15 | ||||
-rw-r--r-- | templates/web/base/admin/templates/_external.html | 12 | ||||
-rw-r--r-- | templates/web/base/admin/templates/edit.html | 13 | ||||
-rw-r--r-- | templates/web/base/admin/triage/_inspect.html | 1 | ||||
-rw-r--r-- | templates/web/base/admin/triage/_list-filters.html | 5 | ||||
-rw-r--r-- | templates/web/base/admin/users/_form_details.html | 33 | ||||
-rw-r--r-- | templates/web/base/admin/users/form.html | 55 | ||||
-rw-r--r-- | templates/web/base/admin/users/index.html | 6 | ||||
-rw-r--r-- | templates/web/base/admin/users/log.html | 2 |
13 files changed, 132 insertions, 59 deletions
diff --git a/templates/web/base/admin/bodies/_category_field.html b/templates/web/base/admin/bodies/_category_field.html index 8c5a1c352..c45cc5524 100644 --- a/templates/web/base/admin/bodies/_category_field.html +++ b/templates/web/base/admin/bodies/_category_field.html @@ -9,7 +9,10 @@ </div> <p> - <strong>[% loc('Category') %] </strong><input type="text" class="form-control" name="category" size="30" value="[% contact.category | html %]" required> + <label for="category">[% loc('Category') %]</label> + <input type="text" class="form-control" id="category" name="category" + size="30" value="[% contact.category %]" + [% contact.category_uneditable ? 'readonly' : 'required' %]> </p> [% IF contact.in_storage %] diff --git a/templates/web/base/admin/bodies/contact-form.html b/templates/web/base/admin/bodies/contact-form.html index 35fab4541..fab485a2f 100644 --- a/templates/web/base/admin/bodies/contact-form.html +++ b/templates/web/base/admin/bodies/contact-form.html @@ -63,13 +63,45 @@ <textarea id="disabled-message" name="disable_message" class="form-control">[% contact.disable_form_field.description %]</textarea> </p> - [% IF body.send_method == 'Open311' %] + <p class="form-check"> + <input type="checkbox" name="updates_disallowed" value="1" id="updates_disallowed" [% ' checked' IF contact.get_extra_metadata('updates_disallowed') %]> + <label for="updates_disallowed">[% loc('Disable updates on reports in this category') %]</label> + [% TRY %][% INCLUDE admin/bodies/_updates_disallowed_hint.html %][% CATCH file %][% END %] + </p> + + <p class="form-check"> + <input type="checkbox" name="reopening_disallowed" value="1" id="reopening_disallowed" [% ' checked' IF contact.get_extra_metadata('reopening_disallowed') %]> + <label for="reopening_disallowed">[% loc('Disable reopening of reports in this category') %]</label> + <span class='form-hint'>[% loc('Use this where you do not want problem reporters to be able to reopen their fixed or closed reports when leaving an update.') %]</span> + </p> + + [% IF body.get_cobrand_handler.anonymous_account %] + <p class="form-check"> + <input type="checkbox" name="anonymous_allowed" value="1" id="anonymous_allowed" [% ' checked' IF contact.get_extra_metadata('anonymous_allowed') %]> + <label for="anonymous_allowed">[% loc('Allow anonymous reports on this category') %]</label> + </p> + [% END %] + + [% IF contact.sent_by_open311 %] <p class="form-check"> <input type="checkbox" name="open311_protect" value="1" id="open311_protect"[% ' checked' IF contact.get_extra_metadata('open311_protect') %]> <label for="open311_protect">[% loc("Protect this category's name and group(s) from Open311 changes") %]</label> </p> [% END %] + [% IF c.user.is_superuser %] + <p class="form-check"> + <input type="checkbox" name="hardcoded" value="1" id="hardcoded"[% ' checked' IF contact.get_extra_metadata('hardcoded') %]> + <label for="hardcoded">[% loc("Protect this category from being re-named") %]</label> + </p> + [% END %] + + <p class="form-check"> + <input type="checkbox" name="assigned_users_only" value="1" id="assigned_users_only" [% ' checked' IF contact.extra.assigned_users_only %]> + <label for="assigned_users_only">[% loc('Frontend staff access only to users assigned to this category') %]</label> + <span class='form-hint'>[% loc('Use this if you wish only users assigned to this category to see staff-related features (such as the inspector form) in the front end.') %]</span> + </p> + [% IF body.can_be_devolved %] <div class="admin-hint"> <p> @@ -114,6 +146,7 @@ <h2>[% loc('Extra data:') %] </h2> <dl> [% FOR pair IN contact.get_extra_metadata %] + [% NEXT IF pair.key == 'group' OR pair.key == 'assigned_users_only' %] <dt>[% pair.key %]</dt> <dd>[% pair.value OR '<em>-</em>' %]</dd> [% END %] </dl> diff --git a/templates/web/base/admin/extra-metadata-item.html b/templates/web/base/admin/extra-metadata-item.html index 66cb6f79c..aa563e851 100644 --- a/templates/web/base/admin/extra-metadata-item.html +++ b/templates/web/base/admin/extra-metadata-item.html @@ -67,6 +67,7 @@ DEFAULT behaviour = 'question'; <label for="metadata-[% i %]-datatype">[% loc('Display as') %]</label> <select class="form-control" name="metadata[[% i %]].datatype" id="metadata-[% i %]-datatype"> <option value="string" data-hide="#metadata-[% i %]-options-group" [% 'selected' IF meta.datatype == 'string' %]>[% loc('Text field') %]</option> + <option value="text" data-hide="#metadata-[% i %]-options-group" [% 'selected' IF meta.datatype == 'text' %]>[% loc('Textarea') %]</option> <option value="singlevaluelist" data-show="#metadata-[% i %]-options-group" [% 'selected' IF meta.datatype == 'singlevaluelist' %]>[% loc('Drop-down list') %]</option> </select> </div> diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html index e76106f7f..b15f57e71 100644 --- a/templates/web/base/admin/report-category.html +++ b/templates/web/base/admin/report-category.html @@ -1,12 +1,10 @@ -[%~ IF NOT select_name %] - [%~ select_name = 'category' %] -[%~ END %] [%~ BLOCK category_option ~%] <option value="[% cat.category | html %]"[% ' selected' IF problem.category == cat.category %]>[% cat.category_display | html %]</option> [%~ END ~%] -<select class="form-control" name="[% select_name %]" id="[% select_name %]"> - [% IF NOT problem.category OR NOT categories_hash.${problem.category} %] +<select class="form-control" name="category" id="category"> + [% SET category_safe = mark_safe(problem.category) ~%] + [% IF NOT problem.category OR NOT categories_hash.$category_safe %] <optgroup label="[% loc('Existing category') %]"> <option selected value="[% problem.category | html %]">[% (problem.category_display OR '-') | html %]</option> </optgroup> diff --git a/templates/web/base/admin/reports/edit.html b/templates/web/base/admin/reports/edit.html index d2b866d01..6e7cff4cf 100644 --- a/templates/web/base/admin/reports/edit.html +++ b/templates/web/base/admin/reports/edit.html @@ -131,7 +131,20 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> <li><label class="inline-text" for="category">[% loc('Category:') %]</label> [% INCLUDE 'admin/report-category.html' %] </li> -<li>[% loc('Extra data:') %] [% IF extra_fields.size %]<ul>[% FOREACH field IN extra_fields %]<li><strong>[% field.name %]</strong>: [% field.val %]</li>[% END %]</ul>[% ELSE %]No[% END %]</li> +<li>[% loc('Extra data:') ~%] + [%~ IF extra_fields.size ~%] + <ul> + [%~ FOREACH field IN extra_fields ~%] + <li><strong>[%~ field.name ~%]</strong>: [% IF field.val.0.defined ~%] + [%~ field.val.list.join(", ") ~%] + [%~ ELSE ~%] + [%~ field.val ~%] + [%~ END ~%] + </li> + [%~ END ~%] + </ul> + [%~ ELSE %] No[% END ~%] +</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/templates/_external.html b/templates/web/base/admin/templates/_external.html new file mode 100644 index 000000000..d25d2b39c --- /dev/null +++ b/templates/web/base/admin/templates/_external.html @@ -0,0 +1,12 @@ +[% IF errors.external_status_code %] + <div class="form-error">[% errors.external_status_code %]</div> +[% END %] +<div class="admin-hint"> + <p> + [% loc('If you want to use this template to prefill the update field when a report’s <strong>external</strong> (e.g. Confirm) status code changes, enter the status code here.') %] + </p> +</div> +<p> + <label for="external_status_code">[% loc('External status code') %]</label> + <input type="text" id="external_status_code" name="external_status_code" class="form-control" size="30" value="[% rt.external_status_code | html %]"> +</p> diff --git a/templates/web/base/admin/templates/edit.html b/templates/web/base/admin/templates/edit.html index 7ce67f96f..f52c26b49 100644 --- a/templates/web/base/admin/templates/edit.html +++ b/templates/web/base/admin/templates/edit.html @@ -51,18 +51,7 @@ [% INCLUDE 'report/inspect/state_groups_select.html' current_state=rt.state include_empty=1 %] </p> - [% IF errors.external_status_code %] - <div class="form-error">[% errors.external_status_code %]</div> - [% END %] - <div class="admin-hint"> - <p> - [% loc('If you want to use this template to prefill the update field when a report’s <strong>external</strong> (e.g. Confirm) status code changes, enter the status code here.') %] - </p> - </div> - <p> - <label for="external_status_code">[% loc('External status code') %]</label> - <input type="text" name="external_status_code" class="form-control" size="30" value="[% rt.external_status_code | html %]"> - </p> + [% PROCESS 'admin/templates/_external.html' %] [% IF errors.auto_response %] <div class="form-error">[% errors.auto_response %]</div> diff --git a/templates/web/base/admin/triage/_inspect.html b/templates/web/base/admin/triage/_inspect.html index 926197ceb..bd76a47f7 100644 --- a/templates/web/base/admin/triage/_inspect.html +++ b/templates/web/base/admin/triage/_inspect.html @@ -24,7 +24,6 @@ </select> [% END %] -[% permissions = c.user.permissions(problem) %] [% second_column = BLOCK -%] <div id="side-inspect"> diff --git a/templates/web/base/admin/triage/_list-filters.html b/templates/web/base/admin/triage/_list-filters.html index dd3e17875..29f48f0bb 100644 --- a/templates/web/base/admin/triage/_list-filters.html +++ b/templates/web/base/admin/triage/_list-filters.html @@ -2,8 +2,9 @@ [% IF filter_categories.size %] <select class="form-control js-multiple" name="filter_category" id="filter_categories" multiple data-all="[% loc('Everything') %]"> [% FOR cat IN filter_categories %] - <option value="[% cat.category | html %]"[% ' selected' IF filter_category.${cat.category} %]> - [% cat.category_display | html %] + [%~ SET cat_safe = mark_safe(cat.category) %] + <option value="[% cat.category %]"[% ' selected' IF filter_category.$cat_safe %]> + [% cat.category_display %] [%~ IF cat.get_extra_metadata('help_text') %] ([% cat.get_extra_metadata('help_text') %])[% END ~%] </option> [% END %] diff --git a/templates/web/base/admin/users/_form_details.html b/templates/web/base/admin/users/_form_details.html new file mode 100644 index 000000000..78debca32 --- /dev/null +++ b/templates/web/base/admin/users/_form_details.html @@ -0,0 +1,33 @@ +<li> + <div class="admin-hint"> + <p> + [% loc( + "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>. + Names are not necessarily unique.") + %] + </p> + </div> + <label for="name">[% loc('Name:') %]</label> + <input type='text' class="form-control" name='name' id='name' value='[% user.name | html %]'> +</li> + +<li><label for="email">[% loc('Email:') %]</label> +<input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'> +[% IF user %] + <input class="btn" type="submit" name="send_login_email" value="[% loc('Send login email') %]"> +[% END %] +</li> + +<li><label class="inline-text" for="email_verified">[% loc('Email verified:') %]</label> +<input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]> + +<li><label for="phone">[% loc('Phone:') %]</label> +<input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li> +<li><label class="inline-text" for="phone_verified">[% loc('Phone verified:') %]</label> +<input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]> + +[% IF username_in_abuse %] +<li> + <p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p> +</li> +[% END %] diff --git a/templates/web/base/admin/users/form.html b/templates/web/base/admin/users/form.html index 495da8648..c782b7172 100644 --- a/templates/web/base/admin/users/form.html +++ b/templates/web/base/admin/users/form.html @@ -7,38 +7,9 @@ [% INCLUDE 'errors.html' errors = field_errors.values %] <ul class="no-bullets"> - <li> - <div class="admin-hint"> - <p> - [% loc( - "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>. - Names are not necessarily unique.") - %] - </p> - </div> - <label for="name">[% loc('Name:') %]</label> - <input type='text' class="form-control" name='name' id='name' value='[% user.name | html %]'> - </li> - <li><label for="email">[% loc('Email:') %]</label> - <input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'> - [% IF user %] - <input class="btn" type="submit" name="send_login_email" value="[% loc('Send login email') %]"> - [% END %] - </li> - <li><label class="inline-text" for="email_verified">[% loc('Email verified:') %]</label> - <input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]> - <li><label for="phone">[% loc('Phone:') %]</label> - <input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li> - <li><label class="inline-text" for="phone_verified">[% loc('Phone verified:') %]</label> - <input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]> + [% PROCESS 'admin/users/_form_details.html' %] - [% IF username_in_abuse %] - <li> - <p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p> - </li> - [% END %] - - [% IF c.user.is_superuser || c.cobrand.moniker == 'zurich' %] + [% IF c.user.is_superuser %] <li> <div class="admin-hint"> <p> @@ -72,7 +43,7 @@ </li> [% END %] - [% IF areas AND c.cobrand.moniker != 'zurich' %] + [% IF areas %] <li> <div class="admin-hint"> <p> @@ -94,14 +65,28 @@ </li> [% END %] - [% IF contacts AND c.cobrand.moniker != 'zurich'%] + [% IF contacts %] <li class="js-user-categories"> [% INCLUDE 'admin/category-checkboxes.html' hint=loc("Authorised staff users can be associated with the categories in which they operate.") %] </li> [% END %] - [% IF c.cobrand.moniker != 'zurich' %] + [% IF user.from_body %] + <li> + <div class="admin-hint"> + <p> + [% loc("This means the user will only see front end staff features (such as the inspector form) in their assigned categories.") %] + </p> + </div> + + <label> + [% loc('Assigned categories only') %]: + <input type="checkbox" id="assigned_categories_only" name="assigned_categories_only"[% user.extra.assigned_categories_only ? ' checked' : '' %]> + </label> + </li> + [% END %] + <li> <div class="admin-hint"> <p> @@ -182,7 +167,7 @@ </fieldset> </li> [% END %] - [% END %] + [% TRY %][% INCLUDE 'admin/users/form-extra-fields.html' %][% CATCH file %][% END %] </ul> <p> diff --git a/templates/web/base/admin/users/index.html b/templates/web/base/admin/users/index.html index e573c10fe..dbd32f3a1 100644 --- a/templates/web/base/admin/users/index.html +++ b/templates/web/base/admin/users/index.html @@ -80,6 +80,12 @@ [% END %] </select> [% END %] +<p> + <label for="remove-staff"> + [% loc("Remove staff permissions") %] + <input type="checkbox" id="remove-staff" name="remove-staff" value="remove-staff"> + </label> +</p> <p><input class="btn" type="submit" value="[% loc('Save changes') %]"> </form> diff --git a/templates/web/base/admin/users/log.html b/templates/web/base/admin/users/log.html index 4b426e0ba..5c3f36321 100644 --- a/templates/web/base/admin/users/log.html +++ b/templates/web/base/admin/users/log.html @@ -49,7 +49,7 @@ action_map = { [%- tprintf(loc('Problem %s created on behalf of %s'), mark_safe(report_link), item.obj.name) %], ‘[% item.obj.title | html %]’ [%~ CASE 'update' %] [% tprintf(loc("Update %s created for problem %d"), mark_safe(report_link), item.obj.problem_id) %] - [% item.obj.text | add_links | markup(item.obj.user) | html_para %] + [% item.obj.text | staff_html_markup(item.obj.extra) %] [%~ CASE 'shortlistAdded' %] [%- tprintf(loc('Problem %s added to shortlist'), mark_safe(report_link)) %] [%~ CASE 'shortlistRemoved' %] |