aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/auth/_username_error.html2
-rw-r--r--templates/web/base/auth/create.html63
-rw-r--r--templates/web/base/auth/general.html79
-rw-r--r--templates/web/zurich/auth/general.html7
4 files changed, 88 insertions, 63 deletions
diff --git a/templates/web/base/auth/_username_error.html b/templates/web/base/auth/_username_error.html
index c0ddc135a..5454317b3 100644
--- a/templates/web/base/auth/_username_error.html
+++ b/templates/web/base/auth/_username_error.html
@@ -10,4 +10,6 @@
};
default = "other_$default";
errors.$username_error || errors.$default;
+ELSIF sign_in_error;
+ loc('There was a problem with your login information.');
END ~%]
diff --git a/templates/web/base/auth/create.html b/templates/web/base/auth/create.html
new file mode 100644
index 000000000..1886da95b
--- /dev/null
+++ b/templates/web/base/auth/create.html
@@ -0,0 +1,63 @@
+[%
+IF forgotten;
+ title = loc('Forgot password');
+ELSE;
+ title = loc('Create an account');
+END;
+
+INCLUDE 'header.html', bodyclass='authpage' %]
+
+<h1>
+ [% title %]
+ <small>
+ [% tprintf(loc('or <a href="%s">sign in</a>'), '/auth') %]
+ </small>
+</h1>
+
+[% IF forgotten %]
+<p>
+ [% IF c.config.SMS_AUTHENTICATION %]
+ [% loc('Sign in by email or text, providing a new password. When you click the link in your email or enter the SMS authentication code, your password will be updated.') %]</p>
+ [% ELSE %]
+ [% loc('Sign in by email instead, providing a new password. When you click the link in your email, your password will be updated.') %]</p>
+ [% END %]
+</p>
+[% END %]
+
+<form action="/auth/[% forgotten ? 'forgot' : 'create' %]" method="post" name="general_auth" class="validate">
+ <fieldset>
+
+ <input type="hidden" name="r" value="[% c.req.params.r | html %]">
+
+ [% loc_username_error = INCLUDE 'auth/_username_error.html' default='email' %]
+
+[% IF c.config.SMS_AUTHENTICATION %]
+ [% SET username_label = loc('Your email or mobile') %]
+[% ELSE %]
+ [% SET username_label = loc('Your email') %]
+[% END %]
+
+ <label class="n" for="username">[% username_label %]</label>
+ [% IF loc_username_error %]
+ <div class="form-error">[% loc_username_error %]</div>
+ [% END %]
+ <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]" autofocus autocomplete="username">
+
+ [% IF field_errors.password_register %]
+ <p class='form-error'>[% field_errors.password_register %]</p>
+ [% END %]
+ <label for="password_register">[% forgotten ? loc('New password:') : loc('Your password') %]</label>
+
+ <div class="general-notes">
+ <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p>
+ </div>
+
+ <div class="form-txt-submit-box">
+ <input class="required form-control js-password-validate" type="password" name="password_register" id="password_register" value="" autocomplete="new-password">
+ <input class="green-btn" type="submit" name="sign_in_by_code" value="[% loc('Sign in') %]">
+ </div>
+
+ </fieldset>
+</form>
+
+[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html
index 4dbdb179f..e2e880871 100644
--- a/templates/web/base/auth/general.html
+++ b/templates/web/base/auth/general.html
@@ -1,6 +1,11 @@
[% INCLUDE 'header.html', bodyclass='authpage', title = loc('Sign in or create an account') %]
-<h1>[% loc('Sign in') %]</h1>
+<h1>
+ [% loc('Sign in') %]
+ <small>
+ [% tprintf(loc('or <a href="%s">create an account</a>'), '/auth/create') %]
+ </small>
+</h1>
[% TRY %][% INCLUDE 'auth/_general_top.html' %][% CATCH file %][% END %]
@@ -45,24 +50,18 @@
[% END %]
<label class="n" for="username">[% username_label %]</label>
- [% IF loc_username_error %]
+ [% IF loc_username_error %]
<div class="form-error">[% loc_username_error %]</div>
- [% ELSIF sign_in_error %]
- <div class="form-error">[% loc('There was a problem with your login information. If you cannot remember your password, or do not have one, please fill in the &lsquo;No&rsquo; section of the form.') %]</div>
[% END %]
- <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]"
+ <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]" autocomplete="username"
[%~ IF c.cobrand.moniker != 'borsetshire' %] autofocus[% END %]>
<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 %]
- [% IF NOT field_errors.password_register %]
[% INCLUDE form_sign_in_yes %]
- [% END %]
[% INCLUDE form_sign_in_no %]
[% END %]
</div>
@@ -77,61 +76,29 @@
[% INCLUDE 'footer.html' %]
[% BLOCK form_sign_in_yes %]
- <div id="form_sign_in_yes" class="form-box">
- <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>
-
+ <p class="hidden-nojs js-sign-in-password-hide">
+ <input class="btn btn--primary btn--block js-sign-in-password-btn" type="submit" name="sign_in_by_password" value="[% loc('Sign in with a password') %]">
+ </p>
+ <div class="hidden-js js-sign-in-password">
<label for="password_sign_in">[% loc('Your password') %]</label>
<div class="form-txt-submit-box">
- <input type="password" name="password_sign_in" class="form-control" id="password_sign_in" value="">
+ <input type="password" name="password_sign_in" class="form-control" id="password_sign_in" value="" autocomplete="current-password">
<input class="green-btn" type="submit" name="sign_in_by_password" value="[% loc('Sign in') %]">
</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>
- [% IF c.config.SMS_AUTHENTICATION %]
- [% loc('Sign in by email or text, providing a new password. When you click the link in your email or enter the SMS authentication code, your password will be updated.') %]</p>
- [% ELSE %]
- [% loc('Sign in by email instead, providing a new password. When you click the link in your email, your password will be updated.') %]</p>
- [% END %]
- </div>
-
+ <p>
+ <a href="/auth/forgot">[% loc('Forgotten your password?') %]</a>
+ </p>
</div>
[% END %]
[% BLOCK form_sign_in_no %]
- <div id="form_sign_in_no" class="form-box">
- [% IF c.config.SMS_AUTHENTICATION %]
- <h5>[% loc('<strong>No</strong> let me sign in by email or text') %]</h5>
- [% ELSE %]
- <h5>[% loc('<strong>No</strong> let me sign in by email') %]</h5>
- [% END %]
-
- <label for="name">[% loc('Your name') %]</label>
- <input class="form-control" type="text" name="name" value="">
-
- <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 js-password-validate" type="password" name="password_register" id="password_register" value="">
- <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>
+ <p><input class="fake-link" type="submit" name="sign_in_by_code" value="
+ [%~ IF c.config.SMS_AUTHENTICATION %]
+ [%~ loc('Email me a link or text me a code to sign in') %]
+ [%~ ELSE %]
+ [%~ loc('Email me a link to sign in') %]
+ [%~ END ~%]
+ "></p>
[% END %]
diff --git a/templates/web/zurich/auth/general.html b/templates/web/zurich/auth/general.html
index 2b183b953..29fff2600 100644
--- a/templates/web/zurich/auth/general.html
+++ b/templates/web/zurich/auth/general.html
@@ -14,8 +14,6 @@
<label class="n" for="username">[% loc('Email') %]</label>
[% IF loc_username_error %]
<div class="form-error">[% loc_username_error %]</div>
- [% ELSIF sign_in_error %]
- <div class="form-error">[% loc('There was a problem with your login information. If you cannot remember your password, or do not have one, please fill in the &lsquo;No&rsquo; section of the form.') %]</div>
[% END %]
<input type="email" class="required email" id="username" name="username" value="[% username | html %]" autofocus>
@@ -25,11 +23,6 @@
<input class="green-btn" type="submit" name="sign_in_by_password" value="[% loc('Sign in') %]">
</div>
- <div class="form-txt-submit-box">
- <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>
</fieldset>
</form>