diff options
author | Struan Donald <struan@exo.org.uk> | 2018-11-01 15:19:53 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-19 13:29:49 +0000 |
commit | 3d7523690accf22af95704394832d8e675472a4b (patch) | |
tree | c5e70860c89cbaf362c81e27cb8cf04c67a413b3 /templates | |
parent | b4618c61ff5ddf6db9662b06bc55a0f74b43c903 (diff) |
add report_prefill user permission
If set then when the user creates a new body report it will prefill the
report title and description with some basic text.
For mysociety/freshdesk#23
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/report/new/category.html | 3 | ||||
-rw-r--r-- | templates/web/base/report/new/category_wrapper.html | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/templates/web/base/report/new/category.html b/templates/web/base/report/new/category.html index 83af42c6d..44ed8df71 100644 --- a/templates/web/base/report/new/category.html +++ b/templates/web/base/report/new/category.html @@ -15,7 +15,8 @@ </label>[% =%] <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 %]" + [%~ prefill_report = ( c.cobrand.prefill_report_fields_for_inspector && inspector ) || c.user.has_body_permission_to('report_prefill') %] + data-body="[% c.user.from_body.name %]" data-prefill="[% prefill_report %]" [%~ END ~%] > [%~ IF category_groups.size ~%] diff --git a/templates/web/base/report/new/category_wrapper.html b/templates/web/base/report/new/category_wrapper.html index abc44d062..da25e51df 100644 --- a/templates/web/base/report/new/category_wrapper.html +++ b/templates/web/base/report/new/category_wrapper.html @@ -3,7 +3,8 @@ <label for="form_category">[% loc('Category') %]</label> <select class="form-control" 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 %]" + [%~ prefill_report = c.cobrand.prefill_report_fields_for_inspector || c.user.has_body_permission_to('report_prefill') %] + data-body="[% c.user.from_body.name %]" data-prefill="[% prefill_report %]" [%~ END =%] required><option>[% loc('Loading...') %]</option></select> [% ELSE %] |