aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-06 15:22:15 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-08 09:30:53 +0000
commitf90c524fb9f633f706f9e06262cf415382b5f650 (patch)
tree9e1657f3f8afe9bc4be46e11f9b856790e292289
parentc5cb5b7bc7f0c2cd10939bcbe0bdfdaed0543329 (diff)
[Bromley] Tidy up some form templates.
-rw-r--r--templates/web/base/report/update/form_update.html2
-rw-r--r--templates/web/bromley/report/update-form.html30
-rw-r--r--templates/web/bromley/report/update/before_update.html9
-rw-r--r--templates/web/bromley/report/update/form_update.html53
-rw-r--r--templates/web/bromley/report/update/form_user.html22
-rw-r--r--templates/web/bromley/report/updates-sidebar-notes.html0
6 files changed, 33 insertions, 83 deletions
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index fb79232a2..ff4612840 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -26,6 +26,8 @@
</div>
[% END %]
+[% 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)) %]
[% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
diff --git a/templates/web/bromley/report/update-form.html b/templates/web/bromley/report/update-form.html
deleted file mode 100644
index 9d589bc93..000000000
--- a/templates/web/bromley/report/update-form.html
+++ /dev/null
@@ -1,30 +0,0 @@
-[% allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_body) %]
-[% RETURN IF NOT allow_creation OR problem.extra.closed_updates %]
-
-<div id="update_form">
- [% UNLESS hide_header %]
- <h2[% IF two_column_sidebar %] class="hidden-js"[% END %]>[% loc('Provide an update') %]</h2>
- [% END %]
-
- [% INCLUDE 'errors.html' %]
-
- <form method="post" action="[% c.uri_for( '/report/update' ) %]" id="form_update_form" name="updateForm" class="validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]>
- <input type="hidden" name="token" value="[% csrf_token %]">
- <fieldset>
- [% IF NOT login_success AND NOT oauth_need_email %]
- <div class="js-new-report-user-hidden">
- [% INCLUDE 'report/update/form_update.html' %]
- </div>
- [% END %]
- [% PROCESS "report/update/form_user.html" %]
-
- <p>Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>.</p>
-
- [% IF login_success OR oauth_need_email %]
- <div class="js-new-report-user-hidden">
- [% INCLUDE 'report/update/form_update.html' %]
- </div>
- [% END %]
- </fieldset>
- </form>
-</div>
diff --git a/templates/web/bromley/report/update/before_update.html b/templates/web/bromley/report/update/before_update.html
new file mode 100644
index 000000000..35367bb86
--- /dev/null
+++ b/templates/web/bromley/report/update/before_update.html
@@ -0,0 +1,9 @@
+<div class="general-notes">
+ <p>Please note that new and separate occurrences of issues
+ should be logged as new reports, to avoid conflicting
+ information or updates and ensure the information is passed
+ promptly to our teams. Please log any new issue via
+ <a href="https://www.bromley.gov.uk/report">https://www.bromley.gov.uk/report</a>
+ using the map marker and description to detail where the issue
+ is located.</p>
+</div>
diff --git a/templates/web/bromley/report/update/form_update.html b/templates/web/bromley/report/update/form_update.html
deleted file mode 100644
index 01e069dfc..000000000
--- a/templates/web/bromley/report/update/form_update.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<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 %]
-
-<div class="general-notes">
- <p>Please note that new and separate occurrences of issues
- should be logged as new reports, to avoid conflicting
- information or updates and ensure the information is passed
- promptly to our teams. Please log any new issue via
- <a href="https://www.bromley.gov.uk/report">https://www.bromley.gov.uk/report</a>
- using the map marker and description to detail where the issue
- is located.</p>
-</div>
-
-<label for="form_update">[% loc( 'Update' ) %]</label>
-[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
- [% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
-[% END %]
-[% IF field_errors.update %]
- <div class='form-error'>[% field_errors.update %]</div>
-[% 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)) %]
- <label for="state">[% loc( 'State' ) %]</label>
- [% INCLUDE 'report/inspect/state_groups_select.html' %]
-[% ELSE %]
- [% INCLUDE report/update/form_state_checkbox.html %]
-[% END %]
diff --git a/templates/web/bromley/report/update/form_user.html b/templates/web/bromley/report/update/form_user.html
new file mode 100644
index 000000000..c8df54c46
--- /dev/null
+++ b/templates/web/bromley/report/update/form_user.html
@@ -0,0 +1,22 @@
+<!-- report/update/form_user.html -->
+[% PROCESS 'report/form/user.html' %]
+
+<div class="hidden-js js-new-report-user-shown">
+ <div class="hidden-nojs form-section-preview">
+ <h2 class="form-section-heading">[% loc('Your update') %]</h2>
+ <p class="js-form-section-preview" data-source="#form_update"></p>
+ <button class="btn btn--block js-new-report-user-hide">[% loc('Edit your update') %]</button>
+ </div>
+
+ [% IF c.user_exists %]
+ [% PROCESS "report/update/form_user_loggedin.html" %]
+ [% ELSE %]
+ [% PROCESS "report/form/user_loggedout.html" type='update' object=update %]
+ [% END %]
+
+</div>
+
+[%# Same as parent apart from this line %]
+<p>Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>.</p>
+
+<!-- /report/update/form_user.html -->
diff --git a/templates/web/bromley/report/updates-sidebar-notes.html b/templates/web/bromley/report/updates-sidebar-notes.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/templates/web/bromley/report/updates-sidebar-notes.html