aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/report
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/report')
-rw-r--r--templates/web/base/report/_council_sent_info.html2
-rw-r--r--templates/web/base/report/_inspect.html11
-rw-r--r--templates/web/base/report/_item.html25
-rw-r--r--templates/web/base/report/_item_expandable.html4
-rw-r--r--templates/web/base/report/_report_meta_info.html2
-rw-r--r--templates/web/base/report/_update_state.html8
-rw-r--r--templates/web/base/report/display.html3
-rw-r--r--templates/web/base/report/display_tools.html5
-rw-r--r--templates/web/base/report/form/photo_upload.html24
-rw-r--r--templates/web/base/report/form/submit.html2
-rw-r--r--templates/web/base/report/form/user_loggedout_by_email.html67
-rw-r--r--templates/web/base/report/form/user_loggedout_email.html11
-rw-r--r--templates/web/base/report/inspect/extra_details.html12
-rw-r--r--templates/web/base/report/inspect/information.html11
-rw-r--r--templates/web/base/report/inspect/public_update.html3
-rw-r--r--templates/web/base/report/new/_category_select.html1
-rw-r--r--templates/web/base/report/new/category.html2
-rw-r--r--templates/web/base/report/new/category_extras_fields.html2
-rw-r--r--templates/web/base/report/new/form_report.html1
-rw-r--r--templates/web/base/report/new/form_user_loggedin.html10
-rw-r--r--templates/web/base/report/new/login_success_form.html2
-rw-r--r--templates/web/base/report/new/oauth_email_form.html2
-rw-r--r--templates/web/base/report/update.html4
-rw-r--r--templates/web/base/report/update/form_state_checkbox.html2
-rw-r--r--templates/web/base/report/update/form_update.html29
-rw-r--r--templates/web/base/report/update/form_user_loggedin.html13
-rw-r--r--templates/web/base/report/updates.html2
27 files changed, 157 insertions, 103 deletions
diff --git a/templates/web/base/report/_council_sent_info.html b/templates/web/base/report/_council_sent_info.html
index dca74f994..ae0f80a2e 100644
--- a/templates/web/base/report/_council_sent_info.html
+++ b/templates/web/base/report/_council_sent_info.html
@@ -1,4 +1,4 @@
-[% SET duration_clause = problem.duration_string(c) %]
+[% SET duration_clause = problem.duration_string %]
[% IF duration_clause || problem.can_display_external_id %]
<p class="council_sent_info">
[%- IF problem.can_display_external_id %]
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 771942b16..1877640b4 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -1,4 +1,3 @@
-[% permissions = c.user.permissions(problem) %]
[% second_column = BLOCK -%]
<div id="side-inspect">
@@ -6,7 +5,7 @@
[% INCLUDE 'errors.html' %]
- <form name="report_inspect_form" id="report_inspect_form" method="post" action="[% c.uri_for( '/report', problem.id ) %]" class="validate">
+ <form name="report_inspect_form" id="report_inspect_form" method="post" action="[% c.uri_for( '/report', problem.id ) %]" class="validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]>
[% INCLUDE 'report/inspect/information.html' %]
@@ -19,13 +18,14 @@
[% FOREACH category IN category_options %]
[% cat_name = category.category;
+ cat_safe = mark_safe(cat_name);
cat_prefix = cat_name | lower | replace('[^a-z]', '');
cat_prefix = "category_" _ cat_prefix _ "_" %]
<p data-category="[% cat_name | html %]"
[%~ IF cat_name != problem.category %] class="hidden"[% END %]
- data-priorities='[% priorities_by_category.$cat_name | html %]'
- data-templates='[% templates_by_category.$cat_name | html %]'>
- [% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$cat_name hide_notices=1 show_hidden=1 %]
+ data-priorities='[% priorities_by_category.$cat_safe | html %]'
+ data-templates='[% templates_by_category.$cat_safe | html %]'>
+ [% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$cat_safe hide_notices=1 show_hidden=1 %]
</p>
[% END %]
@@ -34,6 +34,7 @@
<label for="state">[% loc('State') %]</label>
[% INCLUDE 'report/inspect/state_groups_select.html' %]
</p>
+ [% TRY %][% INCLUDE 'report/inspect/_raise_defect.html' %][% CATCH file %][% END %]
<div id="js-duplicate-reports" class="[% "hidden" UNLESS problem.duplicate_of %]">
<input type="hidden" name="duplicate_of" value="[% problem.duplicate_of.id %]">
<p class="[% "hidden" UNLESS problem.duplicate_of %]"><strong>[% loc('Duplicate of') %]</strong></p>
diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html
index 4d74b3be9..f25d5d2a1 100644
--- a/templates/web/base/report/_item.html
+++ b/templates/web/base/report/_item.html
@@ -2,7 +2,18 @@
[% PROCESS 'admin/report_blocks.html' ~%]
[% END ~%]
-[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) OR c.user.is_planned_report(problem) ~%]
+[%
+
+SET relevant_staff = 1;
+SET category_safe = mark_safe(problem.category);
+SET is_user_category = user_categories.$category_safe;
+IF (assigned_users_only.$category_safe OR assigned_categories_only) AND NOT is_user_category;
+ SET relevant_staff = 0;
+END;
+
+~%]
+
+[% IF relevant_staff AND (c.user.has_permission_to('planned_reports', problem.bodies_str_ids) OR c.user.is_planned_report(problem)) ~%]
[% item_extra_class = "item-list__item--indented" ~%]
[% item_action = BLOCK ~%]
<input type="submit" value="1"
@@ -40,7 +51,9 @@
[% PROCESS 'report/_item_photo_title.html' ~%]
[% CATCH file ~%]
[% IF problem.photo %]
- <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt="">
+ <noscript class="loading-lazy">
+ <img loading="lazy" class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt="">
+ </noscript>
[% END %]
[% TRY %]
[% PROCESS 'report/_item_heading.html' %]
@@ -49,12 +62,12 @@
[% END %]
[% END ~%]
- [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
+ [% IF relevant_staff AND c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
<div class="item-list__description">[% problem.detail | html %]</div>
[% END %]
<small>[% PROCESS 'report/_item_small.html' %]</small>
- [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
+ [% IF relevant_staff AND c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
<div class="item-list__item__metadata">
<div>
<h4>[% loc('Report ID:') %]</h4>
@@ -83,10 +96,6 @@
<p>[% problem.response_priority.name OR '-' %]</p>
</div>
<div>
- <h4>[% loc('Traffic management required?') %]</h4>
- <p>[% problem.get_extra_metadata('traffic_information') %]</p>
- </div>
- <div>
<h4>[% loc('Extra details') %]</h4>
<p>[% problem.get_extra_metadata('detailed_information') | html %]</p>
</div>
diff --git a/templates/web/base/report/_item_expandable.html b/templates/web/base/report/_item_expandable.html
index fad935407..ab363482a 100644
--- a/templates/web/base/report/_item_expandable.html
+++ b/templates/web/base/report/_item_expandable.html
@@ -18,7 +18,9 @@
[% IF problem.photo %]
<a href="[% c.cobrand.relative_url_for_report( problem ) %][% problem.url %]" class="item-list__item--expandable__hide-when-expanded">
- <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt="">
+ <noscript class="loading-lazy">
+ <img loading="lazy" class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt="">
+ </noscript>
</a>
[% END %]
diff --git a/templates/web/base/report/_report_meta_info.html b/templates/web/base/report/_report_meta_info.html
index e2a6412a3..73e897e34 100644
--- a/templates/web/base/report/_report_meta_info.html
+++ b/templates/web/base/report/_report_meta_info.html
@@ -1,4 +1,4 @@
-[% problem.meta_line(c) | html %]
+[% problem.meta_line(c.user) | html %]
[% IF c.user_exists AND c.user.id == problem.user_id AND !problem.anonymous %]
<small>(<a href="/my/anonymize?problem=[% problem.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small>
[% END %]
diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html
index 0274d7695..d484dcb05 100644
--- a/templates/web/base/report/_update_state.html
+++ b/templates/web/base/report/_update_state.html
@@ -1,10 +1,10 @@
[% # Small chance of duplicates in the case of fixed - user followed by fixed - council %]
-[% SET update_state = update.problem_state %]
-[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') )
+[% SET update_state = update.problem_state_processed %]
+[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state_processed == 'confirmed') )
OR update.mark_fixed
OR update.mark_open
%]
- <p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display(c) %]</p>
+ <p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display %]</p>
[%- global.last_state = update_state %]
[%- IF update_state == "" AND update.mark_fixed %][% global.last_state = 'fixed - user' %][% END %]
[%- IF update_state == "" AND update.mark_open %][% global.last_state = 'confirmed' %][% END %]
@@ -12,7 +12,7 @@
<p class="meta-2">
[% INCLUDE meta_line %]
- [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %]
+ [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous AND NOT (c.user.from_body OR c.user.is_superuser) %]
<small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small>
[% END %]
[% mlog = update.latest_moderation_log_entry(); IF mlog %]
diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html
index f08df931d..af2282f66 100644
--- a/templates/web/base/report/display.html
+++ b/templates/web/base/report/display.html
@@ -38,9 +38,6 @@
[% SET shown_form = 1 %]
[% END %]
-[% IF c.user_exists %]
- [% DEFAULT permissions = c.user.permissions(problem) %]
-[%- END %]
[% INCLUDE 'report/_main.html' %]
[% IF problem.duplicate_of %]
diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html
index e16ffcb2c..532c78ec8 100644
--- a/templates/web/base/report/display_tools.html
+++ b/templates/web/base/report/display_tools.html
@@ -1,7 +1,7 @@
<div class="shadow-wrap">
<ul id="key-tools">
[% IF c.user_exists OR NOT problem.non_public %]
- [% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( problem.bodies_str ) %]
+ [% IF c.cobrand.users_can_hide AND relevant_staff_user %]
<li><form method="post" action="/report/[% problem.id %]/delete" id="remove-from-site-form">
<input type="hidden" name="token" value="[% csrf_token %]">
<button type="submit" id="key-tool-report-abuse" class="abuse" data-confirm="[% loc('Are you sure?') %]" name="remove_from_site">[% loc('Remove from site') %]</button>
@@ -44,9 +44,10 @@
<img src="/i/feed.png" width="16" height="16" title="[% loc('RSS feed') %]" alt="[% loc('RSS feed of updates to this problem' ) %]" border="0">
</a>
[% loc('Receive email when updates are left on this problem.' ) %]</p>
+ [% PROCESS 'auth/form_extra.html' %]
<fieldset>
[% IF c.user_exists %]
- [% IF c.user.has_permission_to("contribute_as_another_user", problem.bodies_str_ids) %]
+ [% IF permissions.contribute_as_another_user %]
<label for="alert_rznvy">[% loc('Email') %]</label>
<div class="form-txt-submit-box">
<input type="email" class="form-control" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30">
diff --git a/templates/web/base/report/form/photo_upload.html b/templates/web/base/report/form/photo_upload.html
new file mode 100644
index 000000000..960141210
--- /dev/null
+++ b/templates/web/base/report/form/photo_upload.html
@@ -0,0 +1,24 @@
+[% IF c.cobrand.allow_photo_upload %]
+ <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
+ <label for="form_photo">
+ <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span>
+ </label>
+
+ [% IF field_errors.photo %]
+ <p class='form-error'>[% field_errors.photo %]</p>
+ [% END %]
+
+ <div id="form_photos">
+ [% IF upload_fileid %]
+ <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
+ [% FOREACH id IN upload_fileid.split(',') %]
+ <img align="right" src="/photo/temp.[% id %]" alt="">
+ [% END %]
+ [% END %]
+ <input type="file" name="photo1" id="form_photo">
+ <label for="form_photo2">[% loc('Photo') %]</label>
+ <input type="file" name="photo2" id="form_photo2">
+ <label for="form_photo3">[% loc('Photo') %]</label>
+ <input type="file" name="photo3" id="form_photo3">
+ </div>
+[% END %]
diff --git a/templates/web/base/report/form/submit.html b/templates/web/base/report/form/submit.html
new file mode 100644
index 000000000..950bed965
--- /dev/null
+++ b/templates/web/base/report/form/submit.html
@@ -0,0 +1,2 @@
+<input class="desk-only btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]">
+<input class="mob-only btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register_mobile" value="[% loc('Submit') %]">
diff --git a/templates/web/base/report/form/user_loggedout_by_email.html b/templates/web/base/report/form/user_loggedout_by_email.html
index 33526cc46..3446fd767 100644
--- a/templates/web/base/report/form/user_loggedout_by_email.html
+++ b/templates/web/base/report/form/user_loggedout_by_email.html
@@ -7,15 +7,13 @@
[% INCLUDE 'report/form/user_name.html' %]
[% INCLUDE 'report/_show_name_label.html' %]
- [% IF type != 'update' %]
- [% IF NOT c.cobrand.call_hook('disable_phone_number_entry') AND NOT c.config.SMS_AUTHENTICATION %]
- <div id="js-hide-if-username-phone">
- <label for="form_phone">[% loc('Phone number (optional)') %]</label>
- [% IF field_errors.phone %]
- <p class='form-error'>[% field_errors.phone %]</p>
- [% END %]
- <input class="form-control" type="text" value="[% phone | html %]" name="phone" id="form_phone">
- </div>
+ [% IF type != 'update' AND NOT c.config.SMS_AUTHENTICATION %]
+ [% UNLESS c.cobrand.call_hook('disable_phone_number_entry') %]
+ <label for="form_phone">[% loc('Phone number (optional)') %]</label>
+ [% IF field_errors.phone %]
+ <p class='form-error'>[% field_errors.phone %]</p>
+ [% END %]
+ <input class="form-control" type="text" value="[% phone | html %]" name="phone" id="form_phone">
[% END %]
[% END %]
@@ -25,19 +23,44 @@
</div>
[% END %]
- [% PROCESS 'report/form/user_loggedout_email.html' name='username_register' %]
+ [% IF type != 'update' AND c.config.SMS_AUTHENTICATION AND NOT c.cobrand.call_hook('disable_phone_number_entry') %]
- [% IF type != 'update' AND c.config.SMS_AUTHENTICATION %]
- [% UNLESS c.cobrand.call_hook('disable_phone_number_entry') %]
- <div id="js-hide-if-username-phone" class="hidden-js">
- <label for="form_phone">[% loc('Phone number (optional)') %]</label>
- <input class="form-control" type="text" value="[% phone | html %]" name="phone" id="form_phone">
- </div>
+ <fieldset>
+ <legend>How would you like to receive updates?</legend>
+
+ [% IF field_errors.update_method %]
+ <p class='form-error'>[% field_errors.update_method %]</p>
[% END %]
- <div id="js-hide-if-username-email" class="hidden-js">
- <label for="form_email">[% loc('Email address (optional)') %]</label>
- <input class="form-control" type="text" value="[% email | html %]" name="email" id="form_email">
- </div>
+ <p class="segmented-control segmented-control--radio">
+ <input required type="radio" name="update_method" id="update_method_email"
+ data-show="#js-optional-phone" data-hide="#js-optional-email"
+ value="email"[% ' checked' IF update_method == 'email' %]>
+ <label class="btn" for="update_method_email">[% loc('Email') %]</label>
+ <input type="radio" name="update_method" id="update_method_phone"
+ data-show="#js-optional-email" data-hide="#js-optional-phone"
+ value="phone"[% ' checked' IF update_method == 'phone' %]>
+ <label class="btn" for="update_method_phone">[% loc('Phone') %]</label>
+ </p>
+ </fieldset>
+
+ [% IF field_errors.username_register %]
+ <p class='form-error'>[% field_errors.username_register %]</p>
+ [% END %]
+
+ <label for="form_email">[% loc('Your email') %]<span class="hidden-js" id="js-optional-email"> [% loc('(optional)') %]</span></label>
+ [% IF field_errors.email %]
+ <p class='form-error'>[% field_errors.email %]</p>
+ [% END %]
+ <input type="email" name="email" id="form_email" value="[% email %]" class="form-control">
+
+ <label for="form_phone">[% loc('Phone number') %]<span class="hidden-js" id="js-optional-phone"> [% loc('(optional)') %]</span></label>
+ [% IF field_errors.phone %]
+ <p class='form-error'>[% field_errors.phone %]</p>
+ [% END %]
+ <input class="form-control" type="text" value="[% phone %]" name="phone" id="form_phone">
+
+ [% ELSE %]
+ [% PROCESS 'report/form/user_loggedout_email.html' name='username_register' %]
[% END %]
[% IF type == 'update' %]
@@ -62,7 +85,9 @@
<input class="form-control js-password-validate" type="password" name="password_register" id="password_register" aria-describedby="password_register_hint" value="">
- <input class="btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]">
+ [% PROCESS 'auth/form_extra.html' %]
+
+ [% PROCESS 'report/form/submit.html' %]
</div>
<!-- /user_loggedout_by_email.html -->
diff --git a/templates/web/base/report/form/user_loggedout_email.html b/templates/web/base/report/form/user_loggedout_email.html
index 9f631987b..db3604d54 100644
--- a/templates/web/base/report/form/user_loggedout_email.html
+++ b/templates/web/base/report/form/user_loggedout_email.html
@@ -2,18 +2,17 @@
[% IF c.config.SMS_AUTHENTICATION %]
[% SET username_label = loc('Your email or mobile') %]
[% SET username_type = 'text' %]
- [% SET username_value = object.user.username %]
[% ELSE %]
[% SET username_label = loc('Your email') %]
[% SET username_type = 'email' %]
- [% SET username_value = object.user.email %]
[% END %]
+[% SET username_field = (name == 'username_sign_in') ? 'username' : name ~%]
<label for="form_[% name %]">[% username_label %]</label>
-[% IF field_errors.username %]
- <p class='form-error'>[% field_errors.username %]</p>
+[% IF field_errors.$name %]
+ <p class='form-error'>[% field_errors.$name %]</p>
[% END %]
-<input type="[% username_type %]" name="username" id="form_[% name %]"
- value="[% username_value | html %]"
+<input type="[% username_type %]" name="[% username_field %]" id="form_[% name %]"
+ value="[% c.get_param(username_field) %]"
class="form-control required">
<!-- /user_loggedout_email.html -->
diff --git a/templates/web/base/report/inspect/extra_details.html b/templates/web/base/report/inspect/extra_details.html
index 7777e9a78..621ae3688 100644
--- a/templates/web/base/report/inspect/extra_details.html
+++ b/templates/web/base/report/inspect/extra_details.html
@@ -3,21 +3,11 @@
<select name="priority" id="problem_priority" class="form-control">
<option value="" [% 'selected' UNLESS problem.response_priority_id OR has_default_priority %]>-</option>
[% FOREACH priority IN problem.response_priorities %]
- <option value="[% priority.id %]" [% 'selected' IF ( problem.response_priority_id == priority.id ) OR priority.is_default %][% 'disabled' IF priority.deleted %]>[% priority.name | html %]</option>
+ <option value="[% priority.id %]" [% 'selected' IF problem.response_priority_id == priority.id OR (NOT problem.response_priority_id AND priority.is_default) %]>[% priority.name | html %]</option>
[% END %]
</select>
</p>
[% IF permissions.report_inspect %]
- <p>
- <label for="traffic_information">[% loc('Traffic management required?') %]</label>
- [% traffic_info = problem.get_extra_metadata('traffic_information') %]
- <select id="traffic_information" name="traffic_information" class="form-control">
- <option value=""[% ' selected' IF NOT traffic_info %]>-</option>
- [% FOREACH option IN problem.traffic_management_options %]
- <option value='[% option %]'[% ' selected' IF traffic_info == option %]>[% option %]</option>
- [% END %]
- </select>
- </p>
[% INCLUDE 'report/inspect/_extra_details_field.html' %]
[% END %]
diff --git a/templates/web/base/report/inspect/information.html b/templates/web/base/report/inspect/information.html
index b81b37543..edebc4a0c 100644
--- a/templates/web/base/report/inspect/information.html
+++ b/templates/web/base/report/inspect/information.html
@@ -6,7 +6,7 @@
<p>
<strong>[% loc('Report ID:') %]</strong>
<span class="js-report-id">[% problem.id %]</span>
- [% IF c.user_exists AND c.cobrand.admin_allow_user(c.user) AND c.user.has_permission_to('report_edit', problem.bodies_str_ids) %]
+ [% IF c.user_exists AND c.cobrand.admin_allow_user(c.user) AND permissions.report_edit %]
(<a href="[% c.uri_for_action( 'admin/reports/edit', [ problem.id ] ) %]">[% loc('admin') %]</a>)
[% END %]
</p>
@@ -53,4 +53,13 @@
</p>
[% END %]
[% END %]
+
+ [% IF permissions.report_edit_category OR permissions.report_inspect %]
+ <!-- These fields are for the asset display code to use -->
+ <input type="hidden" name="inspect_category_group" id="inspect_category_group" value="">
+ <input type="hidden" name="inspect_form_category" id="inspect_form_category" value="">
+ <p>
+ <a href="#" class="btn btn--block btn--change-asset">[% loc('Change asset') %]</a>
+ </p>
+ [% END %]
</div>
diff --git a/templates/web/base/report/inspect/public_update.html b/templates/web/base/report/inspect/public_update.html
index be07d7b89..31940b6ee 100644
--- a/templates/web/base/report/inspect/public_update.html
+++ b/templates/web/base/report/inspect/public_update.html
@@ -7,8 +7,11 @@
[% loc('Save with a public update') %]
</label>
</p>
+ <div id="public_update_form_fields">
+ [% INCLUDE report/form/photo_upload.html %]
<p>
<label for="public_update">[% loc('Public update:') %]</label>
[% INCLUDE 'admin/response_templates_select.html' for='public_update' %]
<textarea rows="2" name="public_update" id="public_update" class="form-control">[% public_update | html %]</textarea>
</p>
+ </div>
diff --git a/templates/web/base/report/new/_category_select.html b/templates/web/base/report/new/_category_select.html
index d5aa9842b..61353647d 100644
--- a/templates/web/base/report/new/_category_select.html
+++ b/templates/web/base/report/new/_category_select.html
@@ -1,3 +1,4 @@
+[% SET filter_group = c.get_param('filter_group') %]
[%~ IF category_groups.size ~%]
[%~ FOREACH group IN category_groups ~%]
[% IF group.name %]<optgroup label="[% group.name %]">[% END %]
diff --git a/templates/web/base/report/new/category.html b/templates/web/base/report/new/category.html
index b5bfd0251..37479e4a5 100644
--- a/templates/web/base/report/new/category.html
+++ b/templates/web/base/report/new/category.html
@@ -10,7 +10,7 @@ END
[% IF category_options.size OR category_groups.size ~%]
[%~ BLOCK category_option ~%]
[% cat_lc = cat.category | lower =%]
- <option value='[% cat.category | html %]'[% ' selected' IF report.category == cat.category || category_lc == cat_lc ~%]
+ <option value='[% cat.category | html %]'[% ' selected' IF ( report.category == cat.category || category_lc == cat_lc ) AND ( NOT filter_group OR filter_group == group.name ) ~%]
>[% IF loop.first %][% cat.category_display %][% ELSE %][% cat.category_display | html %][% END %]
[%~ IF cat.get_extra_metadata('help_text') %] ([% cat.get_extra_metadata('help_text') %])[% END ~%]
</option>
diff --git a/templates/web/base/report/new/category_extras_fields.html b/templates/web/base/report/new/category_extras_fields.html
index 2c728481c..85373a0cf 100644
--- a/templates/web/base/report/new/category_extras_fields.html
+++ b/templates/web/base/report/new/category_extras_fields.html
@@ -21,6 +21,8 @@
<option value="[% option.key %]"[% IF option.key == report_meta.$x_meta_name.value %] selected[% END %]>[% option.name %]</option>
[% END %]
</select>
+ [% ELSIF meta.datatype == 'text' %]
+ <textarea class="form-control" name="[% cat_prefix %][% meta_name %]" id="[% cat_prefix %]form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]>[% report_meta.$x_meta_name.value %]</textarea>
[% ELSE %]
<input class="form-control" type="[% meta.fieldtype OR 'text' %]" value="[% report_meta.$x_meta_name.value | html %]" name="[% cat_prefix %][% meta_name %]" id="[% cat_prefix %]form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]>
[% END %]
diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html
index 3b28d4aa7..33dd5769e 100644
--- a/templates/web/base/report/new/form_report.html
+++ b/templates/web/base/report/new/form_report.html
@@ -89,5 +89,6 @@
<input type="hidden" id="single_body_only" name="single_body_only" value="">
<input type="hidden" id="do_not_send" name="do_not_send" value="">
<input type="hidden" name="submit_problem" value="1">
+ <input type="hidden" id="form_service" name="service" value="">
</div>
<!-- /report/new/form_report.html -->
diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html
index 0d259e695..9215e7d59 100644
--- a/templates/web/base/report/new/form_user_loggedin.html
+++ b/templates/web/base/report/new/form_user_loggedin.html
@@ -37,6 +37,9 @@
[% IF c.user.email_verified %]
<label for="form_username">[% loc('Email address') %]<span class="hidden"> [% loc('(optional)') %]</span></label>
+ [% IF field_errors.username_register %]
+ <p class='form-error'>[% field_errors.username_register %]</p>
+ [% END %]
<input class="form-control" id="form_username" name="username"
[%- IF NOT can_contribute_as_another_user -%]
disabled
@@ -64,11 +67,12 @@
[% IF c.user.has_permission_to("report_inspect", bodies_ids) OR c.user.has_permission_to("report_mark_private", bodies_ids) %]
<div class="checkbox-group">
<input type="checkbox" name="non_public" id="form_non_public" value="1"
- [%~ ' checked' IF report.non_public OR non_public_categories.$category %]
- [%~ ' disabled' IF non_public_categories.$category %]>
+ [%~ SET category_safe = mark_safe(category) %]
+ [%~ ' checked' IF report.non_public OR non_public_categories.$category_safe %]
+ [%~ ' disabled' IF non_public_categories.$category_safe %]>
<label class="inline" for="form_non_public">[% loc('Private') %] </label>
</div>
[% END %]
-<input class="btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]">
+[% PROCESS 'report/form/submit.html' %]
<!-- /report/new/form_user_loggedin.html -->
diff --git a/templates/web/base/report/new/login_success_form.html b/templates/web/base/report/new/login_success_form.html
index 32c414bda..7ef896910 100644
--- a/templates/web/base/report/new/login_success_form.html
+++ b/templates/web/base/report/new/login_success_form.html
@@ -14,6 +14,6 @@
[% PROCESS "report/form/user_loggedout.html" type='report' object=report %]
[% END %]
[% PROCESS 'report/new/form_report.html' %]
- <input class="btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]">
+ [% PROCESS 'report/form/submit.html' %]
</div>
</fieldset>
diff --git a/templates/web/base/report/new/oauth_email_form.html b/templates/web/base/report/new/oauth_email_form.html
index a0adbe563..126f93409 100644
--- a/templates/web/base/report/new/oauth_email_form.html
+++ b/templates/web/base/report/new/oauth_email_form.html
@@ -17,6 +17,6 @@
<input type="hidden" name="oauth_need_email" value="1">
[% PROCESS 'report/new/form_report.html' %]
- <input class="btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]">
+ [% PROCESS 'report/form/submit.html' %]
</div>
</fieldset>
diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html
index ca9397bd4..3b1f092ef 100644
--- a/templates/web/base/report/update.html
+++ b/templates/web/base/report/update.html
@@ -35,7 +35,7 @@
[% INCLUDE 'report/photo.html' object=update %]
<div class="item-list__update-text">
<div class="moderate-display">
- [% update.text | add_links | markup(update.user) | html_para %]
+ [% update.text | staff_html_markup(update.extra) %]
</div>
[% IF can_moderate %]
<div class="moderate-edit">
@@ -43,7 +43,7 @@
<label><input type="checkbox" name="update_revert_text" class="revert-textarea">
[% loc('Revert to original') %]</label>
[% END %]
- <textarea class="form-control" name="update_text">[% update.text | add_links %]</textarea>
+ <textarea class="form-control" name="update_text">[% update.text %]</textarea>
</div>
[% END %]
diff --git a/templates/web/base/report/update/form_state_checkbox.html b/templates/web/base/report/update/form_state_checkbox.html
index 5316affb9..b65df72b7 100644
--- a/templates/web/base/report/update/form_state_checkbox.html
+++ b/templates/web/base/report/update/form_state_checkbox.html
@@ -1,5 +1,7 @@
[% IF (problem.is_fixed OR problem.is_closed) AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %]
+ [% RETURN IF c.cobrand.reopening_disallowed(problem) ~%]
+
<input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF (update.mark_open || c.req.params.reopen) %]>
[% IF problem.is_closed %]
<label class="inline" for="form_reopen">[% loc('This problem is still ongoing') %]</label>
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index ff4612840..7132331bc 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -1,35 +1,12 @@
<input type="hidden" name="submit_update" value="1">
<input type="hidden" name="id" value="[% problem.id | html %]">
-[% IF c.cobrand.allow_photo_upload %]
- <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
- <label for="form_photo">
- <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span>
- </label>
-
- [% IF field_errors.photo %]
- <p class='form-error'>[% field_errors.photo %]</p>
- [% END %]
-
- <div id="form_photos">
- [% IF upload_fileid %]
- <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
- [% FOREACH id IN upload_fileid.split(',') %]
- <img align="right" src="/photo/temp.[% id %]" alt="">
- [% END %]
- [% END %]
- <input type="file" name="photo1" id="form_photo">
- <label for="form_photo2">[% loc('Photo') %]</label>
- <input type="file" name="photo2" id="form_photo2">
- <label for="form_photo3">[% loc('Photo') %]</label>
- <input type="file" name="photo3" id="form_photo3">
- </div>
-[% END %]
+[% INCLUDE report/form/photo_upload.html %]
[% TRY %][% PROCESS 'report/update/before_update.html' %][% CATCH file %][% END %]
<label for="form_update">[% loc( 'Update' ) %]</label>
-[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
+[% IF relevant_staff_user %]
[% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
[% END %]
[% IF field_errors.update %]
@@ -37,7 +14,7 @@
[% END %]
<textarea rows="7" cols="30" name="update" class="form-control" id="form_update" required>[% update.text | html %]</textarea>
-[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
+[% IF relevant_staff_user %]
<label for="state">[% loc( 'State' ) %]</label>
[% INCLUDE 'report/inspect/state_groups_select.html' %]
[% ELSE %]
diff --git a/templates/web/base/report/update/form_user_loggedin.html b/templates/web/base/report/update/form_user_loggedin.html
index bec783bb4..02e7de51f 100644
--- a/templates/web/base/report/update/form_user_loggedin.html
+++ b/templates/web/base/report/update/form_user_loggedin.html
@@ -4,9 +4,9 @@
[% PROCESS 'user/_anonymity.html' anonymous = update.anonymous %]
- [% can_contribute_as_another_user = c.user.has_permission_to("contribute_as_another_user", problem.bodies_str_ids) %]
- [% can_contribute_as_anonymous_user = c.user.has_permission_to("contribute_as_anonymous_user", problem.bodies_str_ids) %]
- [% can_contribute_as_body = c.user.from_body AND c.user.has_permission_to("contribute_as_body", problem.bodies_str_ids) %]
+ [% can_contribute_as_another_user = permissions.contribute_as_another_user %]
+ [% can_contribute_as_anonymous_user = permissions.contribute_as_anonymous_user %]
+ [% can_contribute_as_body = c.user.from_body AND permissions.contribute_as_body %]
[% IF can_contribute_as_another_user OR can_contribute_as_body OR can_contribute_as_anonymous_user %]
<label for="form_as">[% loc('Provide update as') %]</label>
@@ -23,6 +23,9 @@
[% END %]
</select>
<label for="form_username">[% loc('Email address') %]</label>
+ [% IF field_errors.username_register %]
+ <p class='form-error'>[% field_errors.username_register %]</p>
+ [% END %]
<input class="form-control" name="username" id="form_username" type="text" value="[% c.user.email | html %]">
[% END %]
@@ -35,5 +38,7 @@
<label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
</div>
-<div class="clearfix"><input class="btn btn--primary btn--block btn--final js-submit_register" type="submit" name="submit_register" value="[% loc('Post') %]"></div>
+<div class="clearfix">
+ [% PROCESS 'report/form/submit.html' %]
+</div>
<!-- /report/update/form_user_loggedin.html -->
diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html
index 93bae4d64..d65f1a287 100644
--- a/templates/web/base/report/updates.html
+++ b/templates/web/base/report/updates.html
@@ -27,6 +27,6 @@
[% RETURN %]
[% END %]
- [% update.meta_line(c) %]
+ [% update.meta_line(c.user) %]
[% END %]