diff options
-rw-r--r-- | templates/web/base/report/new/form_report.html | 11 | ||||
-rw-r--r-- | templates/web/base/report/new/form_title.html | 7 | ||||
-rw-r--r-- | templates/web/base/report/update/form_state_checkbox.html | 17 | ||||
-rw-r--r-- | templates/web/base/report/update/form_update.html | 18 |
4 files changed, 28 insertions, 25 deletions
diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html index 3c7012348..d6efac423 100644 --- a/templates/web/base/report/new/form_report.html +++ b/templates/web/base/report/new/form_report.html @@ -17,13 +17,7 @@ [% END %] </div> - [% DEFAULT form_title = loc('Summarise the problem') %] - <label for="form_title">[% form_title %]</label> -[% IF field_errors.title %] - <p class='form-error'>[% field_errors.title %]</p> -[% END %] - [% DEFAULT form_title_placeholder = loc('10 inch pothole on Example St, near post box') %] - <input class="form-control" type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% form_title_placeholder %]" required> + [% INCLUDE 'report/new/form_title.html' %] [% TRY %][% PROCESS 'report/new/after_title.html' %][% CATCH file %][% END %] @@ -54,7 +48,8 @@ [% TRY %][% PROCESS 'report/new/after_photo.html' %][% CATCH file %][% END %] - <label for="form_detail">[% loc('Explain what’s wrong') %]</label> + [% DEFAULT form_detail_label = loc('Explain what’s wrong') %] + <label for="form_detail">[% form_detail_label %]</label> [% IF field_errors.detail %] <p class='form-error'>[% field_errors.detail %]</p> [% END %] diff --git a/templates/web/base/report/new/form_title.html b/templates/web/base/report/new/form_title.html new file mode 100644 index 000000000..88996fd3f --- /dev/null +++ b/templates/web/base/report/new/form_title.html @@ -0,0 +1,7 @@ +[% DEFAULT form_title = loc('Summarise the problem') %] +<label for="form_title">[% form_title %]</label> +[% IF field_errors.title %] + <p class='form-error'>[% field_errors.title %]</p> +[% END %] +[% DEFAULT form_title_placeholder = loc('10 inch pothole on Example St, near post box') %] +<input class="form-control" type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% form_title_placeholder %]" required> diff --git a/templates/web/base/report/update/form_state_checkbox.html b/templates/web/base/report/update/form_state_checkbox.html new file mode 100644 index 000000000..5316affb9 --- /dev/null +++ b/templates/web/base/report/update/form_state_checkbox.html @@ -0,0 +1,17 @@ +[% IF (problem.is_fixed OR problem.is_closed) AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %] + + <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> + [% ELSE %] + <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label> + [% END %] + +[% ELSIF !problem.is_fixed AND has_fixed_state %] + + <div class="checkbox-group"> + <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> + <label class="inline" for="form_fixed">[% loc('This problem has been fixed') %]</label> + </div> + +[% END %] diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index 5a1b3b602..06104c9e9 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -39,21 +39,5 @@ <label for="state">[% loc( 'State' ) %]</label> [% INCLUDE 'report/inspect/state_groups_select.html' %] [% ELSE %] - [% IF (problem.is_fixed OR problem.is_closed) AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %] - - <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> - [% ELSE %] - <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label> - [% END %] - - [% ELSIF !problem.is_fixed AND has_fixed_state %] - - <div class="checkbox-group"> - <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> - <label class="inline" for="form_fixed">[% loc('This problem has been fixed') %]</label> - </div> - - [% END %] + [% INCLUDE report/update/form_state_checkbox.html %] [% END %] |