diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/auth/change_password.html | 20 | ||||
-rw-r--r-- | templates/web/base/auth/change_phone.html | 2 | ||||
-rw-r--r-- | templates/web/base/auth/general.html | 12 | ||||
-rw-r--r-- | templates/web/base/js/translation_strings.html | 6 | ||||
-rw-r--r-- | templates/web/base/report/_inspect.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/new/form_user_loggedin.html | 4 | ||||
-rw-r--r-- | templates/web/base/report/new/form_user_loggedout_by_email.html | 11 | ||||
-rw-r--r-- | templates/web/base/report/update/form_user_loggedout_by_email.html | 9 | ||||
-rw-r--r-- | templates/web/bromley/report/new/form_user.html | 10 | ||||
-rw-r--r-- | templates/web/bromley/report/update-form.html | 10 | ||||
-rw-r--r-- | templates/web/fixamingata/report/new/form_user_loggedout.html | 13 | ||||
-rw-r--r-- | templates/web/zurich/auth/general.html | 21 |
12 files changed, 92 insertions, 28 deletions
diff --git a/templates/web/base/auth/change_password.html b/templates/web/base/auth/change_password.html index a32dbaf9c..7a38e0134 100644 --- a/templates/web/base/auth/change_password.html +++ b/templates/web/base/auth/change_password.html @@ -1,7 +1,9 @@ [% SET bclass = 'authpage'; SET bclass = 'fullwidthpage' IF password_changed; -INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass +SET title = loc('Set password'); +SET title = loc('Change password') IF c.user.password; +INCLUDE 'header.html', title = title bodyclass = bclass %] [% IF password_changed %] @@ -13,13 +15,15 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass [% ELSE %] -<h1>[% loc('Change password') %]</h1> +<h1>[% title %]</h1> <form action="[% c.uri_for_action('/auth/profile/change_password') %]" method="post" name="change_password" class="fieldset"> <input type="hidden" name="token" value="[% csrf_token %]"> <fieldset> - [% IF password_error; + [% IF password_error == 'failed' %] + <div class="form-error">[% field_errors.password_register %]</div> + [% ELSIF password_error; errors = { missing => loc('Please enter a password'), @@ -31,6 +35,14 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass <div class="form-error">[% loc_password_error %]</div> [% END %] +[% IF c.user.password %] + <div class="form-field"> + <label for="current_password">[% loc('Current password:') %]</label> + <input class="form-control" type="password" name="current_password" value="[% current_password | html %]"> + </div> + <hr> +[% END %] + <div class="form-field"> <label for="new_password">[% loc('New password:') %]</label> <input class="form-control" type="password" name="new_password" value="[% new_password | html %]"> @@ -40,7 +52,7 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass <input class="form-control" type="password" name="confirm" value="[% confirm | html %]"> </div> <div class="final-submit"> - <input type="submit" class="btn" value="[% loc('Change password') %]"> + <input type="submit" class="btn" value="[% title %]"> </div> </fieldset> diff --git a/templates/web/base/auth/change_phone.html b/templates/web/base/auth/change_phone.html index 27a2f63dd..62e9fa6d6 100644 --- a/templates/web/base/auth/change_phone.html +++ b/templates/web/base/auth/change_phone.html @@ -18,7 +18,7 @@ END [% IF c.user.phone_verified OR (c.user.phone AND NOT verifying) %] [% loc('Your phone number') %]: [% c.user.phone_display %] [% ELSIF c.user.phone %] -[% DEFAULT username = c.user.phone %] +[% DEFAULT username = c.user.phone_display %] [% END %] <form method="post" name="change_phone"> diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html index 8fc5578c1..1e44bb68e 100644 --- a/templates/web/base/auth/general.html +++ b/templates/web/base/auth/general.html @@ -60,7 +60,9 @@ [% INCLUDE form_sign_in_yes %] <input type="hidden" name="oauth_need_email" value="1"> [% ELSE %] + [% IF NOT field_errors.password_register %] [% INCLUDE form_sign_in_yes %] + [% END %] [% INCLUDE form_sign_in_no %] [% END %] </div> @@ -114,14 +116,22 @@ <input class="form-control" type="text" name="name" value="" placeholder="[% loc('Your name') %]"> <label for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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 class="form-txt-submit-box"> - <input class="form-control" type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input class="form-control js-password-validate" type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> <input class="green-btn" type="submit" name="sign_in_by_code" value="[% loc('Sign in') %]"> </div> + + <div class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> [% END %] diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index ed95335a6..a2e3c16c5 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -1,4 +1,7 @@ [% FILTER collapse %] +var fixmystreet = fixmystreet || {}; +fixmystreet.password_minimum_length = [% c.cobrand.password_minimum_length %]; + translation_strings = { update: '[% loc('Please enter a message') | replace("'", "\\'") %]', title: '[% loc('Please enter a subject') | replace("'", "\\'") %]', @@ -19,6 +22,9 @@ password_sign_in: { required: '[% loc('Please enter a password') | replace("'", "\\'") %]' }, + password_register: { + short: '[% tprintf(loc('Please make sure your password is at least %d characters long'), c.cobrand.password_minimum_length) | replace("'", "\\'") %]', + }, phone: { required: '[% loc('Please enter your phone number') | replace("'", "\\'") %]' }, diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 5088332ce..eb2564157 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -17,7 +17,7 @@ [% IF permissions.report_inspect AND problem.user.phone %] <p> <strong>[% loc('Phone Reporter:') %]</strong> - <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone | html %]</a> + <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone_display | html %]</a> </p> [% END %] <p> diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index bd4ce1cf7..04a93ef74 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -31,7 +31,7 @@ [% IF c.user.phone_verified %] <label for="form_phone">[% loc('Phone number') %]</label> - <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone | html %]"> + <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone_display | html %]"> [% END %] [% IF c.user.email_verified %] @@ -65,7 +65,7 @@ [% IF NOT c.user.phone_verified %] <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"> + <input class="form-control" type="text" value="[% report.user.phone_display | html %]" name="phone" id="form_phone"> [% END %] [% IF NOT c.user.email_verified %] <label for="form_username">[% loc('Email address (optional)') %]</label> 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 index e9519f573..975dbe704 100644 --- a/templates/web/base/report/new/form_user_loggedout_by_email.html +++ b/templates/web/base/report/new/form_user_loggedout_by_email.html @@ -36,13 +36,20 @@ </div> <label class="form-focus-hidden" for="password_register">[% loc('Password (optional)') %]</label> - + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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 class="form-control" type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input class="form-control js-password-validate" 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 class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> diff --git a/templates/web/base/report/update/form_user_loggedout_by_email.html b/templates/web/base/report/update/form_user_loggedout_by_email.html index 7d10fe391..d038cdb23 100644 --- a/templates/web/base/report/update/form_user_loggedout_by_email.html +++ b/templates/web/base/report/update/form_user_loggedout_by_email.html @@ -8,14 +8,21 @@ [% INCLUDE 'report/update/form_name.html' %] <label for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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" class="form-control" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input type="password" class="form-control js-password-validate" 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('Post') %]"> </div> + <div class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> diff --git a/templates/web/bromley/report/new/form_user.html b/templates/web/bromley/report/new/form_user.html index e6749f5ab..cce985c95 100644 --- a/templates/web/bromley/report/new/form_user.html +++ b/templates/web/bromley/report/new/form_user.html @@ -91,15 +91,23 @@ </div> <label class="form-focus-hidden" for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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="form-control js-password-validate" 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 class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> <div id="form_sign_in_yes" class="form-box"> diff --git a/templates/web/bromley/report/update-form.html b/templates/web/bromley/report/update-form.html index 45d7aed5e..9778a0db3 100644 --- a/templates/web/bromley/report/update-form.html +++ b/templates/web/bromley/report/update-form.html @@ -98,15 +98,23 @@ [% INCLUDE 'report/update/form_name.html' %] <label for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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" class="form-control" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input type="password" class="form-control js-password-validate" 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('Post') %]"> </div> + + <div class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> <div id="form_sign_in_yes" class="form-box"> <h5>Confirm my report with my FixMyStreet password</h5> diff --git a/templates/web/fixamingata/report/new/form_user_loggedout.html b/templates/web/fixamingata/report/new/form_user_loggedout.html index 1f7cf2aeb..bbb9864a3 100644 --- a/templates/web/fixamingata/report/new/form_user_loggedout.html +++ b/templates/web/fixamingata/report/new/form_user_loggedout.html @@ -27,23 +27,32 @@ </div> <label for="form_phone">[% loc('Phone number (optional)') %]</label> - <input type="text" class="form-control" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + <input type="text" class="form-control" value="[% report.user.phone_display | 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 for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <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"> - <input type="password" class="form-control" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input type="password" class="form-control js-password-validate" 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 class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> + <div id="form_sign_in_yes" class="form-box"> <h5>Jag har ett lösenord sedan tidigare:</h5> diff --git a/templates/web/zurich/auth/general.html b/templates/web/zurich/auth/general.html index 899f0ca71..555a72374 100644 --- a/templates/web/zurich/auth/general.html +++ b/templates/web/zurich/auth/general.html @@ -1,16 +1,6 @@ [% INCLUDE 'header.html', title = loc('Sign in or create an account') %] -[% IF username_error; - - # other keys include fqdn, mxcheck if you'd like to write a custom error message - - errors = { - missing_email = loc('Please enter your email'), - other_email = loc('Please check your email address is correct') - }; - - loc_username_error = errors.$username_error || errors.other_email; -END %] +[% loc_username_error = INCLUDE 'auth/_username_error.html' default='email' %] <form action="/auth" method="post" name="general_auth_login" class="validate"> <fieldset> @@ -61,11 +51,18 @@ END %] <input type="text" class="required" name="name" value="" placeholder="[% loc('Your name') %]"> <label for="password_register">[% loc('Password (optional)') %]</label> + [% IF field_errors.password_register %] + <p class='form-error'>[% field_errors.password_register %]</p> + [% END %] <div class="form-txt-submit-box"> - <input type="password" class="required" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input type="password" class="required js-password-validate" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> <input class="green-btn" type="submit" name="sign_in_by_code" value="Registrieren"> </div> + <div class="general-notes"> + <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p> + </div> + </div> </fieldset> </form> |