aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-01-13 18:07:20 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-01-22 17:21:40 +0000
commit2854503286a7dbb9e3098469d508b1a4d37362ef (patch)
treeae92859832848b82ea87096fcd127bed448b5454
parent1c40be1f4b5a00fd6da081225b04efad228f8025 (diff)
Create some subtemplates for future use.
-rw-r--r--templates/web/base/report/display.html51
-rw-r--r--templates/web/base/report/display_tools.html49
-rw-r--r--templates/web/base/report/new/fill_in_details.html4
-rw-r--r--templates/web/base/report/new/fill_in_details_form.html117
-rw-r--r--templates/web/base/report/new/form_report.html66
-rw-r--r--templates/web/base/report/new/form_user_loggedout.html77
-rw-r--r--templates/web/base/report/new/form_user_loggedout_by_email.html41
-rw-r--r--templates/web/base/report/new/form_user_loggedout_email.html7
-rw-r--r--templates/web/base/report/new/form_user_loggedout_password.html24
-rw-r--r--templates/web/base/report/update-form.html148
-rw-r--r--templates/web/base/report/update/form_name.html21
-rw-r--r--templates/web/base/report/update/form_update.html59
-rw-r--r--templates/web/base/report/update/form_user_loggedout.html8
-rw-r--r--templates/web/base/report/update/form_user_loggedout_by_email.html17
-rw-r--r--templates/web/base/report/update/form_user_loggedout_email.html7
-rw-r--r--templates/web/base/report/update/form_user_loggedout_password.html23
16 files changed, 359 insertions, 360 deletions
diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html
index 5f499dd6e..8d4cc931e 100644
--- a/templates/web/base/report/display.html
+++ b/templates/web/base/report/display.html
@@ -21,56 +21,7 @@
[% INCLUDE 'report/_main.html' %]
[% TRY %][% INCLUDE 'report/_message_manager.html' %][% CATCH file %][% END %]
-
-<div class="shadow-wrap">
- <ul id="key-tools">
- [% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( c.cobrand.council_id ) %]
- <li><form method="post" action="/report/delete/[% problem.id %]" id="remove-from-site-form">
- <input type="submit" id="key-tool-report-abuse" class="abuse" value="Remove from site">
- </form></li>
- [% ELSIF c.cobrand.moniker != 'zurich' %]
- <li><a rel="nofollow" id="key-tool-report-abuse" class="abuse" href="[% c.uri_for( '/contact', { id => problem.id } ) %]">[% loc('Report abuse' ) %]</a></li>
- [% END %]
- [% IF c.cobrand.moniker != 'zurich' %]
- <li><a rel="nofollow" id="key-tool-report-updates" class="feed" href="[% c.uri_for( '/alert/subscribe', { id => problem.id } ) %]">[% loc('Get updates' ) %]</a></li>
- [% END %]
- [% IF c.cobrand.moniker == 'fixmystreet' %]
- <li><a rel="nofollow" id="key-tool-report-share" class="share" href="#report-share">[% loc('Share') %]</a></li>
- [% END %]
- [% IF c.cobrand.moniker == 'zurich' %]
- <li><a class="chevron" id="key-tool-problems-nearby" href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'Problems on the map' ) %]</a></li>
- [% ELSE %]
- <li><a class="chevron" id="key-tool-problems-nearby" href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'Problems nearby' ) %]</a></li>
- [% END %]
- </ul>
-
-[% IF c.cobrand.moniker == 'fixmystreet' %]
- <div id="report-share" class="hidden-js" align="center">
- <a href="https://twitter.com/share" class="twitter-share-button" data-text="I just reported &lsquo;[% problem.title_safe | html %]&rsquo;" data-via="fixmystreet" data-related="mysociety" data-count="none" data-dnt="true">Tweet</a>
-<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
- <iframe src="//www.facebook.com/plugins/like.php?href=[% c.req.uri | uri %]&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
- </div>
-[% END %]
-
-<div id="report-updates-data" class="hidden-js">
- <form action="[% c.uri_for( '/alert/subscribe' ) %]" method="post">
- <a href="[% c.uri_for( '/rss', problem.id ) %]">
- <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>
- <p>[% loc('Receive email when updates are left on this problem.' ) %]</p>
- <fieldset>
- <label class="hidden n" for="alert_rznvy">[% loc('Your email') %]</label>
- <div class="form-txt-submit-box">
- <input type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30" placeholder="[% loc('Your email') %]">
- <input class="green-btn" type="submit" value="[% loc('Subscribe') %]">
- </div>
- <input type="hidden" name="id" value="[% problem.id %]">
- <input type="hidden" name="type" value="updates">
- </fieldset>
- </form>
-</div>
-
-</div>
+[% INCLUDE 'report/display_tools.html' %]
[% TRY %][% INCLUDE 'report/sharing.html' %][% CATCH file %][% END %]
[% INCLUDE 'report/updates.html' %]
diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html
new file mode 100644
index 000000000..004ae29e5
--- /dev/null
+++ b/templates/web/base/report/display_tools.html
@@ -0,0 +1,49 @@
+<div class="shadow-wrap">
+ <ul id="key-tools">
+ [% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( c.cobrand.council_id ) %]
+ <li><form method="post" action="/report/delete/[% problem.id %]" id="remove-from-site-form">
+ <input type="submit" id="key-tool-report-abuse" class="abuse" value="Remove from site">
+ </form></li>
+ [% ELSIF c.cobrand.moniker != 'zurich' %]
+ <li><a rel="nofollow" id="key-tool-report-abuse" class="abuse" href="[% c.uri_for( '/contact', { id => problem.id } ) %]">[% loc('Report abuse' ) %]</a></li>
+ [% END %]
+ [% IF c.cobrand.moniker != 'zurich' %]
+ <li><a rel="nofollow" id="key-tool-report-updates" class="feed" href="[% c.uri_for( '/alert/subscribe', { id => problem.id } ) %]">[% loc('Get updates' ) %]</a></li>
+ [% END %]
+ [% IF c.cobrand.moniker == 'fixmystreet' %]
+ <li><a rel="nofollow" id="key-tool-report-share" class="share" href="#report-share">[% loc('Share') %]</a></li>
+ [% END %]
+ [% IF c.cobrand.moniker == 'zurich' %]
+ <li><a class="chevron" id="key-tool-problems-nearby" href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'Problems on the map' ) %]</a></li>
+ [% ELSE %]
+ <li><a class="chevron" id="key-tool-problems-nearby" href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'Problems nearby' ) %]</a></li>
+ [% END %]
+ </ul>
+
+[% IF c.cobrand.moniker == 'fixmystreet' %]
+ <div id="report-share" class="hidden-js" align="center">
+ <a href="https://twitter.com/share" class="twitter-share-button" data-text="I just reported &lsquo;[% problem.title_safe | html %]&rsquo;" data-via="fixmystreet" data-related="mysociety" data-count="none" data-dnt="true">Tweet</a>
+<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ <iframe src="//www.facebook.com/plugins/like.php?href=[% c.req.uri | uri %]&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
+ </div>
+[% END %]
+
+<div id="report-updates-data" class="hidden-js">
+ <form action="[% c.uri_for( '/alert/subscribe' ) %]" method="post">
+ <a href="[% c.uri_for( '/rss', problem.id ) %]">
+ <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>
+ <p>[% loc('Receive email when updates are left on this problem.' ) %]</p>
+ <fieldset>
+ <label class="hidden n" for="alert_rznvy">[% loc('Your email') %]</label>
+ <div class="form-txt-submit-box">
+ <input type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30" placeholder="[% loc('Your email') %]">
+ <input class="green-btn" type="submit" value="[% loc('Subscribe') %]">
+ </div>
+ <input type="hidden" name="id" value="[% problem.id %]">
+ <input type="hidden" name="type" value="updates">
+ </fieldset>
+ </form>
+</div>
+
+</div>
diff --git a/templates/web/base/report/new/fill_in_details.html b/templates/web/base/report/new/fill_in_details.html
index 9d3f52041..9859fa4fd 100644
--- a/templates/web/base/report/new/fill_in_details.html
+++ b/templates/web/base/report/new/fill_in_details.html
@@ -37,7 +37,9 @@
<p class='form-success'>[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]</p>
[% END %]
- [% PROCESS 'report/new/fill_in_details_form.html' %]
+ <div id="report-a-problem-main">
+ [% PROCESS 'report/new/fill_in_details_form.html' %]
+ </div>
</div>
</form>
diff --git a/templates/web/base/report/new/fill_in_details_form.html b/templates/web/base/report/new/fill_in_details_form.html
index ae5586127..cd8a0d814 100644
--- a/templates/web/base/report/new/fill_in_details_form.html
+++ b/templates/web/base/report/new/fill_in_details_form.html
@@ -1,11 +1,10 @@
-<div id="report-a-problem-main">
- <h1>[% loc('Report your problem') %]</h1>
+<h1>[% loc('Report your problem') %]</h1>
- [% IF report.used_map %]
+[% IF report.used_map %]
<p class="change_location">[% loc('Wrong location? Just click again on the map.') %]</p>
- [% END %]
+[% END %]
- [% IF js %]
+[% IF js %]
<p id="councils_text">
[% tprintf(
loc('All the information you provide here will be sent to <strong>%s</strong>.'),
@@ -13,93 +12,25 @@
); %]
[% loc('The summary and description will also be made public (see our <a href="/privacy">privacy policy</a>).') %]
</p>
- [% ELSE %]
- [% PROCESS 'report/new/councils_text.html' %]
- [% END %]
+[% ELSE %]
+ [% PROCESS 'report/new/councils_text.html' %]
+[% END %]
- [% IF report.used_map && partial_token %]
+[% IF report.used_map && partial_token %]
<p id="unknown">[% loc('Please note your report has <strong>not yet been sent</strong>. Choose a category and add further information below, then submit.') %]</p>
- [% END %]
-
- [% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %]
-
- [% INCLUDE 'errors.html' %]
-
- <fieldset>
- <div id="problem_form">
-
- [% INCLUDE 'report/new/form_heading.html' %]
-
- [% IF field_errors.bodies %]
- <p class='form-error'>[% field_errors.bodies %]</p>
- [% END %]
-
- [% TRY %]
- [%# Useful for amending form contents based on category selection %]
- [% PROCESS 'report/new/category_at_top.html' %]
- [% need_to_show_category_selector = 0 %]
- [% CATCH file %]
- [% need_to_show_category_selector = 1 %]
- [% END %]
-
- <label for="form_title">[% loc('One-line summary') %] [% INCLUDE 'report/public_label.html' %]</label>
- [% IF field_errors.title %]
- <p class='form-error'>[% field_errors.title %]</p>
- [% END %]
- <input type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% loc('What’s the issue, and where is it?') %]" required>
-
- [% IF c.cobrand.allow_photo_upload %]
- <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
- <label for="form_photo">[% loc('Photo') %]
- [% INCLUDE 'report/public_label.html' %]</label>
-
- [% IF field_errors.photo %]
- <p class='form-error'>[% field_errors.photo %]</p>
- [% END %]
-
- <div id="form_photos">
- [% IF upload_fileid %]
- <script>
- fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
- </script>
- <p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
- [% FOREACH id IN upload_fileid.split(',') %]
- <img align="right" src="/photo/[% id %].temp.jpeg" alt="">
- [% END %]
- [% END %]
- <input type="file" name="photo1" id="form_photo">
- <input type="file" name="photo2" id="form_photo2">
- <input type="file" name="photo3" id="form_photo3">
- </div>
- [% END %]
-
- [% TRY %][% PROCESS 'report/new/after_photo.html' %][% CATCH file %][% END %]
-
- <label for="form_detail">[% loc('Description') %] [% INCLUDE 'report/public_label.html' %]</label>
- [% IF field_errors.detail %]
- <p class='form-error'>[% field_errors.detail %]</p>
- [% END %]
- <textarea rows="7" cols="26" name="detail" id="form_detail" placeholder="[% loc('Explain what’s wrong, exactly where it is, and how long it’s been there…') %]" required>[% report.detail | html %]</textarea>
-
- [% TRY %][% PROCESS 'report/new/inline-tips.html' %][% CATCH file %][% END %]
-
- [% IF need_to_show_category_selector %]
- [% PROCESS "report/new/category_wrapper.html" %]
- [% END %]
-
- [% TRY %][% PROCESS 'report/new/after_category.html' %][% CATCH file %][% END %]
-
- [% IF c.user_exists %]
- [% PROCESS "report/new/form_user_loggedin.html" %]
- [% ELSE %]
- [% PROCESS "report/new/form_user_loggedout.html" %]
- [% END %]
- </div>
- </fieldset>
-
- [% IF partial_token %]
- <input type="hidden" name="partial" value="[% partial_token.token %]">
- [% END %]
-
- <input type="hidden" name="submit_problem" value="1">
-</div>
+[% END %]
+
+[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %]
+
+[% INCLUDE 'errors.html' %]
+
+<fieldset>
+ <div id="problem_form">
+ [% PROCESS 'report/new/form_report.html' %]
+ [% IF c.user_exists %]
+ [% PROCESS "report/new/form_user_loggedin.html" %]
+ [% ELSE %]
+ [% PROCESS "report/new/form_user_loggedout.html" %]
+ [% END %]
+ </div>
+</fieldset>
diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html
new file mode 100644
index 000000000..819286ea7
--- /dev/null
+++ b/templates/web/base/report/new/form_report.html
@@ -0,0 +1,66 @@
+[% INCLUDE 'report/new/form_heading.html' %]
+
+[% IF field_errors.bodies %]
+ <p class='form-error'>[% field_errors.bodies %]</p>
+[% END %]
+
+[% TRY %]
+ [%# Useful for amending form contents based on category selection %]
+ [% PROCESS 'report/new/category_at_top.html' %]
+ [% need_to_show_category_selector = 0 %]
+[% CATCH file %]
+ [% need_to_show_category_selector = 1 %]
+[% END %]
+
+ <label for="form_title">[% loc('One-line summary') %] [% INCLUDE 'report/public_label.html' %]</label>
+[% IF field_errors.title %]
+ <p class='form-error'>[% field_errors.title %]</p>
+[% END %]
+ <input type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% loc('What’s the issue, and where is it?') %]" required>
+
+[% IF c.cobrand.allow_photo_upload %]
+ <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
+ <label for="form_photo">[% loc('Photo') %]
+ [% INCLUDE 'report/public_label.html' %]</label>
+
+ [% IF field_errors.photo %]
+ <p class='form-error'>[% field_errors.photo %]</p>
+ [% END %]
+
+ <div id="form_photos">
+ [% IF upload_fileid %]
+ <script>
+ fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
+ </script>
+ <p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
+ [% FOREACH id IN upload_fileid.split(',') %]
+ <img align="right" src="/photo/[% id %].temp.jpeg" alt="">
+ [% END %]
+ [% END %]
+ <input type="file" name="photo1" id="form_photo">
+ <input type="file" name="photo2" id="form_photo2">
+ <input type="file" name="photo3" id="form_photo3">
+ </div>
+[% END %]
+
+[% TRY %][% PROCESS 'report/new/after_photo.html' %][% CATCH file %][% END %]
+
+ <label for="form_detail">[% loc('Description') %] [% INCLUDE 'report/public_label.html' %]</label>
+[% IF field_errors.detail %]
+ <p class='form-error'>[% field_errors.detail %]</p>
+[% END %]
+ <textarea rows="7" cols="26" name="detail" id="form_detail" placeholder="[% loc('Explain what’s wrong, exactly where it is, and how long it’s been there…') %]" required>[% report.detail | html %]</textarea>
+
+[% TRY %][% PROCESS 'report/new/inline-tips.html' %][% CATCH file %][% END %]
+
+[% IF need_to_show_category_selector %]
+ [% PROCESS "report/new/category_wrapper.html" %]
+[% END %]
+
+[% TRY %][% PROCESS 'report/new/after_category.html' %][% CATCH file %][% END %]
+
+[% IF partial_token %]
+ <input type="hidden" name="partial" value="[% partial_token.token %]">
+[% END %]
+
+ <input type="hidden" name="submit_problem" value="1">
diff --git a/templates/web/base/report/new/form_user_loggedout.html b/templates/web/base/report/new/form_user_loggedout.html
index c5a58e8a9..5f2f473df 100644
--- a/templates/web/base/report/new/form_user_loggedout.html
+++ b/templates/web/base/report/new/form_user_loggedout.html
@@ -1,79 +1,8 @@
-<label for="form_email">[% loc('Your email') %]
- <span class="muted">([% loc('We never show your email') %])</span>
-</label>
-[% IF field_errors.email %]
- <p class='form-error'>[% field_errors.email %]</p>
-[% END %]
-<input type="email" value="[% report.user.email | html %]" name="email" id="form_email" placeholder="[% loc('Please enter your email address') %]" required>
+[% PROCESS 'report/new/form_user_loggedout_email.html' %]
<div id="form_sign_in">
<h3>[% loc("Now to submit your report&hellip;") %]</h3>
<h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2>
-
- <div id="form_sign_in_yes" class="form-box">
-
- <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>
-
- <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label>
- [% IF field_errors.password %]
- <p class='form-error'>[% field_errors.password %]</p>
- [% END %]
- <div class="form-txt-submit-box">
- <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value="">
- <input class="green-btn" type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]">
- </div>
-
- <div class="checkbox-group">
- <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
- <label class="n inline" for="remember_me">[% loc('Keep me signed in on this computer') %]</label>
- </div>
-
- <div class="general-notes">
- <p><strong>[% loc('Forgotten your password?') %]</strong>
- [% loc('Confirm by email below, providing a new password at that point. When you confirm, your password will be updated.') %]</p>
- </div>
-
- </div>
-
- <div id="form_sign_in_no" class="form-box">
- <h5>[% loc('<strong>No</strong> Let me confirm my report by email') %]</h5>
-
- [% INCLUDE 'report/new/extra_name.html' %]
-
- [% name_public = report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]
- <label for="form_name">[% loc('Name') %]
- [% TRY %]
- [% INCLUDE 'report/new/after_name.html' %]
- [% CATCH file %]
- [% END %]
- </label>
- [% IF field_errors.name %]
- <p class='form-error'>[% field_errors.name %]</p>
- [% END %]
-
- <input type="text" class="form-focus-trigger validName" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]">
-
- [%# if there is nothing in the name field then set check box as default on form %]
- <div class="checkbox-group">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF name_public %]>
- <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
- </div>
-
- <label class="form-focus-hidden" for="form_phone">[% loc('Phone number (optional)') %]</label>
- <input class="form-focus-hidden" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]">
- <div class="general-notes form-focus-hidden">
- <p>[% loc('We never show your email address or phone number.') %]</p>
- </div>
-
- <label class="form-focus-hidden" for="password_register">[% loc('Password (optional)') %]</label>
-
- <div class="general-notes form-focus-hidden">
- <p>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p>
- </div>
-
- <div class="form-txt-submit-box form-focus-hidden">
- <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]">
- <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]">
- </div>
- </div>
+ [% PROCESS 'report/new/form_user_loggedout_password.html' %]
+ [% PROCESS 'report/new/form_user_loggedout_by_email.html' %]
</div>
diff --git a/templates/web/base/report/new/form_user_loggedout_by_email.html b/templates/web/base/report/new/form_user_loggedout_by_email.html
new file mode 100644
index 000000000..a3e36dfa3
--- /dev/null
+++ b/templates/web/base/report/new/form_user_loggedout_by_email.html
@@ -0,0 +1,41 @@
+<div id="form_sign_in_no" class="form-box">
+ <h5>[% loc('<strong>No</strong> Let me confirm my report by email') %]</h5>
+
+ [% INCLUDE 'report/new/extra_name.html' %]
+
+ [% name_public = report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]
+ <label for="form_name">[% loc('Name') %]
+ [% TRY %]
+ [% INCLUDE 'report/new/after_name.html' %]
+ [% CATCH file %]
+ [% END %]
+ </label>
+ [% IF field_errors.name %]
+ <p class='form-error'>[% field_errors.name %]</p>
+ [% END %]
+
+ <input type="text" class="form-focus-trigger validName" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]">
+
+ [%# if there is nothing in the name field then set check box as default on form %]
+ <div class="checkbox-group">
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF name_public %]>
+ <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
+ </div>
+
+ <label class="form-focus-hidden" for="form_phone">[% loc('Phone number (optional)') %]</label>
+ <input class="form-focus-hidden" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]">
+ <div class="general-notes form-focus-hidden">
+ <p>[% loc('We never show your email address or phone number.') %]</p>
+ </div>
+
+ <label class="form-focus-hidden" for="password_register">[% loc('Password (optional)') %]</label>
+
+ <div class="general-notes form-focus-hidden">
+ <p>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p>
+ </div>
+
+ <div class="form-txt-submit-box form-focus-hidden">
+ <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]">
+ <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]">
+ </div>
+</div>
diff --git a/templates/web/base/report/new/form_user_loggedout_email.html b/templates/web/base/report/new/form_user_loggedout_email.html
new file mode 100644
index 000000000..d7a1790e2
--- /dev/null
+++ b/templates/web/base/report/new/form_user_loggedout_email.html
@@ -0,0 +1,7 @@
+<label for="form_email">[% loc('Your email') %]
+ <span class="muted">([% loc('We never show your email') %])</span>
+</label>
+[% IF field_errors.email %]
+ <p class='form-error'>[% field_errors.email %]</p>
+[% END %]
+<input type="email" value="[% report.user.email | html %]" name="email" id="form_email" placeholder="[% loc('Please enter your email address') %]" required>
diff --git a/templates/web/base/report/new/form_user_loggedout_password.html b/templates/web/base/report/new/form_user_loggedout_password.html
new file mode 100644
index 000000000..c9d65e43e
--- /dev/null
+++ b/templates/web/base/report/new/form_user_loggedout_password.html
@@ -0,0 +1,24 @@
+<div id="form_sign_in_yes" class="form-box">
+
+ <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>
+
+ <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label>
+ [% IF field_errors.password %]
+ <p class='form-error'>[% field_errors.password %]</p>
+ [% END %]
+ <div class="form-txt-submit-box">
+ <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value="">
+ <input class="green-btn" type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]">
+ </div>
+
+ <div class="checkbox-group">
+ <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
+ <label class="n inline" for="remember_me">[% loc('Keep me signed in on this computer') %]</label>
+ </div>
+
+ <div class="general-notes">
+ <p><strong>[% loc('Forgotten your password?') %]</strong>
+ [% loc('Confirm by email instead, providing a new password at that point. When you confirm, your password will be updated.') %]</p>
+ </div>
+
+</div>
diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html
index 8c812cd08..a92930f62 100644
--- a/templates/web/base/report/update-form.html
+++ b/templates/web/base/report/update-form.html
@@ -13,151 +13,15 @@
<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 %]>
<fieldset>
- <input type="hidden" name="submit_update" value="1">
- <input type="hidden" name="id" value="[% problem.id | html %]">
+ [% INCLUDE 'report/update/form_update.html' %]
- [% IF c.cobrand.allow_photo_upload %]
- <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
- <label for="form_photo">[% loc('Photo') %]</label>
-
- [% IF field_errors.photo %]
- <p class='form-error'>[% field_errors.photo %]</p>
- [% END %]
-
- <div id="form_photos">
- [% IF upload_fileid %]
- <script>
- fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
- </script>
- <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/[% id %].temp.jpeg" alt="">
- [% END %]
- [% END %]
- <input type="file" name="photo1" id="form_photo">
- <input type="file" name="photo2" id="form_photo2">
- <input type="file" name="photo3" id="form_photo3">
- </div>
- [% END %]
-
- <label for="form_update">[% loc( 'Update' ) %]</label>
- [% IF field_errors.update %]
- <div class='form-error'>[% field_errors.update %]</div>
- [% END %]
- <textarea rows="7" cols="30" name="update" id="form_update" placeholder="[% loc('Please write your update here') %]" required>[% update.text | html %]</textarea>
-
- [% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
- <label for="form_state">[% loc( 'State' ) %]</label>
- <select name="state" id="form_state">
- [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating',
- loc('Investigating')], ['action scheduled', loc('Action Scheduled')],
- ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')],
- ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')],
- ['fixed', loc('Fixed')] ] %]
- <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
- [% END %]
- </select>
- [% ELSE %]
- [% IF problem.is_fixed 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 %]>
- <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label>
-
- [% ELSIF !problem.is_fixed %]
-
- <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 %]
- [% END %]
-
- [% IF c.user_exists %]
-
- [% INCLUDE name %]
-
+ [% IF c.user_exists %]
+ [% INCLUDE 'report/update/form_name.html' %]
<input class="final-submit green-btn" type="submit" id="update_post" value="[% loc('Post') %]">
-
-
- [% ELSE %]
-
- <label for="form_rznvy">[% loc('Your email' ) %]
- <span class="muted">([% loc('We never show your email') %])</span>
- </label>
- [% IF field_errors.email %]
- <p class='form-error'>[% field_errors.email %]</p>
- [% END %]
- <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" placeholder="[% loc('Your email address' ) %]" required>
-
- <div id="form_sign_in">
- <h3>[% loc("Now to submit your update&hellip;") %]</h3>
- <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2>
-
- <div id="form_sign_in_yes" class="form-box">
- <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>
-
- <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label>
- [% IF field_errors.password %]
- <p class='form-error'>[% field_errors.password %]</p>
- [% END %]
- <div class="form-txt-submit-box">
- <input type="password" name="password_sign_in" id="password_sign_in" value="" placeholder="[% loc('Your password') %]">
- <input class="green-btn" type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]">
- </div>
-
- <div class="checkbox-group">
- <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
- <label class="inline n" for="remember_me">[% loc('Keep me signed in on this computer') %]</label>
- </div>
-
- <div class="general-notes">
- <p><strong>[% loc('Forgotten your password?') %]</strong>
- [% loc('Confirm by email below, providing a new password at that point. When you confirm, your password will be updated.') %]</p>
- </div>
-
- </div>
- <div id="form_sign_in_no" class="form-box">
- <h5>[% loc('<strong>No</strong> Let me confirm my update by email') %]</h5>
-
- [% INCLUDE name %]
-
- <label for="password_register">[% loc('Password (optional)') %]</label>
-
- <div class="general-notes">
- <p>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p>
- </div>
-
- <div class="form-txt-submit-box">
- <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]">
- <input class="green-btn" type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]">
- </div>
-
- </div>
- </div>
-
- [% END %]
+ [% ELSE %]
+ [% INCLUDE 'report/update/form_user_loggedout.html' %]
+ [% END %]
</fieldset>
</form>
</div>
[% END %]
-
-[% BLOCK name %]
- [% INCLUDE 'report/new/extra_name.html' %]
- <label for="form_name">[% loc('Name') %]</label>
- [% IF field_errors.name %]
- <p class='form-error'>[% field_errors.name %]</p>
- [% END %]
- <input type="text"
- [%- IF c.cobrand.moniker.match('fixmystreet|bromley') AND problem.bodies_str == '2482' %]class="validName" [% END -%]
- name="name" id="form_name" value="[% update.name || c.user.name | html %]" placeholder="[% loc('Your name') %]">
-
- <div class="checkbox-group">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %]>
- <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
- </div>
- <div class="checkbox-group">
- <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]>
- <label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
- </div>
-[% END %]
diff --git a/templates/web/base/report/update/form_name.html b/templates/web/base/report/update/form_name.html
new file mode 100644
index 000000000..8311922e3
--- /dev/null
+++ b/templates/web/base/report/update/form_name.html
@@ -0,0 +1,21 @@
+[% INCLUDE 'report/new/extra_name.html' %]
+
+[% name_public = update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %]
+<label for="form_name">[% loc('Name') %]</label>
+[% IF field_errors.name %]
+ <p class='form-error'>[% field_errors.name %]</p>
+[% END %]
+
+<input type="text"
+ [%- IF c.cobrand.moniker.match('fixmystreet|bromley') AND problem.bodies_str == '2482' %]class="validName" [% END -%]
+ name="name" id="form_name" value="[% update.name || c.user.name | html %]" placeholder="[% loc('Your name') %]">
+
+<div class="checkbox-group">
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF name_public %]>
+ <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
+</div>
+
+<div class="checkbox-group">
+ <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]>
+ <label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
+</div>
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
new file mode 100644
index 000000000..b25d4c706
--- /dev/null
+++ b/templates/web/base/report/update/form_update.html
@@ -0,0 +1,59 @@
+<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">[% loc('Photo') %]</label>
+
+ [% IF field_errors.photo %]
+ <p class='form-error'>[% field_errors.photo %]</p>
+ [% END %]
+
+ <div id="form_photos">
+ [% IF upload_fileid %]
+ <script>
+ fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
+ </script>
+ <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/[% id %].temp.jpeg" alt="">
+ [% END %]
+ [% END %]
+ <input type="file" name="photo1" id="form_photo">
+ <input type="file" name="photo2" id="form_photo2">
+ <input type="file" name="photo3" id="form_photo3">
+ </div>
+[% END %]
+
+<label for="form_update">[% loc( 'Update' ) %]</label>
+[% IF field_errors.update %]
+ <div class='form-error'>[% field_errors.update %]</div>
+[% END %]
+<textarea rows="7" cols="30" name="update" id="form_update" placeholder="[% loc('Please write your update here') %]" required>[% update.text | html %]</textarea>
+
+[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+ <label for="form_state">[% loc( 'State' ) %]</label>
+ <select name="state" id="form_state">
+ [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating',
+ loc('Investigating')], ['action scheduled', loc('Action Scheduled')],
+ ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')],
+ ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')],
+ ['fixed', loc('Fixed')] ] %]
+ <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
+ [% END %]
+ </select>
+[% ELSE %]
+ [% IF problem.is_fixed 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 %]>
+ <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label>
+
+ [% ELSIF !problem.is_fixed %]
+
+ <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 %]
+[% END %]
diff --git a/templates/web/base/report/update/form_user_loggedout.html b/templates/web/base/report/update/form_user_loggedout.html
new file mode 100644
index 000000000..76ac88d2f
--- /dev/null
+++ b/templates/web/base/report/update/form_user_loggedout.html
@@ -0,0 +1,8 @@
+[% INCLUDE 'report/update/form_user_loggedout_email.html' %]
+<h3>[% loc("Now to submit your update&hellip;") %]</h3>
+
+<div id="form_sign_in">
+ <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2>
+ [% INCLUDE 'report/update/form_user_loggedout_password.html' %]
+ [% INCLUDE 'report/update/form_user_loggedout_by_email.html' %]
+</div>
diff --git a/templates/web/base/report/update/form_user_loggedout_by_email.html b/templates/web/base/report/update/form_user_loggedout_by_email.html
new file mode 100644
index 000000000..672f76ed9
--- /dev/null
+++ b/templates/web/base/report/update/form_user_loggedout_by_email.html
@@ -0,0 +1,17 @@
+<div id="form_sign_in_no" class="form-box">
+ <h5>[% loc('<strong>No</strong> Let me confirm my update by email') %]</h5>
+
+ [% INCLUDE 'report/update/form_name.html' %]
+
+ <label for="password_register">[% loc('Password (optional)') %]</label>
+
+ <div class="general-notes">
+ <p>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p>
+ </div>
+
+ <div class="form-txt-submit-box">
+ <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]">
+ <input class="green-btn" type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]">
+ </div>
+
+</div>
diff --git a/templates/web/base/report/update/form_user_loggedout_email.html b/templates/web/base/report/update/form_user_loggedout_email.html
new file mode 100644
index 000000000..e03e81a4c
--- /dev/null
+++ b/templates/web/base/report/update/form_user_loggedout_email.html
@@ -0,0 +1,7 @@
+<label for="form_rznvy">[% loc('Your email' ) %]
+<span class="muted">([% loc('We never show your email') %])</span>
+</label>
+[% IF field_errors.email %]
+ <p class='form-error'>[% field_errors.email %]</p>
+[% END %]
+<input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" placeholder="[% loc('Your email address' ) %]" required>
diff --git a/templates/web/base/report/update/form_user_loggedout_password.html b/templates/web/base/report/update/form_user_loggedout_password.html
new file mode 100644
index 000000000..cd4433c47
--- /dev/null
+++ b/templates/web/base/report/update/form_user_loggedout_password.html
@@ -0,0 +1,23 @@
+<div id="form_sign_in_yes" class="form-box">
+ <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>
+
+ <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label>
+ [% IF field_errors.password %]
+ <p class='form-error'>[% field_errors.password %]</p>
+ [% END %]
+ <div class="form-txt-submit-box">
+ <input type="password" name="password_sign_in" id="password_sign_in" value="" placeholder="[% loc('Your password') %]">
+ <input class="green-btn" type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]">
+ </div>
+
+ <div class="checkbox-group">
+ <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
+ <label class="inline n" for="remember_me">[% loc('Keep me signed in on this computer') %]</label>
+ </div>
+
+ <div class="general-notes">
+ <p><strong>[% loc('Forgotten your password?') %]</strong>
+ [% loc('Confirm by email below, providing a new password at that point. When you confirm, your password will be updated.') %]</p>
+ </div>
+
+</div>