From b8cabadd43b56b0bc3cb385fa4ef8e940bc99f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 21 Jan 2019 23:41:27 +0100 Subject: [PATCH] Fix admin page links --- src/static/templates/admin/page.hbs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/static/templates/admin/page.hbs b/src/static/templates/admin/page.hbs index 7ee748b..8847f5b 100644 --- a/src/static/templates/admin/page.hbs +++ b/src/static/templates/admin/page.hbs @@ -21,7 +21,7 @@
- Delete User + Delete User
@@ -55,15 +55,13 @@ return "data:image/svg+xml;base64," + data.toString(); } function _post(url, successMsg, errMsg, data) { - $.post({ url: url, data: data }) - .done(function () { - alert(successMsg); - reload(); - }).fail(function (e) { - const r = e.responseJSON; - const msg = r ? r.ErrorModel.Message : "Unknown error"; - alert(errMsg + ": " + msg); - }); + $.post(url, data, function () { + alert(successMsg); + }).fail(function (e) { + const r = e.responseJSON; + const msg = r ? r.ErrorModel.Message : "Unknown error"; + alert(errMsg + ": " + msg); + }).always(reload); } function deleteUser(id, mail) { var input_mail = prompt("To delete user '" + mail + "', please type the name below") @@ -76,6 +74,7 @@ alert("Wrong email, please try again") } } + return false; } function inviteUser() { inv = $("#email-invite"); @@ -83,6 +82,7 @@ inv.val(""); _post("/admin/invite/", "User invited correctly", "Error inviting user", data); + return false; } let OrgTypes = {