Bug 33820: (follow-up) Add hint to member-password.tt

This follow-up makes the same change to the "Change password" template.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-05-24 15:16:37 +00:00 committed by Tomas Cohen Arazi
parent 8e611b79f1
commit 756de0f09a
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 9 additions and 0 deletions

View File

@ -147,6 +147,15 @@
});
$("div.hint").eq(0).after(" <div class=\"hint\"><a href=\"#\" id=\"fillrandom\">"+_("Click to fill with a randomly generated suggestion. ")+"<strong>"+_("Passwords will be displayed as text")+"</strong>.</a></div>");
[% IF logged_in_user.borrowernumber == patron.borrowernumber %]
$("#newuserid").on("change", function(){
$(this).parent().find("div.hint").remove();
if ( "[% patron.userid | html %]" != $(this).val() ) {
$(this).parent().append('<div class="hint">%s</div>'.format(_("You will be logged out if you modify your username")));
}
});
[% END %]
$(document).ajaxStart(function () {
$("input[name^=newpassword]").hide();
$("label[for=newpassword2]").hide();