added option to view password

This commit is contained in:
Kenneth Sequeira 2019-04-02 00:11:11 +05:30
parent 1c8fd3169e
commit dbd64f0789
3 changed files with 25 additions and 5 deletions

View file

@ -129,4 +129,11 @@ p {
border: 1px solid #d1d8dd;
padding: 10px;
border-radius: 4px;
}
}
.toggle-password {
right: 9px;
top: 9px;
position: absolute;
z-index: 2;
}

View file

@ -56,6 +56,16 @@ login.bind_events = function() {
return false;
});
$(".toggle-password").click(function() {
$(this).toggleClass("fa-eye fa-eye-slash");
var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});
{% if ldap_settings %}
$(".btn-ldap-login").on("click", function(){
var args = {};

View file

@ -21,10 +21,13 @@
placeholder="{% if login_name_placeholder %}{{ login_name_placeholder }}{% else %}{{ _("Email address") }}{% endif %}"
required autofocus>
<input type="password" id="login_password"
class="form-control" placeholder="{{ _('Password') }}" required>
<div class="password-field" style="position: relative;">
<input type="password" id="login_password"
class="form-control" placeholder="{{ _('Password') }}" required>
<span toggle="#login_password" class="fa fa-fw fa-eye toggle-password"></span>
</div>
<button class="btn btn-sm btn-primary btn-block btn-login" type="submit">
{{ _("Login") }}</button>