File tree Expand file tree Collapse file tree 2 files changed +27
-7
lines changed
core/cat/routes/static/core_static_folder/auth Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,10 @@ button {
3030 background-color : # ccc ;
3131 color : white;
3232 font-weight : bold;
33+ cursor : pointer;
3334}
3435
35- button : hover {
36+ button . active {
3637 background-color : # 333 ;
3738}
3839
Original file line number Diff line number Diff line change 1010< body >
1111 < form action ="/auth/redirect " method ="POST ">
1212 < img id ="logo " src ="[[ url_for('core-static', path='/img/logo.svg') ]] ">
13+ < div class ="error-message ">
14+ [[ error_message ]]
15+ </ div >
1316 < div >
14- < input type ="text " id ="username " name ="username " required autofocus placeholder ="Username ">
17+ < input type ="text " id ="username " name ="username " oninput =" toggleButtonColor() " required autofocus placeholder ="Username ">
1518 </ div >
1619 < div >
17- < input type ="password " id ="password " name ="password " required placeholder ="Password ">
20+ < input type ="password " id ="password " name ="password " oninput =" toggleButtonColor() " required placeholder ="Password ">
1821 </ div >
1922 < div >
2023 < input type ="hidden " name ="referer " value ="[[ referer ]] ">
2124 </ div >
2225 < div >
23- < button type ="submit "> Login</ button >
26+ < button type ="submit " id =" submitLogin " > Login</ button >
2427 </ div >
2528 {% if show_default_passwords %}
2629 Default users included out of the box:
3235 {% endif %}
3336 < div >
3437 </ div >
35- < div class ="error-message ">
36- [[ error_message ]]
37- </ div >
3838 </ form >
3939
40+
41+ < script >
42+ function toggleButtonColor ( ) {
43+ const button = document . getElementById ( 'submitLogin' ) ;
44+ const usernameValue = document . getElementById ( 'username' ) . value ;
45+ const passwordValue = document . getElementById ( 'password' ) . value ;
46+
47+ if ( usernameValue !== "" && passwordValue != "" ) {
48+ button . disabled = false ;
49+ button . classList . add ( 'active' ) ;
50+ } else {
51+ button . disabled = true ;
52+ button . classList . remove ( 'active' ) ;
53+
54+ }
55+ }
56+ </ script >
4057</ body >
58+
59+
4160</ html >
You can’t perform that action at this time.
0 commit comments