diff options
Diffstat (limited to 'templates/web/base')
55 files changed, 992 insertions, 695 deletions
diff --git a/templates/web/base/about/_sidebar.html b/templates/web/base/about/_sidebar.html new file mode 100755 index 000000000..ae32dfb51 --- /dev/null +++ b/templates/web/base/about/_sidebar.html @@ -0,0 +1,15 @@ +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li>[% INCLUDE link h='/faq' t=loc('Frequently Asked Questions') %]</li> + <li>[% INCLUDE link h='/about/privacy' t=loc('Privacy and cookies') %]</li> + <li>[% INCLUDE link h='/contact' t=tprintf(loc("Contact %s", "%s is the site name"), site_name) %]</li> + </ul> + </aside> +</div> + +[% BLOCK link -%] +<[% IF c.req.uri.path == h %]strong[% ELSE %]a href="[% h %]"[% END %]> +[%- t -%] +</[% IF c.req.uri.path == h %]strong[% ELSE %]a[% END %]> +[%- END %] diff --git a/templates/web/base/faq/faq-en-gb.html b/templates/web/base/about/faq-en-gb.html index b60f1102a..fc087a0e6 100755 --- a/templates/web/base/faq/faq-en-gb.html +++ b/templates/web/base/about/faq-en-gb.html @@ -1,14 +1,6 @@ [% INCLUDE 'header.html', title = loc('Frequently Asked Questions'), bodyclass = 'twothirdswidthpage' %] -<div class="sticky-sidebar"> - <aside> - <ul class="plain-list"> - <li><strong>[% loc('Frequently Asked Questions') %]</strong></li> - <li><a href="/privacy">[% loc('Privacy and cookies') %]</a></li> - <li><a href="/contact">[% tprintf(loc("Contact %s", "%s is the site name"), site_name) %]</a></li> - </ul> - </aside> -</div> +[% INCLUDE 'about/_sidebar.html' %] <h1><a name="faq"></a>[% loc('Frequently Asked Questions') %]</h1> diff --git a/templates/web/base/static/iphone.html b/templates/web/base/about/iphone.html index 8f7992713..8f7992713 100755 --- a/templates/web/base/static/iphone.html +++ b/templates/web/base/about/iphone.html diff --git a/templates/web/base/static/privacy.html b/templates/web/base/about/privacy.html index 11ab65311..a794cfadf 100755 --- a/templates/web/base/static/privacy.html +++ b/templates/web/base/about/privacy.html @@ -2,15 +2,7 @@ title = loc('Privacy and cookies'), bodyclass = 'twothirdswidthpage' %] -<div class="sticky-sidebar"> - <aside> - <ul class="plain-list"> - <li><a href="/faq">[% loc('Frequently Asked Questions') %]</a></li> - <li><a href="/privacy">[% loc('Privacy and cookies') %]</a></li> - <li><a href="/contact">[% tprintf(loc("Contact %s", "%s is the site name"), site_name) %]</a></li> - </ul> - </aside> -</div> +[% INCLUDE 'about/_sidebar.html' %] <h1>Privacy, cookies, and third party services</h1> diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html index 6b103a7cf..7acfbfdd5 100644 --- a/templates/web/base/admin/body-form.html +++ b/templates/web/base/admin/body-form.html @@ -212,7 +212,7 @@ </p> </div> <p> - <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF conf.send_extended_statuses %]> + <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF body.send_extended_statuses %]> <label for="send_extended_statuses" class="inline">Send extended Open311 statuses with service request updates</label> </p> </div> diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html index dde6523a3..4c4a7b388 100644 --- a/templates/web/base/admin/index.html +++ b/templates/web/base/admin/index.html @@ -28,14 +28,7 @@ and to receive notices of updates. [%- END %] [% END -%] - <ul> - <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]; - [% tprintf( loc('from %d different users'), total_problems_users ) %]</li> - <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li> - <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li> - <li>[% tprintf( loc('%d questionnaires sent – %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li> - <li>[% tprintf( loc('%d council contacts – %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li> - </ul> +[% INCLUDE 'status/stats.html' admin_include_users=1 %] [% IF c.cobrand.admin_show_creation_graph -%] <p> diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index d04a1a82b..c0cdead84 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -77,20 +77,26 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> <li><label class="inline" for="non_public">[% loc('Private') %]:</label> <input type="checkbox" name="non_public"[% ' checked' IF problem.non_public %]></li> [% IF problem.photo %] -[% photo = problem.get_photo_params %] -<li><img alt="Photo of this report" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %] - [%~ IF problem.photo.length == 40 ~%] - /photo/[% problem.photo %].temp.jpeg - [%~ ELSE ~%] - [% photo.url %] - [%~ END %]"> -<br> -<input type="submit" name="rotate_photo" value="[% loc('Rotate Left') %]"> -<input type="submit" name="rotate_photo" value="[% loc('Rotate Right') %]"> -<br> -<input type="checkbox" id="remove_photo" name="remove_photo" value="1"> -<label class="inline" for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li> +<li> +<ul> + [% FOR photo IN problem.photos %] + <li> + <div class="update-img"> + <a href="[% c.cobrand.base_url %][% photo.url_temp_full %]" rel="fancy"> + <img alt="Photo of this report" src="[% c.cobrand.base_url %][% photo.url_temp %]"> + <span>zoom</span> + </a> + </div> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Left') %]"> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Right') %]"> + <input type="checkbox" id="remove_photo_[% loop.index %]" name="remove_photo_[% loop.index %]" value="1"> + <label class="inline" for="remove_photo_[% loop.index %]">[% loc("Remove photo (can't be undone!)") %]</label></li> + </li> + [% END %] +</ul> +</li> [% END %] + </ul> <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> diff --git a/templates/web/base/admin/update_edit.html b/templates/web/base/admin/update_edit.html index 5ffce8bc4..a956bb2cb 100644 --- a/templates/web/base/admin/update_edit.html +++ b/templates/web/base/admin/update_edit.html @@ -51,16 +51,26 @@ <li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li> [% IF update.photo %] -[% photo = update.get_photo_params %] -<li><img alt="Photo of this update" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %] - [%~ IF update.photo.length == 40 ~%] - /photo/[% update.photo %].temp.jpeg - [%~ ELSE ~%] - [% photo.url %] - [%~ END ~%]"> -<input type="checkbox" id="remove_photo" name="remove_photo" value="1"> -<label for="remove_photo" class="inline">[% loc("Remove photo (can't be undone!)") %]</label></li> +<li> +<ul> + [% FOR photo IN update.photos %] + <li> + <div class="update-img"> + <a href="[% c.cobrand.base_url %][% photo.url_temp_full %]" rel="fancy"> + <img alt="Photo of this update" src="[% c.cobrand.base_url %][% photo.url_temp %]"> + <span>zoom</span> + </a> + </div> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Left') %]"> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Right') %]"> + <input type="checkbox" id="remove_photo_[% loop.index %]" name="remove_photo_[% loop.index %]" value="1"> + <label class="inline" for="remove_photo_[% loop.index %]">[% loc("Remove photo (can't be undone!)") %]</label></li> + </li> + [% END %] +</ul> +</li> [% END %] + </ul> <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html index 2b12182df..4965a1103 100644 --- a/templates/web/base/alert/index.html +++ b/templates/web/base/alert/index.html @@ -1,4 +1,4 @@ -[% INCLUDE 'header.html', title = loc('Local RSS feeds and email alerts'), bodyclass = 'twothirdswidthpage' %] +[% INCLUDE 'header.html', title = loc('Local RSS feeds and email alerts'), bodyclass = 'fullwidthpage' %] <h1>[% loc('Local RSS feeds and email alerts') %]</h1> @@ -37,16 +37,14 @@ within a certain distance of a particular location.', "%s is the site name"), si </form> [% IF photos.size %] -<div id="alert_recent"> - <aside> - <h2>[% loc('Some photos of recent reports') %]</h2> - [% FOREACH p IN photos; - photo = p.get_photo_params; - %] - <a href="/report/[% p.id %]"><img border="0" height="100" - src="[% photo.url_tn %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a> - [% END %] - </aside> +<h2>[% loc('Some photos of recent reports') %]</h2> +<div class="alerts__nearby-activity__photos"> + [% FOREACH p IN photos %] + <a href="/report/[% p.id %]"> + <img border="0" height="100" src="[% p.photos.first.url_tn %]" + alt="[% p.title | html %]" title="[% p.title | html %]"> + </a> + [% END %] </div> [% END %] diff --git a/templates/web/base/alert/list.html b/templates/web/base/alert/list.html index 7b262f9e7..385cd7d32 100644 --- a/templates/web/base/alert/list.html +++ b/templates/web/base/alert/list.html @@ -6,7 +6,7 @@ END; %] -[% INCLUDE 'header.html', title = title, bodyclass = 'twothirdswidthpage' %] +[% INCLUDE 'header.html', title = title, bodyclass = 'fullwidthpage' %] [% IF pretty_pc %] [% @@ -18,21 +18,21 @@ <h1>[% title %]</h1> -<form id="alerts" name="alerts" method="post" action="/alert/subscribe"> - - [% IF photos.size %] - <div id="alert_photos"> - <aside> - <h2>[% loc('Photos of recent nearby reports') %]</h2> - [% FOREACH p IN photos; - photo = p.get_photo_params; - %] - <a href="/report/[% p.id %]"><img border="0" height="100" - src="[% photo.url_tn %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a> - [% END %] - </aside> +[% IF photos.size %] +<div class="alerts__nearby-activity"> + <h2>[% loc('Photos of recent nearby reports') %]</h2> + <div class="alerts__nearby-activity__photos"> + [% FOREACH p IN photos %] + <a href="/report/[% p.id %]"> + <img border="0" height="100" src="[% p.photos.first.url_tn %]" + alt="[% p.title | html %]" title="[% p.title | html %]"> + </a> + [% END %] </div> - [% END %] +</div> +[% END %] + +<form id="alerts" name="alerts" method="post" action="/alert/subscribe"> [% INCLUDE 'alert/_list.html' %] diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html index 6e1db86fe..d856dc19a 100644 --- a/templates/web/base/auth/general.html +++ b/templates/web/base/auth/general.html @@ -2,11 +2,28 @@ <h1>[% loc('Sign in') %]</h1> +[% IF oauth_need_email %] + <p class="form-error">[% loc('We need your email address, please give it below.') %]</p> +[% END %] +[% IF oauth_failure %] + <p class="form-error">[% loc('Sorry, we could not log you in. Please fill in the form below.') %]</p> +[% END %] + <form action="[% c.uri_for() %]" method="post" name="general_auth" class="validate"> <fieldset> <input type="hidden" name="r" value="[% c.req.params.r | html %]"> +[% IF NOT oauth_need_email AND c.config.FACEBOOK_APP_ID %] + <div class="form-box"> + <button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook"> + <img alt="" src="/i/facebook-icon-32.png" width="17" height="32"> + Log in with Facebook + </button> + </div> + <div id="js-social-email-hide"> +[% END %] + [% IF email_error; # other keys include fqdn, mxcheck if you'd like to write a custom error message @@ -29,43 +46,58 @@ <div id="form_sign_in"> <h3>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h3> + [% IF oauth_need_email %] + [% INCLUDE form_sign_in_no %] + [% INCLUDE form_sign_in_yes %] + <input type="hidden" name="oauth_need_email" value="1"> + [% ELSE %] + [% INCLUDE form_sign_in_yes %] + [% INCLUDE form_sign_in_no %] + [% END %] + </div> - <div id="form_sign_in_yes" class="form-box"> - <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5> +[% IF NOT oauth_need_email AND c.config.FACEBOOK_APP_ID %] + </div> +[% END %] - <label class="hidden-js n" for="password_sign_in">[% loc('Password:') %]</label> + </fieldset> +</form> - <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="sign_in" value="[% loc('Sign in') %]"> - </div> +[% INCLUDE 'footer.html' %] - <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> +[% BLOCK form_sign_in_yes %] + <div id="form_sign_in_yes" class="form-box"> + <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5> - </div> - <div id="form_sign_in_no" class="form-box"> - <h5>[% loc('<strong>No</strong> let me sign in by email') %]</h5> + <label class="hidden-js n" for="password_sign_in">[% loc('Password:') %]</label> - <label for="name">[% loc('Name') %]</label> - <input type="text" name="name" value="" placeholder="[% loc('Your name') %]"> + <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="sign_in" value="[% loc('Sign in') %]"> + </div> - <label for="password_register">[% loc('Password (optional)') %]</label> + <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 class="general-notes"> - <p>[% loc('Providing a name and password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p> - </div> + </div> +[% END %] - <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="email_sign_in" value="[% loc('Sign in') %]"> - </div> - </div> +[% BLOCK form_sign_in_no %] + <div id="form_sign_in_no" class="form-box"> + <h5>[% loc('<strong>No</strong> let me sign in by email') %]</h5> - </div> + <label for="name">[% loc('Name') %]</label> + <input type="text" name="name" value="" placeholder="[% loc('Your name') %]"> - </fieldset> -</form> + <label for="password_register">[% loc('Password (optional)') %]</label> + <div class="general-notes"> + <p>[% loc('Providing a name and password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p> + </div> -[% INCLUDE 'footer.html' %] + <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="email_sign_in" value="[% loc('Sign in') %]"> + </div> + </div> +[% END %] diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html index 0ad3ffb5f..d13509a7a 100644 --- a/templates/web/base/common_header_tags.html +++ b/templates/web/base/common_header_tags.html @@ -8,6 +8,7 @@ <script type="text/javascript" src="[% start %]/jslib/jquery-1.7.2.min.js"></script> <script src="[% start %][% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> +<script type="text/javascript" src="[% start %][% version('/js/dropzone.min.js') %]"></script> <script type="text/javascript" src="[% start %][% version('/js/geo.min.js') %]"></script> <script type="text/javascript" src="[% start %][% version('/js/fixmystreet.js') %]"></script> diff --git a/templates/web/base/contact/blurb.html b/templates/web/base/contact/blurb.html index 463813449..3f9e88ed0 100644 --- a/templates/web/base/contact/blurb.html +++ b/templates/web/base/contact/blurb.html @@ -1,9 +1,15 @@ +[% IF c.cobrand.moniker == 'fixmystreet' %] +<h3>Send a message to FixMyStreet's technical support team</h3> + +<h4>If you have questions about FixMyStreet</h4> +[% END %] + +<p> +[% tprintf( loc("It's often quickest to <a href=\"%s\">check our FAQs</a> and see if the answer is there."), c.uri_for('/faq') ) %] +</p> + <p> [% loc('Please do <strong>not</strong> report problems through this form; messages go to the team behind this site, not a council. To report a problem, please <a href="/">go to the front page</a> and follow the instructions.') %] </p> - -<p> -[% tprintf( loc("We'd love to hear what you think about this site. Just fill in the form, or send an email to <a href='mailto:%s'>%s</a>:"), contact_email, contact_email) %] -</p> diff --git a/templates/web/base/contact/index.html b/templates/web/base/contact/index.html index 228a77def..86a0cec0d 100644 --- a/templates/web/base/contact/index.html +++ b/templates/web/base/contact/index.html @@ -1,106 +1,118 @@ [% INCLUDE 'header.html', title = loc('Contact Us') robots = 'noindex,nofollow' + bodyclass = 'twothirdswidthpage' %] +[% INCLUDE 'about/_sidebar.html' %] + +[% IF c.cobrand.moniker == 'fixmystreet' %] +<h1>FixMyStreet technical support</h1> +[% ELSE %] <h1>[% loc('Contact the team') %]</h1> +[% END %] <form method="post" action="/contact/submit" class="validate"> + <fieldset> + [% INCLUDE 'errors.html' %] + + [% IF update %] + + <p> + [% loc('You are reporting the following update for being abusive, containing personal information, or similar:') %] + </p> + + <blockquote> + <p> + [% IF update.anonymous %] + [% tprintf( loc('Update below added anonymously at %s'), prettify_dt( update.confirmed ) ) %] + [% ELSE %] + [% tprintf( loc('Update below added by %s at %s'), update.name, prettify_dt( update.confirmed ) ) | html %] + [% END %] + </p> + + <p> + [% update.text | html %] + </p> + + </blockquote> + <input type="hidden" name="update_id" value="[% update.id %]"> + <input type="hidden" name="id" value="[% update.problem_id %]"> + + [% ELSIF problem %] + <p> + [% IF moderation_complaint %] + <input type="hidden" name="m" value="[% moderation_complaint %]"> + [% loc('You are complaining that this problem report was unnecessarily moderated:') %] + [% ELSE %] + [% loc('You are reporting the following problem report for being abusive, containing personal information, or similar:') %] + [% END %] + </p> -[% INCLUDE 'errors.html' %] + <blockquote> + <h2>[% problem.title_safe | html %]</h2> -[% IF update %] + <p> + [% IF problem.anonymous %] + [% tprintf( loc('Reported anonymously at %s'), prettify_dt( problem.confirmed ) ) %] + [% ELSE %] + [% tprintf( loc('Reported by %s at %s'), problem.user.name, prettify_dt( problem.confirmed ) ) | html %] + [% END %] + </p> - <p> - [% loc('You are reporting the following update for being abusive, containing personal information, or similar:') %] - </p> + <p> + [% problem.detail | html %] + </p> - <blockquote> - <p> - [% IF update.anonymous %] - [% tprintf( loc('Update below added anonymously at %s'), prettify_dt( update.confirmed ) ) %] - [% ELSE %] - [% tprintf( loc('Update below added by %s at %s'), update.name, prettify_dt( update.confirmed ) ) | html %] - [% END %] - </p> - - <p> - [% update.text | html %] - </p> - - </blockquote> - <input type="hidden" name="update_id" value="[% update.id %]"> - <input type="hidden" name="id" value="[% update.problem_id %]"> - -[% ELSIF problem %] - <p> - [% IF moderation_complaint %] - <input type="hidden" name="m" value="[% moderation_complaint %]"> - [% loc('You are complaining that this problem report was unnecessarily moderated:') %] - [% ELSE %] - [% loc('You are reporting the following problem report for being abusive, containing personal information, or similar:') %] - [% END %] - </p> - - <blockquote> - <h2>[% problem.title_safe | html %]</h2> - - <p> - [% IF problem.anonymous %] - [% tprintf( loc('Reported anonymously at %s'), prettify_dt( problem.confirmed ) ) %] - [% ELSE %] - [% tprintf( loc('Reported by %s at %s'), problem.user.name, prettify_dt( problem.confirmed ) ) | html %] - [% END %] - </p> + </blockquote> + <input type="hidden" name="id" value="[% problem.id %]"> - <p> - [% problem.detail | html %] - </p> + [% ELSE %] - </blockquote> - <input type="hidden" name="id" value="[% problem.id %]"> + [% INCLUDE 'contact/blurb.html' %] -[% ELSE %] + [% END %] - [% INCLUDE 'contact/blurb.html' %] + <label for="form_name">[% loc('Your name') %]</label> + [% IF field_errors.name %] + <div class="form-error">[% field_errors.name %]</div> + [% END %] + <input type="text" class="required" name="name" id="form_name" value="[% form_name | html %]" size="30"> -[% END %] -[% IF field_errors.name %] - <div class="form-error">[% field_errors.name %]</div> -[% END %] -<div class="form-field"> -<label for="form_name">[% loc('Your name:') %]</label> -<input type="text" class="required" name="name" id="form_name" value="[% form_name | html %]" size="30"></div> + <label for="form_email">[% loc('Your email') %]</label> + [% IF field_errors.em %] + <div class="form-error">[% field_errors.em %]</div> + [% END %] + <input type="text" class="required email" name="em" id="form_email" value="[% em | html %]" size="30"> -[% IF field_errors.em %] - <div class="form-error">[% field_errors.em %]</div> -[% END %] -<div class="form-field"> -<label for="form_email">[% loc('Your email:') %]</label> -<input type="text" class="required email" name="em" id="form_email" value="[% em | html %]" size="30"></div> + <label for="form_subject">[% loc('Subject') %]</label> + [% IF field_errors.subject %] + <div class="form-error">[% field_errors.subject %]</div> + [% END %] + <input type="text" class="required" name="subject" id="form_subject" value="[% subject | html %]" size="30"> -[% IF field_errors.subject %] - <div class="form-error">[% field_errors.subject %]</div> -[% END %] -<div class="form-field"> -<label for="form_subject">[% loc('Subject:') %]</label> -<input type="text" class="required" name="subject" id="form_subject" value="[% subject | html %]" size="30"></div> + [% INCLUDE 'contact/who.html' %] -[% INCLUDE 'contact/who.html' %] + <label for="form_message">[% loc('Message') %]</label> + [% IF field_errors.message %] + <div class="form-error">[% field_errors.message %]</div> + [% END %] + <textarea class="required" name="message" id="form_message" rows="7" cols="50">[% message | html %]</textarea> -[% IF field_errors.message %] - <div class="form-error">[% field_errors.message %]</div> -[% END %] -<div class="form-field"> -<label for="form_message">[% loc('Message:') %]</label> -<textarea class="required" name="message" id="form_message" rows="7" cols="50">[% message | html %]</textarea></div> -<div class="checkbox"><input type="submit" value="[% loc('Post') %]"></div> + <input class="final-submit green-btn" type="submit" value="[% loc('Post') %]"> + </fieldset> </form> +<h4>[% loc("Don't like forms?") %]</h4> + +<p> +[% tprintf( loc("You can contact technical support on <a href='mailto:%s'>%s</a>"), contact_email, contact_email) %] +</p> + [% TRY %][% INCLUDE 'contact/address.html' %][% CATCH file %][% END %] -[% INCLUDE 'footer.html' %] +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/base/errors/generic.html b/templates/web/base/errors/generic.html index 12aa8e170..d0d1e2e00 100755 --- a/templates/web/base/errors/generic.html +++ b/templates/web/base/errors/generic.html @@ -1,8 +1,9 @@ -[% INCLUDE 'header.html', title = loc('Error') %] +[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Error') %] -<h1>[% loc('Error') %]</h1> - -<p>[% message %]</p> +<div class="confirmation-header confirmation-header--failure"> + <h1>[% loc('Error') %]</h1> + <p>[% message %]</p> +</div> [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/errors/page_error_404_not_found.html b/templates/web/base/errors/page_error_404_not_found.html index 77db18e89..490c5b721 100644 --- a/templates/web/base/errors/page_error_404_not_found.html +++ b/templates/web/base/errors/page_error_404_not_found.html @@ -1,19 +1,13 @@ -[% INCLUDE 'header.html', title => loc('Page Not Found') %] +[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Page Not Found') %] -<h1>[%loc('Page Not Found') %]</h1> - -[% IF error_msg %] +<div class="confirmation-header confirmation-header--failure"> + <h1>[% loc('Page Not Found') %]</h1> + [% IF error_msg %] <p class="error">[% error_msg | html %]</p> -[% END %] + [% END %] -<p> - [% - tprintf( - loc("The requested URL '%s' was not found on this server"), - c.req.uri - ) - %] -</p> + <p>[% tprintf(loc("The requested URL '%s' was not found on this server"), c.req.uri) %]</p> +</div> [% # FIXME - add more helpful suggestions to this page %] diff --git a/templates/web/base/front/stats.html b/templates/web/base/front/stats.html index 5367f1118..eb671137b 100644 --- a/templates/web/base/front/stats.html +++ b/templates/web/base/front/stats.html @@ -1,8 +1,4 @@ -[% - USE Comma; - # Note - if we want to i18n the commas we should try - # 'Template::Plugin::Number::Format' -%] +[% USE Number.Format %] [% stats = c.cobrand.front_stats_data(); @@ -31,13 +27,16 @@ "<big>%s</big> updates on reports", stats.updates ); - + + new_n = stats.new | format_number; + fixed_n = stats.fixed | format_number; + updates_n = stats.updates | format_number; %] <div id="front_stats"> - <div>[% tprintf( new_text, stats.new ) | comma %]</div> - <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div> + <div>[% tprintf( new_text, decode(new_n) ) %]</div> + <div>[% tprintf( fixed_text, decode(fixed_n) ) %]</div> [% IF c.cobrand.moniker != 'zurich' %] - <div>[% tprintf( updates_text, stats.updates ) | comma %]</div> + <div>[% tprintf( updates_text, decode(updates_n) ) %]</div> [% END %] </div> diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index 669055a1b..b97104f92 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -47,5 +47,10 @@ permalink: '[% loc('Permalink') | replace("'", "\\'") %]', + upload_max_files_exceeded: '[% loc ('Whoa there Testino! Three photos are enough.') | replace("'", "\\'") %]', + upload_default_message: '[% loc ('Drag and drop photos here or <u>click to upload</u>') | replace("'", "\\'") %]', + upload_cancel_confirmation: '[% loc ('Are you sure you want to cancel this upload?') | replace("'", "\\'") %]', + upload_invalid_file_type: '[% loc ('Please upload a JPEG image only') | replace("'", "\\'") %]', + report_problem_heading: '[% loc('Click map to report a problem') | replace("'", "\\'") %]' }; diff --git a/templates/web/base/js/validation_rules.html b/templates/web/base/js/validation_rules.html index 409d0971f..5295a53ca 100644 --- a/templates/web/base/js/validation_rules.html +++ b/templates/web/base/js/validation_rules.html @@ -1,7 +1,5 @@ validation_rules = { title: { required: true }, detail: { required: true }, - email: { required: true }, - update: { required: true }, - rznvy: { required: true } + update: { required: true } }; diff --git a/templates/web/base/maps/google-ol.html b/templates/web/base/maps/google-ol.html index 021570df1..7c83534a8 100644 --- a/templates/web/base/maps/google-ol.html +++ b/templates/web/base/maps/google-ol.html @@ -1,5 +1,5 @@ [% map_js = BLOCK %] -<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.20"></script> +<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.21"></script> <script type="text/javascript" src="[% version('/js/OpenLayers.fixmystreet.google.js') %]"></script> <script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script> <script type="text/javascript" src="[% version('/js/map-google-ol.js') %]"></script> @@ -10,7 +10,7 @@ [% END %] [% map_sub_links = BLOCK %] -<a class="hidden-nojs" id="map_layer_toggle" href="">[% loc('Satellite') %]</a> +<a class="hidden-nojs" id="map_layer_toggle" href="">[% loc('Map') %]</a> [% END %] [% map_html = BLOCK %] diff --git a/templates/web/base/my/my.html b/templates/web/base/my/my.html index 9be4edfca..dff18c025 100644 --- a/templates/web/base/my/my.html +++ b/templates/web/base/my/my.html @@ -46,11 +46,21 @@ <ul class="item-list item-list--updates full-width"> [% END %] - <li>“[% u.text | html %]” - – <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>. - <p><small class="council_sent_info"> - [% tprintf( loc("Added %s"), prettify_dt( u.confirmed, 'date' ) ) %] - </small></p> + <li class="item-list__item item-list__item--updates"> + <div class="item-list__update-wrap"> + [% INCLUDE 'report/photo.html' object=u %] + <div class="item-list__update-text"> + [% add_links( u.text ) | html_para %] + + <p class="meta-2"> + [% tprintf( loc("Added %s"), prettify_dt( u.confirmed, 'date' ) ) %] + – + <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]"> + [% u.problem.title | html %] + </a> + </p> + </div> + </div> </li> [% "</ul>" IF loop.last %] [% END %] diff --git a/templates/web/base/open311/index.html b/templates/web/base/open311/index.html index d42cc2106..196cf0db6 100644 --- a/templates/web/base/open311/index.html +++ b/templates/web/base/open311/index.html @@ -1,14 +1,6 @@ [% INCLUDE 'header.html', title = 'Open311', bodyclass = 'twothirdswidthpage' %] -<div class="sticky-sidebar"> - <aside> - <ul class="plain-list"> - <li><a href="/faq">[% loc('Frequently Asked Questions') %]</a></li> - <li><a href="/privacy">[% loc('Privacy and cookies') %]</a></li> - <li><a href="/contact">[% tprintf(loc("Contact %s", "%s is the site name"), site_name) %]</a></li> - </ul> - </aside> -</div> +[% INCLUDE 'about/_sidebar.html' %] <h1>FixMyStreet support for Open311</h1> diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index ab3bde9ad..86887c163 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -11,7 +11,7 @@ <h1>[% loc('Questionnaire') %]</h1> -<h2 class="questionnaire-report-header">Your report</h2> +<h2 class="questionnaire-report-header">[% loc('Your report') %]</h2> <div class="questionnaire-report-reminder"> [% INCLUDE 'report/photo.html' object=problem %] <h3 class="questionnaire-report-reminder__report-title"> @@ -71,15 +71,26 @@ <p><textarea name="update" rows="7" cols="30" placeholder="[% loc('What was your experience of getting the problem fixed?') %]">[% update | html %]</textarea></p> [% IF c.cobrand.allow_photo_upload %] -<p id="fileupload_normalUI"> - [% IF upload_fileid %] - <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> - <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <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 %] + <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 %] - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo"> -</p> + <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 %] [% IF c.cobrand.moniker != 'emptyhomes' %] diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index d79a4e9f3..6ae43f798 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -1,9 +1,7 @@ <li class="item-list__item item-list--reports__item [% item_extra_class %]"> <a href="[% c.uri_for('/report', problem.id ) %]"> - [% IF problem.photo; - photo = problem.get_photo_params - %] - <img class="img" height="60" width="90" src="[% photo.url_fp %]" alt=""> + [% IF problem.photo %] + <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt=""> [% END %] <h4>[% problem.title | html %]</h4> <small> diff --git a/templates/web/base/report/banner.html b/templates/web/base/report/banner.html index bd7798d79..188e96502 100644 --- a/templates/web/base/report/banner.html +++ b/templates/web/base/report/banner.html @@ -1,22 +1,20 @@ [% USE date %] [% BLOCK banner %] -<p class="banner" id="[% id %]"> - [% text %] -</p> + <div class="banner"> + <p id="[% id %]">[% text %]</p> + </div> [% END %] [% IF problem.is_open AND date.now - problem.lastupdate.epoch > 8 * 7 * 24 * 60 * 60 %] - [% INCLUDE banner, id = 'unknown', text = loc('This problem is old and of unknown status.') %] + [% INCLUDE banner, id = 'unknown', text = loc('Unknown') %] [% END %] [% IF problem.is_fixed %] - [% INCLUDE banner, id = 'fixed', text = loc('This problem has been fixed') %] + [% INCLUDE banner, id = 'fixed', text = loc('Fixed') %] [% END %] [% IF problem.is_closed %] - [% INCLUDE banner, id = 'closed', text = loc('This problem has been closed') %] + [% INCLUDE banner, id = 'closed', text = loc('Closed') %] [% END %] [% states = [ 'investigating', 'in progress', 'planned', 'action scheduled' ]; IF states.grep(problem.state).size %] - [% INCLUDE banner, id = 'progress', text = loc('This problem is in progress') %] + [% INCLUDE banner, id = 'progress', text = loc('In progress') %] [% END %] - - diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html index 329614488..05e07d501 100644 --- a/templates/web/base/report/display.html +++ b/templates/web/base/report/display.html @@ -1,60 +1,44 @@ [% + SET bodyclass = 'mappage'; + PROCESS "report/photo-js.html"; PROCESS "maps/${map.type}.html"; problem_title = problem.title_safe _ ' - ' _ loc('Viewing a problem'); - SET rss = [ tprintf(loc('Updates to this problem, %s', "%s is the site name"), site_name), "/rss/$problem.id" ] IF c.cobrand.moniker != 'emptyhomes'; - SET robots = 'index, nofollow'; - SET robots = 'noindex, nofollow' IF c.cobrand.moniker == 'emptyhomes'; INCLUDE 'header.html' title = problem_title + rss = [ tprintf(loc('Updates to this problem, %s', "%s is the site name"), site_name), "/rss/$problem.id" ] + robots = 'index, nofollow'; %] -[% IF c.cobrand.moniker != 'emptyhomes' %] - [% map_html %] - </div> -[% END %] - -<div id="side"> +[% map_html %] +</div> [% IF login_success %] <p class='form-success'>[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]</p> + [% INCLUDE 'report/update-form.html' %] + [% SET shown_form = 1 %] +[% ELSIF oauth_failure %] + <p class="form-error">[% loc('Sorry, we could not log you in. Please fill in the form below.') %]</p> + [% INCLUDE 'report/update-form.html' %] + [% SET shown_form = 1 %] +[% ELSIF oauth_need_email %] + <p class="form-error"> + [% loc('Please note your update has <strong>not yet been posted</strong>.') %] + [% loc('We need your email address, please give it below.') %] + </p> + [% INCLUDE 'report/update-form.html' %] + [% SET shown_form = 1 %] [% END %] [% INCLUDE 'report/banner.html' %] [% INCLUDE 'report/_main.html' %] - -<p align="right"> - <small> - <a rel="nofollow" href="[% c.uri_for( '/contact', { id => problem.id } ) %]">[% loc('Offensive? Unsuitable? Tell us' ) %]</a> - </small> -</p> - -[% IF c.cobrand.moniker != 'emptyhomes' %] -<p style="padding-bottom: 0.5em; border-bottom: dotted 1px #999999;" align="right"> - <a href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'More problems nearby' ) %]</a> -</p> - -<div id="alert_links"> - <a rel="nofollow" id="email_alert" href="[% c.uri_for( '/alert/subscribe', { id => problem.id } ) %]">[% loc('Email me updates' ) %]</a> - - <form action="[% c.uri_for( '/alert/subscribe' ) %]" method="post" id="email_alert_box"> - <p>[% loc('Receive email when updates are left on this problem.' ) %]</p> - <label class="n" for="alert_rznvy">[% loc('Email:') %]</label> - <input type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30"> - <input type="hidden" name="id" value="[% problem.id %]"> - <input type="hidden" name="type" value="updates"> - <input type="submit" value="[% loc('Subscribe') %]"> - </form> - - <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" style="vertical-align: middle"> - </a> -</div> - +[% TRY %][% INCLUDE 'report/_message_manager.html' %][% CATCH file %][% END %] +[% INCLUDE 'report/display_tools.html' %] +[% TRY %][% INCLUDE 'report/sharing.html' %][% CATCH file %][% END %] [% INCLUDE 'report/updates.html' %] -[% INCLUDE 'report/update-form.html' %] -[% END %] -</div> +[% IF NOT shown_form %] + [% INCLUDE 'report/update-form.html' %] +[% END %] [% INCLUDE 'footer.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 ‘[% problem.title_safe | html %]’" 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 %]&send=false&layout=button_count&width=90&show_faces=false&action=like&colorscheme=light&font&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/councils_text_none.html b/templates/web/base/report/new/councils_text_none.html index 684879590..6a1a2bc67 100644 --- a/templates/web/base/report/new/councils_text_none.html +++ b/templates/web/base/report/new/councils_text_none.html @@ -5,7 +5,11 @@ "We do not yet have details for the councils that cover this location.", missing_details_bodies.size || all_areas.size ); +%] +[% loc("If you submit a problem here the subject and details of the problem will be public, but the problem will <strong>not</strong> be reported to the council."); +%] +[% tprintf( loc("You can help us by finding a contact email address for local problems for %s and emailing it to us at <a href='mailto:%s'>%s</a>."), missing_details_body_names.join( loc(' or ') ) || all_area_names.join( loc(' or ') ), diff --git a/templates/web/base/report/new/fill_in_details.html b/templates/web/base/report/new/fill_in_details.html index 9d3f52041..55b3a5207 100644 --- a/templates/web/base/report/new/fill_in_details.html +++ b/templates/web/base/report/new/fill_in_details.html @@ -33,11 +33,15 @@ <div id="skipped-map"> [% END %] - [% IF login_success %] - <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"> + [% IF login_success %] + [% PROCESS 'report/new/login_success_form.html' %] + [% ELSIF oauth_need_email %] + [% PROCESS 'report/new/oauth_email_form.html' %] + [% ELSE %] + [% PROCESS 'report/new/fill_in_details_form.html' %] + [% END %] + </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 ee219d563..f9da3753f 100644 --- a/templates/web/base/report/new/fill_in_details_form.html +++ b/templates/web/base/report/new/fill_in_details_form.html @@ -4,200 +4,36 @@ <p class="change_location">[% loc('Wrong location? Just click again on the map.') %]</p> [% END %] -[% IF 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 %] - [% IF js %] - <p id="councils_text">[% - tprintf( - loc('All the information you provide here will be sent to <strong>%s</strong>.'), - loc('the local council') - ); - %] - [% loc('The summary and description will also be made public (see our <a href="/privacy">privacy policy</a>).') %] + <p id="councils_text"> + [% tprintf( + loc('All the information you provide here will be sent to <strong>%s</strong>.'), + loc('the local council') + ); %] + [% 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 %] -<p> -[% IF report.used_map %] - [% INCLUDE 'report/new/fill_in_details_text.html' %] -[% ELSE %] - [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] -[% END %] -</p> - -[% INCLUDE 'errors.html' %] - -<div id="problem_form"> - -[% INCLUDE 'report/new/form_heading.html' %] - -<div class="fieldset"> - - - - - -[% IF field_errors.bodies %] - <div class='form-error'>[% field_errors.bodies %]</div> -[% END %] - -[% IF field_errors.title %] - <div class='form-error'>[% field_errors.title %]</div> -[% END %] - -<div class="form-field"> - <label for="form_title">[% loc('Subject:') %]</label> - <input type="text" value="[% report.title | html %]" name="title" id="form_title" size="25" required> -</div> - -[% IF field_errors.detail %] - <div class='form-error'>[% field_errors.detail %]</div> -[% END %] - -<div class="form-field"> - <label for="form_detail">[% loc('Details:') %]</label> - <textarea name="detail" id="form_detail" rows="7" cols="26" required>[% report.detail | html %]</textarea> -</div> - -[% PROCESS "report/new/category_wrapper.html" %] - -[% IF c.cobrand.allow_photo_upload %] - [% IF field_errors.photo %] - <div class='form-error'>[% field_errors.photo %]</div> - [% END %] - - <div class='form-field'> - [% IF upload_fileid || report.photo %] - <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> - [% IF upload_fileid %] - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]" /> - [% END %] - [% IF report.photo %] - <img align="right" src="/photo/[% report.id %].jpeg" hspace="5"> - [% END %] - [% END %] - - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo" style="width:20em"> - </div> -[% END %] - -[% IF c.user_exists %] - - [% INCLUDE name_phone %] - - [% INCLUDE 'report/new/notes.html' %] - - <p id="problem_submit"> - <input type="submit" value="[% loc('Submit') %]"> - </p> - -[% ELSE %] - - [% IF field_errors.email %] - <div class='form-error'>[% field_errors.email %]</div> - [% END %] - - <div class="form-field"> - <label for="form_email">[% loc('Your email:') %]</label> - <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25" required> - </div> - -[% INCLUDE 'report/new/notes.html' %] - -<div id="form_sign_in"> - <h3>[% loc("Now to submit your report…") %]</h3> - <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2> - - <div id="form_sign_in_yes"> - - [% IF field_errors.password %] - <div class='form-error'>[% field_errors.password %]</div> - [% END %] - - <div class="form-field"> - <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong> I have a password') %]</label> - <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> - </div> - - <div class="fieldset"> - - <p> - <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> - <label class="n" for="remember_me"> - [% loc('Keep me signed in on this computer') %] - </label> - </p> - - <p> - <input type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]"> - </p> - - </div> - - </div> - <div id="form_sign_in_no"> - - <p>[% loc('<strong>No</strong>, let me confirm my report by email:') %]</p> - - <div class="fieldset"> - - [% INCLUDE name_phone %] - - <div class="form-field"> - <label for="password_register">[% loc('Enter a new password:') %]</label> - <input type="password" name="password_register" id="password_register" value="" size="25"> - </div> - - <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> - - <p> - <input type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> - </p> - - </div> - - </div> - -</div> - +[% 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 %] - -[% IF partial_token %] - <input type="hidden" name="partial" value="[% partial_token.token %]"> +[% IF oauth_failure %] + <p class="form-error">[% loc('Sorry, we could not log you in. Please fill in the form below.') %]</p> [% END %] -<input type="hidden" name="submit_problem" value="1"> - -</div> -</div> +[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] +[% INCLUDE 'errors.html' %] -[% BLOCK name_phone %] - [% IF field_errors.name %] - <div class='form-error'>[% field_errors.name %]</div> - [% END %] - - <div class="form-field"> - <label for="form_name">[% loc('Your name:') %]</label> - <input type="text" class="validName" value="[% report.name | html %]" name="name" id="form_name" size="25"> - </div> - - <div class="checkbox"> - [%# if there is nothing in the name field then set check box as default on form %] - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]> - <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> - <br><small>[% loc('(we never show your email address or phone number)') %]</small> - </div> - - <div> - <label for="form_phone">[% loc('Phone:') %]</label> - <input type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" size="15"> - <small>[% loc('(optional)') %]</small> +<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> -[% END %] - +</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..68fb2c796 --- /dev/null +++ b/templates/web/base/report/new/form_report.html @@ -0,0 +1,65 @@ +[% 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 %] + <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"> + <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 %] + +[% 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_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html new file mode 100644 index 000000000..a39200c72 --- /dev/null +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -0,0 +1,38 @@ +<div class="form-box" id="form-box--logged-in-name"> + + <label for="form_email">[% loc('Your email') %]</label> + <input disabled type="text" value="[% c.user.email | html %]"> + + [% INCLUDE 'report/new/extra_name.html' %] + [% PROCESS 'user/_anonymity.html' anonymous = 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="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 for="form_phone">[% loc('Phone number (optional)') %]</label> + <input class="" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + + [% IF c.cobrand.moniker != 'fixmybarangay' || c.user.from_body %] + <div class="general-notes"> + <p>[% loc('We never show your email address or phone number.') %]</p> + </div> + [% END %] + + <div class="form-txt-submit-box"> + <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.html b/templates/web/base/report/new/form_user_loggedout.html new file mode 100644 index 000000000..6657c87a1 --- /dev/null +++ b/templates/web/base/report/new/form_user_loggedout.html @@ -0,0 +1,25 @@ +[% IF c.config.FACEBOOK_APP_ID %] + <h3>[% loc("Now to submit your report…") %]</h3> + + <div class="form-box"> + <button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook"> + <img alt="" src="/i/facebook-icon-32.png" width="17" height="32"> + Log in with Facebook + </button> + </div> + <div id="js-social-email-hide"> + [% PROCESS 'report/new/form_user_loggedout_email.html' required = 0 %] +[% ELSE %] + [% PROCESS 'report/new/form_user_loggedout_email.html' required = 1 %] + <h3>[% loc("Now to submit your report…") %]</h3> +[% END %] + +<div id="form_sign_in"> + <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2> + [% PROCESS 'report/new/form_user_loggedout_password.html' %] + [% PROCESS 'report/new/form_user_loggedout_by_email.html' %] +</div> + +[% IF c.config.FACEBOOK_APP_ID %] + </div> +[% END %] 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..1ad07c540 --- /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' %] + [% PROCESS 'user/_anonymity.html' anonymous = 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..4f816f8cc --- /dev/null +++ b/templates/web/base/report/new/form_user_loggedout_email.html @@ -0,0 +1,9 @@ +<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') %]" + [% IF required %]required[% END %] + class="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/new/login_success_form.html b/templates/web/base/report/new/login_success_form.html new file mode 100644 index 000000000..45d0221a7 --- /dev/null +++ b/templates/web/base/report/new/login_success_form.html @@ -0,0 +1,18 @@ +<h1>[% loc('Report your problem') %]</h1> + +<p class='form-success'>[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]</p> + +[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] + +[% INCLUDE 'errors.html' %] + +<fieldset> + <div id="problem_form"> + [% IF c.user_exists %] + [% PROCESS "report/new/form_user_loggedin.html" %] + [% ELSE %] + [% PROCESS "report/new/form_user_loggedout.html" %] + [% END %] + [% PROCESS 'report/new/form_report.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 new file mode 100644 index 000000000..c897aaeea --- /dev/null +++ b/templates/web/base/report/new/oauth_email_form.html @@ -0,0 +1,26 @@ +<h1>[% loc('Report your problem') %]</h1> + +<p class="form-error"> + [% loc('Please note your report has <strong>not yet been sent</strong>.') %] + [% loc('We need your email address, please give it below.') %] +</p> + +[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] + +[% INCLUDE 'errors.html' %] + +<fieldset> + <div id="problem_form"> + [% PROCESS 'report/new/form_user_loggedout_email.html' required=1 %] + + <div id="form_sign_in"> + <h3>[% loc("Now to submit your report…") %]</h3> + <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2> + [% PROCESS 'report/new/form_user_loggedout_by_email.html' %] + [% PROCESS 'report/new/form_user_loggedout_password.html' %] + </div> + + <input type="hidden" name="oauth_need_email" value="1"> + [% PROCESS 'report/new/form_report.html' %] + </div> +</fieldset> diff --git a/templates/web/base/report/new/sidebar.html b/templates/web/base/report/new/sidebar.html new file mode 100644 index 000000000..083c7db70 --- /dev/null +++ b/templates/web/base/report/new/sidebar.html @@ -0,0 +1,14 @@ +<div id="report-a-problem-sidebar"> + <div class="sidebar-tips"> + <p> + [% IF report.used_map %] + [% INCLUDE 'report/new/fill_in_details_text.html' %] + [% ELSE %] + [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] + [% END %] + </p> + </div> + <div class="sidebar-notes"> + [% INCLUDE 'report/new/notes.html' %] + </div> +</div> diff --git a/templates/web/base/report/photo.html b/templates/web/base/report/photo.html index 094f677d8..52e6ed64a 100644 --- a/templates/web/base/report/photo.html +++ b/templates/web/base/report/photo.html @@ -1,21 +1,15 @@ [% IF c.cobrand.allow_photo_display(object) && object.photo %] - [% IF object.can('get_photoset') %] - [% FOR photo IN object.get_photoset(c).images %] + [% IF object.photos.size > 1 %] + <div class="update-img-set"> + [% END %] + [% FOR photo IN object.photos %] <div class="update-img"> - <a href="[% c.cobrand.base_url %]/photo/[% object.id %].[% loop.index %].full.jpeg?[% photo.0 %]" rel="fancy"> - <img alt="Photo of this report" src="[% c.cobrand.base_url %]/photo/[% object.id %].[% loop.index %].jpeg?[% photo.0 %]"> + <a href="[% c.cobrand.base_url %][% photo.url_full %]" rel="fancy"> + <img alt="Photo of this report" src="[% c.cobrand.base_url %][% photo.url %]"> <span>zoom</span></a> </div> - [% END %] - [% ELSE %] - [%# e.g. comments %] - [% photo = object.get_photo_params %] - <div class="update-img"> - [% IF photo.url_full %]<a href="[% photo.url_full %]" rel="fancy">[% END %] - <img alt="Photo of this report" - [%- IF photo.height %]height="[% photo.height %]" width="[% photo.width %]"[% END -%] - src="[% photo.url %]"> - [%- IF photo.url_full %]<span>zoom</span></a>[% END %] + [% END %] + [% IF object.photos.size > 1 %] </div> - [% END %] + [% END %] [% END %] diff --git a/templates/web/base/report/public_label.html b/templates/web/base/report/public_label.html new file mode 100644 index 000000000..2e00a79d2 --- /dev/null +++ b/templates/web/base/report/public_label.html @@ -0,0 +1 @@ +<span class="muted label-warning public-warning">[% loc('(public)') %]</span> diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html index 3115855d3..3e0ac890b 100644 --- a/templates/web/base/report/update-form.html +++ b/templates/web/base/report/update-form.html @@ -1,166 +1,42 @@ -<div id="update_form"> +[% allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_body) %] +[% RETURN IF NOT allow_creation %] +<div id="update_form"> + [% IF NOT login_success AND NOT oauth_need_email %] <h2>[% loc( 'Provide an update') %]</h2> - [% IF c.cobrand.moniker != 'emptyhomes' %] - <p> - <small>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</small> - </p> + [% IF c.cobrand.moniker != 'emptyhomes' AND c.cobrand.moniker != 'stevenage' %] + <div class="general-notes"> + [% INCLUDE 'report/updates-sidebar-notes.html' %] + </div> [% END %] + [% END %] [% INCLUDE 'errors.html' %] - <form method="post" action="[% c.uri_for( '/report/update' ) %]" name="updateForm" class="fieldset validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> - - <input type="hidden" name="submit_update" value="1"> - <input type="hidden" name="id" value="[% problem.id | html %]"> - - [% IF field_errors.update %] - <div class='form-error'>[% field_errors.update %]</div> - [% END %] - <div class="form-field"> - <label for="form_update">[% loc( 'Update:' ) %]</label> - <textarea name="update" id="form_update" rows="7" cols="30" required>[% update.text | html %]</textarea> - </div> - - [% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %] - <div class="form-field"> - <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> - </div> - [% ELSE %] - [% IF problem.is_fixed AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %] - <div class="checkbox"> - <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> + <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> + [% IF NOT login_success AND NOT oauth_need_email %] + [% INCLUDE 'report/update/form_update.html' %] + [% END %] + [% IF c.user_exists %] + [% INCLUDE 'report/update/form_name.html' %] + <div class="cf"><input class="final-submit green-btn" type="submit" id="update_post" value="[% loc('Post') %]"></div> + [% ELSIF oauth_need_email %] + [% INCLUDE 'report/update/form_user_loggedout_email.html' required = 1 %] + <div id="form_sign_in"> + <h3>[% loc("Now to submit your update…") %]</h3> + <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2> + [% INCLUDE 'report/update/form_user_loggedout_by_email.html' %] + [% INCLUDE 'report/update/form_user_loggedout_password.html' %] + <input type="hidden" name="oauth_need_email" value="1"> </div> - [% ELSIF !problem.is_fixed %] - <div class="checkbox"> - <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.cobrand.allow_photo_upload %] - [% IF field_errors.photo %] - <div class='form-error'>[% field_errors.photo %]</div> - [% END %] - <div id="fileupload_normalUI"> - [% IF upload_fileid %] - <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - [% END %] - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo" style="width:20em"> - </div> - [% END %] - -[% IF c.user_exists %] - - [% INCLUDE name %] - - <div class="checkbox"> - <input type="submit" id="update_post" value="[% loc('Post') %]"> - </div> - -[% ELSE %] - - [% IF field_errors.email %] - <div class='form-error'>[% field_errors.email %]</div> - [% END %] - <div class="form-field"> - <label for="form_rznvy">[% loc('Your email:' ) %]</label> - <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30" required> - </div> - -<div id="form_sign_in"> - <h3>[% loc("Now to submit your update…") %]</h3> - <h2>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h2> - - <div id="form_sign_in_yes"> - - [% IF field_errors.password %] - <div class='form-error'>[% field_errors.password %]</div> - [% END %] - - <p> - <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong> I have a password') %]</label> - <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> - </p> - - <div class="fieldset"> - - <p> - <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> - <label class="n" for="remember_me"> - [% loc('Keep me signed in on this computer') %] - </label> - </p> - - <p> - <input type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]"> - </p> - - </div> - - </div> - <div id="form_sign_in_no"> - - <p>[% loc('<strong>No</strong>, let me confirm my update by email:') %]</p> - - <div class="fieldset"> - - [% INCLUDE name %] - - <div class="form-field"> - <label for="password_register">[% loc('Enter a new password:') %]</label> - <input type="password" name="password_register" id="password_register" value="" size="25"> - </div> - - <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> - - <p> - <input type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]"> - </p> - - </div> - - </div> - -</div> - -[% END %] - + [% ELSE %] + [% INCLUDE 'report/update/form_user_loggedout.html' %] + [% END %] + [% IF login_success OR oauth_need_email %] + [% INCLUDE 'report/update/form_update.html' %] + [% END %] + </fieldset> </form> </div> - -[% BLOCK name %] - [% IF field_errors.name %] - <div class='form-error'>[% field_errors.name %]</div> - [% END %] - - <div> - <label for="form_name">[% loc('Your name:') %]</label> - <input type="text" name="name" id="form_name" value="[% update.name || c.user.name | html %]" size="25"> - </div> - - <div class="checkbox"> - <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 for="form_may_show_name">[% loc('Show my name publicly') %]</label> - <small>[% loc('(we never show your email)') %]</small> - </div> - - <div class="checkbox"> - <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.html b/templates/web/base/report/update.html index a5fd97870..a09913d39 100644 --- a/templates/web/base/report/update.html +++ b/templates/web/base/report/update.html @@ -1,24 +1,70 @@ +[% moderating = c.user && c.user.has_permission_to('moderate', problem.bodies_str) %] + [% IF loop.first %] -<div id="updates"> - <h2 class="problem-update-list-header">[% loc('Updates') %]</h2> +<section class="full-width"> + <h4 class="static-with-rule">[% loc('Updates') %]</h4> + <ul class="item-list item-list--updates"> [% END %] - <div><div class="problem-update"><p><a name="update_[% update.id %]"></a><em> - [% INCLUDE meta_line %] - </em></p></div> -[% IF NOT update.whenanswered %] - - [% INCLUDE 'report/photo.html' object=update %] - - <div class="update-text"> - [% add_links( update.text ) | html_para %] - - [% IF c.cobrand.allow_update_reporting %] - <p align="right"> - <small><a rel="nofollow" class="unsuitable-problem" href="[% c.uri_for( '/contact', { id => update.problem_id, update_id => update.id } ) %]">[% loc('Offensive? Unsuitable? Tell us') %]</a></small> - </p> - [% END %] - </div> + <li class="item-list__item item-list__item--updates"> + [% IF moderating; original_update = update.moderation_original_data %] + <form method="post" action="/moderate/report/[% problem.id %]/update/[% update.id %]"> + <input type="button" class="btn moderate moderate-display" value="moderate"> + <div class="moderate-edit"> + <input type="checkbox" class="hide-document" name="update_hide"> + <label for="update_hide">Hide update completely?</label> + <br /> + <input type="checkbox" name="update_show_name" [% update.anonymous ? '' : 'checked' %]> + <label for="update_show_name">Show name publicly?</label> + [% IF update.photo or original_update.photo %] + <br /> + <input type="checkbox" name="update_show_photo" [% update.photo ? 'checked' : '' %]> + <label for="update_show_photo">Show Photo?</label> + [% END %] + </div> + [% END %] + <div class="item-list__update-wrap"> + [% IF update.whenanswered %] + <div class="item-list__update-text"> + <p class="meta-2"> [% INCLUDE meta_line %] </p> + </div> + [% ELSE %] + <a name="update_[% update.id %]" class="internal-link-fixed-header"></a> + [% INCLUDE 'report/photo.html' object=update %] + <div class="item-list__update-text"> + <div class="moderate-display"> + [% add_links( update.text ) | html_para %] + </div> + [% IF moderating %] + <div class="moderate-edit"> + [% IF update.text != original.detail %] + <input type="checkbox" name="update_revert_detail" class="revert-textarea"> + <label for="update_revert_detail">Revert to original</label> + [% END %] + <textarea name="update_detail">[% add_links( update.text ) %]</textarea> + </div> + [% END %] + <p class="meta-2"> + [% INCLUDE meta_line %] + [% mlog = update.latest_moderation_log_entry(); IF mlog %] + <br /> Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %] + [% END %] + </p> + </div> + [% END %] + </div> + [% IF moderating %] + <div class="moderate-edit"> + <label for="moderation_reason">Moderation reason:</label> + <input type="text" name="moderation_reason" + placeholder="Describe why you are moderating this"> + <input type="submit" class="red-btn" value="moderate it"> + <input type="button" class="btn cancel" value="cancel"> + </div> + </form> + [% END %] + </li> +[% IF loop.last %] + </ul> +</section> [% END %] - </div> -[% '</div>' IF loop.last %] 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..4cb3e516c --- /dev/null +++ b/templates/web/base/report/update/form_name.html @@ -0,0 +1,22 @@ +[% INCLUDE 'report/new/extra_name.html' %] + +[% PROCESS 'user/_anonymity.html' anonymous = 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..f7072ae18 --- /dev/null +++ b/templates/web/base/report/update/form_update.html @@ -0,0 +1,58 @@ +<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 %] + <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"> + <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 %] + +<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..4176633f1 --- /dev/null +++ b/templates/web/base/report/update/form_user_loggedout.html @@ -0,0 +1,24 @@ +[% IF c.config.FACEBOOK_APP_ID %] + <h3>[% loc("Now to submit your update…") %]</h3> + <div class="form-box"> + <button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook"> + <img alt="" src="/i/facebook-icon-32.png" width="17" height="32"> + Log in with Facebook + </button> + </div> + <div id="js-social-email-hide"> + [% INCLUDE 'report/update/form_user_loggedout_email.html' required=0 %] +[% ELSE %] + [% INCLUDE 'report/update/form_user_loggedout_email.html' required=1 %] + <h3>[% loc("Now to submit your update…") %]</h3> +[% END %] + +<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> + +[% IF c.config.FACEBOOK_APP_ID %] + </div> +[% END %] 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..95a3b5578 --- /dev/null +++ b/templates/web/base/report/update/form_user_loggedout_email.html @@ -0,0 +1,9 @@ +<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' ) %]" + [% IF required %]required[% END %] + class="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..103df1098 --- /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 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/updates-sidebar-notes.html b/templates/web/base/report/updates-sidebar-notes.html new file mode 100644 index 000000000..1426e4d71 --- /dev/null +++ b/templates/web/base/report/updates-sidebar-notes.html @@ -0,0 +1,4 @@ +<p> + [% loc( 'Please note that updates are not sent to the council.' ) %] + [% loc( 'Your information will only be used in accordance with our <a href="/privacy">privacy policy</a>' ) %] +</p> diff --git a/templates/web/base/static/about-en-gb.html b/templates/web/base/static/about-en-gb.html deleted file mode 100644 index 9c319f051..000000000 --- a/templates/web/base/static/about-en-gb.html +++ /dev/null @@ -1,9 +0,0 @@ -[% INCLUDE 'header.html', title => loc('About us') %] - -<h1>[% loc('About us') %]</h1> - -<h2>FixMyStreet.com</h2> - -[%# FIXME - put in blurb here %] - -[% INCLUDE 'footer.html' %] diff --git a/templates/web/base/status/index.html b/templates/web/base/status/index.html index 9ed4292b7..34bf62056 100644 --- a/templates/web/base/status/index.html +++ b/templates/web/base/status/index.html @@ -7,13 +7,6 @@ <dd>[% git_version || 'unknown' %]</dd> </dl> -<ul> - <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]</li> - <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li> - <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li> - <li>[% tprintf( loc('%d questionnaires sent – %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li> - <li>[% tprintf( '%d bodies', total_bodies) %], - [% tprintf( loc('%d council contacts – %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li> -</ul> +[% INCLUDE 'status/stats.html' %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/status/stats.html b/templates/web/base/status/stats.html new file mode 100644 index 000000000..f847db2ef --- /dev/null +++ b/templates/web/base/status/stats.html @@ -0,0 +1,28 @@ +[% USE Number.Format %] + +[%- + total_problems_live = total_problems_live | format_number; + total_problems_users = total_problems_users | format_number; + comments_confirmed = (comments.confirmed || 0) | format_number; + alerts_1 = alerts.1 | format_number; + alerts_0 = alerts.0 | format_number; + questionnaires_total = questionnaires.total | format_number; + questionnaires_1 = questionnaires.1 | format_number; + total_bodies = total_bodies | format_number; + contacts_total = contacts.total | format_number; + contacts_1 = contacts.1 | format_number; + contacts_0 = contacts.0 | format_number; +-%] + +<ul> + <li>[% tprintf( loc('<strong>%s</strong> live problems'), decode(total_problems_live) ) %] + [% IF admin_include_users %] + [% tprintf( loc('from %s different users'), decode(total_problems_users) ) %] + [% END %] + </li> + <li>[% tprintf( loc('%s live updates'), decode(comments_confirmed) ) %]</li> + <li>[% tprintf( loc('%s confirmed alerts, %s unconfirmed'), decode(alerts_1), decode(alerts_0)) %]</li> + <li>[% tprintf( loc('%s questionnaires sent – %s answered (%s%%)'), decode(questionnaires_total), decode(questionnaires_1), questionnaires_pc) %]</li> + <li>[% tprintf( loc('%s bodies'), decode(total_bodies)) %], + [% tprintf( loc('%s council contacts – %s confirmed, %s unconfirmed'), decode(contacts_total), decode(contacts_1), decode(contacts_0)) %]</li> +</ul> diff --git a/templates/web/base/tokens/error.html b/templates/web/base/tokens/error.html index e3fa6c170..726ec1598 100644 --- a/templates/web/base/tokens/error.html +++ b/templates/web/base/tokens/error.html @@ -1,9 +1,9 @@ -[% INCLUDE 'header.html', title => loc('Error') %] +[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Error') %] +[% contact_url = c.uri_for('/contact') %] -<h1>[% loc('Error') %]</h1> - -[% contact_url = c.uri_for('/contact'); %] - -<p>[% tprintf( loc('Thank you for trying to confirm your update or problem. We seem to have an error ourselves though, so <a href="%s">please let us know what went on</a> and we\'ll look into it.'), contact_url ) %]</p> +<div class="confirmation-header confirmation-header--failure"> + <h1>[% loc('Error') %]</h1> + <p>[% tprintf( loc('Thank you for trying to confirm your update or problem. We seem to have an error ourselves though, so <a href="%s">please let us know what went on</a> and we\'ll look into it.'), contact_url ) %]</p> +</div> [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/user/_anonymity.html b/templates/web/base/user/_anonymity.html new file mode 100644 index 000000000..cc3630f16 --- /dev/null +++ b/templates/web/base/user/_anonymity.html @@ -0,0 +1,11 @@ +[% + IF c.cobrand.default_show_name AND anonymous==''; + IF c.user_exists; + SET name_public = NOT c.user.latest_anonymity; + ELSE; + SET name_public = 1; + END; + ELSE; + SET name_public = anonymous==0; + END +%] |