From deffc3e2183262850162a81edf2fe1d787b841aa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 11 Jun 2024 16:42:37 +0000 Subject: [PATCH] Bug 30088: Improve forgotten password form to be more obvious that only one field must be filled out This patch updates the OPAC's forgotten password form so that the form fields are initially hidden. The user clicks on "I know my login" or "I know my email address" to display the relevant form field. To test, apply the patch and go to Administration to make sure the "OpacResetPassword" preference is enabled. - In the OPAC, click the "Forgot your password?" link on the home page. - Test the two buttons, "I know my login" and "I know my email address." Each should display the correct parts of the form. - Try submitting an email address which has been set to more than one patron. - You should get an error message, "Account identification with this email address only is ambiguous." - Both form fields should be visible. Sponsored-By: Athens County Public Libraries Signed-off-by: Sam Lau Signed-off-by: Laura_Escamilla --- .../opac-tmpl/bootstrap/css/src/opac.scss | 23 +++ .../en/modules/opac-password-recovery.tt | 132 +++++++++++------- 2 files changed, 104 insertions(+), 51 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index e3e16efa7b..8a10f52252 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -1676,6 +1676,29 @@ nav { } } +#password-recovery { + margin-bottom: 1rem; +} + +#password_recovery_options { + background-color: #F0F3F3; + display: flex; + flex-wrap: nowrap; + gap: 1rem; + padding: 1rem; +} + +#use_login a, +#use_email a { + background-color: #FFF; + border: 1px solid #0074AD; + border-radius: 10px; + display: block; + font-size: 130%; + padding: 1rem; + white-space: nowrap; +} + #renewcontrols { float: right; font-size: 66%; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt index 1fefb27964..f7cbf9df6d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt @@ -8,48 +8,6 @@ Forgotten password recovery › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] -[% BLOCK jsinclude %] -[% IF (new_password) %] - [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] - [% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %] -[% END %] - -[% END %] [% INCLUDE 'bodytag.inc' bodyid='opac-password-recovery' %] [% INCLUDE 'masthead.inc' %] @@ -63,14 +21,14 @@
-
+
[% IF ( OpacPublic ) %] [% END %]
-
+

Forgotten password recovery

[% IF (hasError) %]
@@ -125,28 +83,47 @@ [% IF (! Categories.can_any_reset_password ) %]
You can't reset your password.
[% ELSIF (password_recovery) %] +
[% INCLUDE 'csrf-token.inc' %] Password recovery

To reset your password, enter your login or your email address.

-
- - + + -
- - + -
+ + +
+ + + [% ELSIF (new_password) %] [% UNLESS ( errLinkNotValid ) %]
@@ -198,4 +175,57 @@
+ [% INCLUDE 'opac-bottom.inc' %] + +[% BLOCK jsinclude %] + [% IF (new_password) %] + [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] + [% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %] + [% END %] + +[% END %] -- 2.39.2