File tree 2 files changed +27
-7
lines changed
core/cat/routes/static/core_static_folder/auth
2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,10 @@ button {
30
30
background-color : # ccc ;
31
31
color : white;
32
32
font-weight : bold;
33
+ cursor : pointer;
33
34
}
34
35
35
- button : hover {
36
+ button . active {
36
37
background-color : # 333 ;
37
38
}
38
39
Original file line number Diff line number Diff line change 10
10
< body >
11
11
< form action ="/auth/redirect " method ="POST ">
12
12
< img id ="logo " src ="[[ url_for('core-static', path='/img/logo.svg') ]] ">
13
+ < div class ="error-message ">
14
+ [[ error_message ]]
15
+ </ div >
13
16
< 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 ">
15
18
</ div >
16
19
< 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 ">
18
21
</ div >
19
22
< div >
20
23
< input type ="hidden " name ="referer " value ="[[ referer ]] ">
21
24
</ div >
22
25
< div >
23
- < button type ="submit "> Login</ button >
26
+ < button type ="submit " id =" submitLogin " > Login</ button >
24
27
</ div >
25
28
{% if show_default_passwords %}
26
29
Default users included out of the box:
32
35
{% endif %}
33
36
< div >
34
37
</ div >
35
- < div class ="error-message ">
36
- [[ error_message ]]
37
- </ div >
38
38
</ form >
39
39
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 >
40
57
</ body >
58
+
59
+
41
60
</ html >
You can’t perform that action at this time.
0 commit comments