web - form usability fix
This commit is contained in:
parent
71f6b18b85
commit
7b02cdbaf8
@ -7,7 +7,10 @@ append var
|
|||||||
div(class="uk-width-auto uk-width-1-4@s")
|
div(class="uk-width-auto uk-width-1-4@s")
|
||||||
.uk-flex.uk-flex-auto.uk-flex-column.uk-flex-center.uk-margin-left.uk-margin-right
|
.uk-flex.uk-flex-auto.uk-flex-column.uk-flex-center.uk-margin-left.uk-margin-right
|
||||||
h1 Please login
|
h1 Please login
|
||||||
form.uk-form-horizontal
|
#login_msg.uk-alert(data-uk-alert).uk-hidden
|
||||||
|
a.uk-close-alt.uk-alert-close(href="#")
|
||||||
|
p
|
||||||
|
form.uk-form-horizontal(onsubmit="return loginEvent();")
|
||||||
.uk-margin
|
.uk-margin
|
||||||
label.uk-form-label(for="login_user") Username / Email
|
label.uk-form-label(for="login_user") Username / Email
|
||||||
.uk-form-controls
|
.uk-form-controls
|
||||||
@ -16,5 +19,6 @@ append var
|
|||||||
label.uk-form-label(for="login_pass") Password
|
label.uk-form-label(for="login_pass") Password
|
||||||
.uk-form-controls
|
.uk-form-controls
|
||||||
input.uk-input#login_pass(type="password")
|
input.uk-input#login_pass(type="password")
|
||||||
a(href="/login").uk-button.uk-button-default Login
|
input(hidden,type="submit")
|
||||||
|
button(onclick="login()").uk-button.uk-button-default Login
|
||||||
div(class="uk-width-auto uk-width-1-4@s")
|
div(class="uk-width-auto uk-width-1-4@s")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
function loginEvent() {
|
|
||||||
login();
|
// '/login', login user
|
||||||
return false;
|
function loginEvent() { login(); return false; } // btnEvent handling
|
||||||
}
|
|
||||||
function login() {
|
function login() {
|
||||||
let user = document.getElementById("login_user").value;
|
let user = document.getElementById("login_user").value;
|
||||||
let pass = document.getElementById("login_pass").value;
|
let pass = document.getElementById("login_pass").value;
|
||||||
@ -42,6 +41,7 @@ function login() {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// '/logout', logout user
|
||||||
function logout() {
|
function logout() {
|
||||||
let ajax = new XMLHttpRequest();
|
let ajax = new XMLHttpRequest();
|
||||||
ajax.open("GET", "/api/logout", true);
|
ajax.open("GET", "/api/logout", true);
|
||||||
@ -58,6 +58,7 @@ setTimeout(function () {
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
|
// '/authenticate', cancels Authentication
|
||||||
function cancelRequest() {
|
function cancelRequest() {
|
||||||
let ajax = new XMLHttpRequest();
|
let ajax = new XMLHttpRequest();
|
||||||
ajax.open("GET", "/api/cancel", true);
|
ajax.open("GET", "/api/cancel", true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user