diff options
author | Dave Arter <davea@mysociety.org> | 2020-05-19 08:39:42 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-07-02 14:38:50 +0100 |
commit | c5b0d088eb76dcf7290dae5d4d2d208f7031d13d (patch) | |
tree | a6577db7ec133a7e2c59ffb2c1e3b56ff84dec3a | |
parent | 41ed9db574ecb77504992f3836ced7f25fe1768d (diff) |
[Hackney] Add staff sign-in link to login forms
-rw-r--r-- | templates/web/hackney/auth/general.html | 88 | ||||
-rw-r--r-- | templates/web/hackney/report/form/user.html | 29 | ||||
-rw-r--r-- | web/cobrands/hackney/base.scss | 7 |
3 files changed, 123 insertions, 1 deletions
diff --git a/templates/web/hackney/auth/general.html b/templates/web/hackney/auth/general.html new file mode 100644 index 000000000..1a9e4a060 --- /dev/null +++ b/templates/web/hackney/auth/general.html @@ -0,0 +1,88 @@ +[% INCLUDE 'header.html', bodyclass='authpage', title = loc('Sign in or create an account') %] + +<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 %] + +[% 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="/auth" 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 %]" autocomplete="username" + [%~ IF c.cobrand.moniker != 'borsetshire' %] autofocus[% END %]> + + <div id="form_sign_in"> + [% IF oauth_need_email %] + [% INCLUDE form_sign_in_no %] + <input type="hidden" name="oauth_need_email" value="1"> + [% ELSE %] + [% INCLUDE form_sign_in_yes %] + [% INCLUDE form_sign_in_no %] + [% INCLUDE form_sign_in_hackney_staff %] + [% END %] + </div> + </fieldset> +</form> + +[% INCLUDE 'footer.html' %] + +[% BLOCK form_sign_in_yes %] + <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="" autocomplete="current-password"> + <input class="green-btn" type="submit" name="sign_in_by_password" value="[% loc('Sign in') %]"> + </div> + + <p> + <a href="/auth/forgot">[% loc('Forgotten your password?') %]</a> + </p> + </div> +[% END %] + +[% BLOCK form_sign_in_no %] + <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 %] + +[% BLOCK form_sign_in_hackney_staff %] + [% IF c.cobrand.feature('oidc_login') %] + <button name="social_sign_in" id="oidc_sign_in" value="oidc" class="fake-link sso-staff-sign-in"> + Hackney Staff Sign-in + </button> + [% END %] +[% END %]
\ No newline at end of file diff --git a/templates/web/hackney/report/form/user.html b/templates/web/hackney/report/form/user.html new file mode 100644 index 000000000..bced8c189 --- /dev/null +++ b/templates/web/hackney/report/form/user.html @@ -0,0 +1,29 @@ +<!-- report/form/user.html --> +<div class="js-new-report-user-hidden form-section-preview form-section-preview--next + [%~ ' hidden-nojs' IF c.user_exists OR NOT c.cobrand.social_auth_enabled %]"> + <h2 class="form-section-heading form-section-heading--private hidden-nojs"> + [% loc('Next:') %] [% loc('Tell us about you') %] + </h2> + <button type="button" class="btn btn--block hidden-nojs js-new-report-user-show">[% loc('Continue') %]</button> +[% IF NOT c.user_exists AND c.cobrand.feature('oidc_login') %] + <button name="social_sign_in" id="oidc_sign_in" value="oidc" class="fake-link sso-staff-sign-in"> + Hackney Staff Sign-in + </button> +[% END %] + <div class="js-show-if-anonymous + [%~ ' hidden-js' UNLESS type == 'report' AND c.cobrand.allow_anonymous_reports == 'button' %]"> + <small id="or">[% loc('or') %]</small> + <button name="report_anonymously" value="yes" class="btn btn--block js-new-report-submit">[% loc('Report anonymously') %]</button> + <small>[% loc('No personal details will be stored, and you will not receive updates about this report.') %]</small> + </div> +</div> + +[% IF (c.user_exists OR NOT c.cobrand.social_auth_enabled) AND type == 'report' AND c.cobrand.allow_anonymous_reports == 'button' %] +<div class="form-section-preview form-section-preview--next hidden-js"> + <button name="report_anonymously" value="yes" class="btn btn--block">[% loc('Report anonymously') %]</button> + <small>[% loc('No personal details will be stored, and you will not receive updates about this report.') %]</small> + <small id="or">[% loc('or') %]</small> +</div> +[% END %] + +<!-- /report/form/user.html --> diff --git a/web/cobrands/hackney/base.scss b/web/cobrands/hackney/base.scss index a3e41c5d0..4bc3fc8b1 100644 --- a/web/cobrands/hackney/base.scss +++ b/web/cobrands/hackney/base.scss @@ -214,4 +214,9 @@ select.form-error { .dz-clickable:hover .dz-message u, .dz-drag-hover .dz-message u { color: $green; -}
\ No newline at end of file +} + +.sso-staff-sign-in { + font-size: 0.9em; + margin: 1em 0; +} |