aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/auth/change_password.html4
-rw-r--r--templates/web/base/auth/general.html12
-rw-r--r--templates/web/base/js/translation_strings.html6
-rw-r--r--templates/web/base/report/new/form_user_loggedout_by_email.html11
-rw-r--r--templates/web/base/report/update/form_user_loggedout_by_email.html9
-rw-r--r--templates/web/bromley/report/new/form_user.html10
-rw-r--r--templates/web/bromley/report/update-form.html10
-rw-r--r--templates/web/fixamingata/report/new/form_user_loggedout.html11
-rw-r--r--templates/web/zurich/auth/general.html21
9 files changed, 74 insertions, 20 deletions
diff --git a/templates/web/base/auth/change_password.html b/templates/web/base/auth/change_password.html
index bf361ff2d..7a38e0134 100644
--- a/templates/web/base/auth/change_password.html
+++ b/templates/web/base/auth/change_password.html
@@ -21,7 +21,9 @@ INCLUDE 'header.html', title = title bodyclass = bclass
<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'),
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/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 a324bbeb4..bbb9864a3 100644
--- a/templates/web/fixamingata/report/new/form_user_loggedout.html
+++ b/templates/web/fixamingata/report/new/form_user_loggedout.html
@@ -34,16 +34,25 @@
</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>