Skip to content

Commit

Permalink
Added confirmations to admin pannel
Browse files Browse the repository at this point in the history
  • Loading branch information
jontyms committed Aug 31, 2024
1 parent 760cbe9 commit 7dce418
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/static/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,12 @@ function showUser(userId) {

// Set buttons up
document.getElementById("payDues").onclick = (evt) => {
editUser({
id: user.id,
did_pay_dues: true,
});
if (window.confirm("Are you sure you want to mark this user as paid?")) {
editUser({
id: user.id,
did_pay_dues: true,
});
}
setTimeout((evt) => {
verifyUser(user.id);
}, 2000);
Expand All @@ -250,10 +252,12 @@ function showUser(userId) {
: "inline-block";

document.getElementById("setAdmin").onclick = (evt) => {
editUser({
id: user.id,
sudo: !user.sudo,
});
if (window.confirm("Make User Admin?")) {
editUser({
id: user.id,
sudo: !user.sudo,
});
}
};
document.getElementById("adminLabel").innerText = user.sudo
? "Revoke Admin"
Expand Down

0 comments on commit 7dce418

Please sign in to comment.