diff options
author | Zarino Zappia <mail@zarino.co.uk> | 2016-09-15 14:55:33 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-20 15:43:20 +0100 |
commit | b22bcd1b07fa6806a845c6d19203860e65c16e82 (patch) | |
tree | a870e82c19dde766d538d589ba7106d112976ad5 | |
parent | 6a8c7766dc41b1338f1fcb3bc43225e72bd56480 (diff) |
[Bromley] Upgrade to new style reporting form
Bromley previously had an override for fill_in_details_form.html, just
so that it could display a custom sign-in arrangement.
Now that the core fill_in_details_form.html delegates the sign-in stuff
to form_user.html, Bromley can override just that template, and inherit
all the other reporting form goodness from core.
-rw-r--r-- | templates/web/bromley/report/new/fill_in_details_form.html | 214 | ||||
-rw-r--r-- | templates/web/bromley/report/new/form_user.html | 126 |
2 files changed, 126 insertions, 214 deletions
diff --git a/templates/web/bromley/report/new/fill_in_details_form.html b/templates/web/bromley/report/new/fill_in_details_form.html deleted file mode 100644 index d89e5d3d5..000000000 --- a/templates/web/bromley/report/new/fill_in_details_form.html +++ /dev/null @@ -1,214 +0,0 @@ -<div id="report-a-problem-main"> - [% IF report.used_map %] - <p class="change_location">[% loc('Wrong location? Just click again on the map.') %]</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') - ); - %] - Details of the problem will be public, plus your name if you give us permission. - </p> - [% ELSE %] - [% PROCESS 'report/new/councils_text.html' %] - [% END %] - - <div> - [% IF report.used_map %] - [% 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 %] - [% ELSE %] - <p> - [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] - </p> - [% END %] - </div> - - [% 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 %] - - - - <label for="form_title">[% loc('Subject') %]</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('Provide a title') %]" required> - - [% IF c.cobrand.allow_photo_upload %] - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - <label for="form_photo"> - <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span> - </label> - - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - - <div id="form_photos"> - [% IF upload_fileid %] - <p>[% loc('You have already attached photos to this 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/temp.[% id %]" alt=""> - [% END %] - [% END %] - <input type="file" name="photo1" id="form_photo"> - <label for="form_photo2">[% loc('Photo') %]</label> - <input type="file" name="photo2" id="form_photo2"> - <label for="form_photo3">[% loc('Photo') %]</label> - <input type="file" name="photo3" id="form_photo3"> - </div> - [% END %] - - [% TRY %][% PROCESS 'report/new/after_photo.html' %][% CATCH file %][% END %] - - <label for="form_detail">[% loc('Details') %]</label> - [% IF report.used_map %] - <p> - We won’t be able to help unless you leave as much - detail as you can. <strong>Please remember the content of this report will be public.</strong> - </p> - [% END %] - [% 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('Please describe the exact location of the report. Example: “2 dumped mattresses outside Number 19 Stockwell Close”') %]" required>[% report.detail | html %]</textarea> - - [% PROCESS "report/new/category_wrapper.html" %] - - [% IF c.user_exists %] - <div class="form-box"> - [% INCLUDE 'report/new/extra_name.html' %] - - [% names = c.user.split_name %] - <label for="form_first_name">[% loc('First Name') %]</label> - [% IF field_errors.first_name %] - <p class='form-error'>[% field_errors.first_name %]</p> - [% END %] - <input class="js-form-name" type="text" value="[% ( first_name || names.first ) | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]"> - - <label for="form_last_name">[% loc('Last Name') %]</label> - [% IF field_errors.last_name %] - <p class='form-error'>[% field_errors.last_name %]</p> - [% END %] - <input class="js-form-name" type="text" value="[% ( last_name || names.last ) | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last 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 !report.anonymous %]> - <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') %]"> - - <div class="general-notes"> - <p>[% loc('We never show your email address or phone number.') %]</p> - </div> - - <div class="form-txt-submit-box"> - <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> - </div> - </div> - [% ELSE %] - - <label for="form_email">[% loc('Your email') %]</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> - - <div id="form_sign_in"> - - <p>To submit your report you now need to confirm it either by email or by using a FixMyStreet password.</p> - - <div id="form_sign_in_no" class="form-box"> - <h5>Confirm my report by email</h5> - - [% INCLUDE 'report/new/extra_name.html' %] - - <label for="form_first_name">[% loc('First Name') %]</label> - [% IF field_errors.first_name %] - <p class='form-error'>[% field_errors.first_name %]</p> - [% END %] - <input type="text" class="form-focus-trigger js-form-name" value="[% first_name | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]"> - - <label for="form_last_name">[% loc('Last Name') %]</label> - [% IF field_errors.last_name %] - <p class='form-error'>[% field_errors.last_name %]</p> - [% END %] - <input type="text" class="form-focus-trigger js-form-name" value="[% last_name | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last 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 !report.anonymous %]> - <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 future 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 js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> - </div> - </div> - - <div id="form_sign_in_yes" class="form-box"> - - <h5>Confirm my report with my FixMyStreet password</h5> - - <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label> - <div class="form-txt-submit-box"> - [% IF field_errors.password %] - <p class='form-error'>[% field_errors.password %]</p> - [% END %] - <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value=""> - <input class="green-btn js-submit_sign_in" type="submit" 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> - - </div> - - [% END %] - - <p>[% loc("We will only use your personal information in accordance with our <a href=\"/faq#privacy\">privacy policy.</a>") %]</p> - - </div> - </fieldset> - - [% IF partial_token %] - <input type="hidden" name="partial" value="[% partial_token.token %]"> - [% END %] - - <input type="hidden" name="submit_problem" value="1"> -</div> diff --git a/templates/web/bromley/report/new/form_user.html b/templates/web/bromley/report/new/form_user.html new file mode 100644 index 000000000..71dedc600 --- /dev/null +++ b/templates/web/bromley/report/new/form_user.html @@ -0,0 +1,126 @@ +[%# + Bromley overrides form_user.html so that they link to their own + privacy statement in /faq#privacy, swap the order of the "confirm + by email" and "confirm by password" boxes, and ask people for their + title, first name, and last name separately. +%] + +<h2 class="form-section-heading form-section-heading--private">Private details</h2> +<p class="form-section-description"> + [% tprintf( + loc('These will be sent to the council, but will never be shown online. <a href="%s">(See our privacy policy.)</a>') + '/faq#privacy' + ); %] +</p> + +[% IF c.user_exists %] + <div class="form-box"> + [% INCLUDE 'report/new/extra_name.html' %] + + [% names = c.user.split_name %] + <label for="form_first_name">[% loc('First Name') %]</label> + [% IF field_errors.first_name %] + <p class='form-error'>[% field_errors.first_name %]</p> + [% END %] + <input class="form-control js-form-name" type="text" value="[% ( first_name || names.first ) | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]"> + + <label for="form_last_name">[% loc('Last Name') %]</label> + [% IF field_errors.last_name %] + <p class='form-error'>[% field_errors.last_name %]</p> + [% END %] + <input class="form-control js-form-name" type="text" value="[% ( last_name || names.last ) | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last 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 !report.anonymous %]> + <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="form-control" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + + <div class="general-notes"> + <p>[% loc('We never show your email address or phone number.') %]</p> + </div> + + <div class="form-txt-submit-box"> + <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> + </div> + </div> +[% ELSE %] + + <label for="form_email">[% loc('Your email') %]</label> + [% IF field_errors.email %] + <p class='form-error'>[% field_errors.email %]</p> + [% END %] + <input class="form-control" type="email" value="[% report.user.email | html %]" name="email" id="form_email" placeholder="[% loc('Please enter your email address') %]" required> + + <div id="form_sign_in"> + + <p>To submit your report you now need to confirm it either by email or by using a FixMyStreet password.</p> + + <div id="form_sign_in_no" class="form-box"> + <h5>Confirm my report by email</h5> + + [% INCLUDE 'report/new/extra_name.html' %] + + <label for="form_first_name">[% loc('First Name') %]</label> + [% IF field_errors.first_name %] + <p class='form-error'>[% field_errors.first_name %]</p> + [% END %] + <input type="text" class="form-control form-focus-trigger js-form-name" value="[% first_name | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]"> + + <label for="form_last_name">[% loc('Last Name') %]</label> + [% IF field_errors.last_name %] + <p class='form-error'>[% field_errors.last_name %]</p> + [% END %] + <input type="text" class="form-control form-focus-trigger js-form-name" value="[% last_name | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last 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 !report.anonymous %]> + <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-control 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 future problems, leave updates and manage your reports.') %]</p> + </div> + + <div class="form-txt-submit-box form-focus-hidden"> + <input class="form-control" type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> + </div> + </div> + + <div id="form_sign_in_yes" class="form-box"> + + <h5>Confirm my report with my FixMyStreet password</h5> + + <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label> + <div class="form-txt-submit-box"> + [% IF field_errors.password %] + <p class='form-error'>[% field_errors.password %]</p> + [% END %] + <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value=""> + <input class="green-btn js-submit_sign_in" type="submit" 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> + + </div> + +[% END %] |