Browse Source

web - form usability fix

master
Ruben Meyer 2 years ago
parent
commit
7b02cdbaf8
Signed by: rxbn_ GPG Key ID: BE3BF898BE352FE2
  1. 8
      bin/web/views/blocks/error/login.pug
  2. 9
      res/web/js/custom.js

8
bin/web/views/blocks/error/login.pug

@ -7,7 +7,10 @@ append var
div(class="uk-width-auto [email protected]")
.uk-flex.uk-flex-auto.uk-flex-column.uk-flex-center.uk-margin-left.uk-margin-right
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
label.uk-form-label(for="login_user") Username / Email
.uk-form-controls
@ -16,5 +19,6 @@ append var
label.uk-form-label(for="login_pass") Password
.uk-form-controls
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 [email protected]")

9
res/web/js/custom.js

@ -1,7 +1,6 @@
function loginEvent() {
login();
return false;
}
// '/login', login user
function loginEvent() { login(); return false; } // btnEvent handling
function login() {
let user = document.getElementById("login_user").value;
let pass = document.getElementById("login_pass").value;
@ -42,6 +41,7 @@ function login() {
};
};
// '/logout', logout user
function logout() {
let ajax = new XMLHttpRequest();
ajax.open("GET", "/api/logout", true);
@ -58,6 +58,7 @@ setTimeout(function () {
}
}, 100);
// '/authenticate', cancels Authentication
function cancelRequest() {
let ajax = new XMLHttpRequest();
ajax.open("GET", "/api/cancel", true);

Loading…
Cancel
Save