mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 05:10:41 +03:00
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.result.admin)
|
|
alert("Making admin of "+response.result.name+" is success!");
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
<%- include("extra/footer") %>
|
|
|
|
</body>
|
|
|
|
</html> |