File tree Expand file tree Collapse file tree
src/adminui/templates/auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44{% block title %}Sign into Kiwix Admin{% endblock %}
55
66{% block head %}
7+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css ">
78< style type ="text/css ">
89 main header {
910 margin-bottom : .5em ;
7374 </ div >
7475 < div class ="mb-3 ">
7576 < label class ="form-label " for ="password "> Password</ label >
76- < input type ="password " class ="form-control{% if is_incorrect %} is-invalid{% endif %} " name ="password " aria-describedby ="credentialsFeedback ">
77+ < input type ="password " id ="password-input " class ="form-control{% if is_incorrect %} is-invalid{% endif %} " name ="password " aria-describedby ="credentialsFeedback ">
78+
79+ < button class ="btn btn-outline-secondary " type ="button " id ="toggle-password ">
80+ < i class ="fa-solid fa-eye "> </ i >
81+ </ button >
82+
7783 {% if is_incorrect and message_content %}< div id ="credentialsFeedback " class ="invalid-feedback "> {{ message_content }}</ div > {% endif %}
7884 </ div >
7985 < div class ="d-flex flex-row-reverse ">
8288 </ form >
8389 </ div >
8490 < div class ="mt-1 mb-1 p-3 "> < a class ="returnlink " href ="http://{{ ctx.fqdn }} "> < i class ="fa-solid fa-arrow-left "> </ i > Return to the Hotspot</ a > </ div >
91+
92+ < script >
93+ const togglePassword = document . querySelector ( '#toggle-password' ) ;
94+ const password = document . querySelector ( '#password-input' ) ;
95+
96+ togglePassword . addEventListener ( 'click' , function ( e ) {
97+ // toggle the type attribute
98+ const type = password . getAttribute ( 'type' ) === 'password' ? 'text' : 'password' ;
99+ password . setAttribute ( 'type' , type ) ;
100+
101+ // toggle the eye icon
102+ const icon = this . querySelector ( 'i' ) ;
103+ icon . classList . toggle ( 'fa-eye' ) ;
104+ icon . classList . toggle ( 'fa-eye-slash' ) ;
105+ } ) ;
106+ </ script >
85107{% endblock %}
You can’t perform that action at this time.
0 commit comments