aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-11-01 15:19:53 +0000
committerStruan Donald <struan@exo.org.uk>2018-11-19 13:29:49 +0000
commit3d7523690accf22af95704394832d8e675472a4b (patch)
treec5e70860c89cbaf362c81e27cb8cf04c67a413b3 /templates
parentb4618c61ff5ddf6db9662b06bc55a0f74b43c903 (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.html3
-rw-r--r--templates/web/base/report/new/category_wrapper.html3
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 %]