mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-17 01:15:05 +03:00
Akif9748
4be2069587
Co-authored-by: Sapphire1525 <Sapphire1525@users.noreply.github.com> Co-authored-by: inoaa79 <inoaa79@users.noreply.github.com>
40 lines
No EOL
1 KiB
Text
40 lines
No EOL
1 KiB
Text
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<%- include("extra/header", {title: "Admin panel!" }) %>
|
|
|
|
<body>
|
|
|
|
<%- include("extra/navbar", {user}) %>
|
|
|
|
<h1>Welcome to the admin panel of the forum, <%= user.name %>!</h1>
|
|
|
|
<form>
|
|
<h2>Write an ID to give someone admin permissions:</h2>
|
|
<input name="userid"></input>
|
|
<hr>
|
|
<button class="big" type="submit">Give admin permissions!</button>
|
|
</form>
|
|
|
|
<script type="module">
|
|
|
|
import request from "../../js/request.js";
|
|
|
|
document.addEventListener("submit", async e => {
|
|
e.preventDefault();
|
|
|
|
const response = await request("/api/users/" + e.target[0].value + "/admin");
|
|
|
|
if (response.admin)
|
|
alert("Making admin of "+response.name+" is success!");
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
<%- include("extra/footer") %>
|
|
|
|
</body>
|
|
|
|
</html> |