82 lines
2.5 KiB
Plaintext
82 lines
2.5 KiB
Plaintext
{{ template "base". }}
|
|
{{ define "title" }}
|
|
Admin User
|
|
{{ end }}
|
|
{{ define "content" }}
|
|
<h2 class="mt-5">Admin user</h2>
|
|
<hr>
|
|
<form method="post"
|
|
action=""
|
|
name="user_form"
|
|
id="user_form"
|
|
class="needs-validation"
|
|
autocomplete="off"
|
|
novalidate>
|
|
<div class="mb-3">
|
|
<label for="first_name" class="form-label">First Name</label>
|
|
<input type="text"
|
|
name="first_name"
|
|
id="first_name"
|
|
class="form-control"
|
|
required=""
|
|
autocomplete="first_name-new">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="last_name" class="form-label">Last Name</label>
|
|
<input type="text"
|
|
name="last_name"
|
|
id="last_name"
|
|
class="form-control"
|
|
required=""
|
|
autocomplete="last_name-new">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label">Email</label>
|
|
<input type="text"
|
|
name="email"
|
|
id="email"
|
|
class="form-control"
|
|
required=""
|
|
autocomplete="email-new">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label">Password</label>
|
|
<input type="password"
|
|
name="password"
|
|
id="password"
|
|
class="form-control"
|
|
autocomplete="password-new">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="verify_password" class="form-label">Verify Password</label>
|
|
<input type="password"
|
|
name="verify_password"
|
|
id="verify_password"
|
|
class="form-control"
|
|
autocomplete="veryfy_password-new">
|
|
</div>
|
|
<hr>
|
|
<div class="float-start">
|
|
<a href="javascript:void(0)" class="btn btn-primary" id="saveBtn">Save Changes</a>
|
|
<a href="/admin/all-users" class="btn btn-warning" id="cancelBtn">Cancel</a>
|
|
</div>
|
|
<div class="float-end">
|
|
<a href="javascript:void(0)" class="btn btn-danger d-none" id="deleteBtn">Delete</a>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
</form>
|
|
{{ end }}
|
|
{{ define "js" }}
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script type="module">
|
|
import {showUser, saveUser, deleteUser} from "/static/js/users.js"
|
|
showUser({{.API}}, {{.UserID}});
|
|
document.getElementById("saveBtn").addEventListener("click", (evt) => {
|
|
saveUser({{.API}}, evt);
|
|
});
|
|
document.getElementById("deleteBtn").addEventListener("click", () => {
|
|
deleteUser({{.API}});
|
|
});
|
|
</script>
|
|
{{ end }}
|