2024-09-28 14:31:02 +01:00
|
|
|
<%- include("../base/header", { title: typeof(id) === "undefined" || id.trim().length === 0 ? "Add User" : `Edit ${username}`, userId: session.userId, isAdmin: true }) %>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li class="breadcrumb-item"><a href="/admin">Admin</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="/admin/users">User Management</a></li>
|
|
|
|
<li class="breadcrumb-item active"><a><%= typeof(id) === "undefined" ? "Add User" : `Edit ${username}` %></a></li>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<h1><%= typeof(id) === "undefined" || id.trim().length === 0 ? "Add User" : `Edit ${username}` %></h1>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if (typeof(message) === "string") { %>
|
|
|
|
<div class="alert alert-danger text-center mt-5" role="alert"><%= message %></div>
|
|
|
|
<% } %>
|
|
|
|
|
|
|
|
<form method="post" class="needs-validation" novalidate>
|
|
|
|
<input type="hidden" name="id" value="<%= typeof(id) === "undefined" || id.trim().length === 0 ? "" : id %>" />
|
|
|
|
|
|
|
|
<div class="row mt-5 mb-3">
|
|
|
|
<div class="col">
|
|
|
|
<label for="username" class="form-label">Username</label>
|
|
|
|
<input class="form-control" id="username" name="username" value="<%= typeof(username) === "undefined" ? "" : username %>" required maxlength="255" autocomplete="one-time-code" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row mb-5">
|
|
|
|
<div class="col">
|
|
|
|
<label for="name" class="form-label">Permissions</label>
|
|
|
|
<select class="form-select" name="userLevel" required>
|
|
|
|
<option value="" disabled <%= userLevel === "0" ? "selected" : "" %>>Please select...</option>
|
|
|
|
<option value="10" <%= userLevel === "10" ? "selected" : "" %>>User</option>
|
2024-09-29 21:35:36 +01:00
|
|
|
<option value="20" <%= userLevel === "20" ? "selected" : "" %>>Badge Editor</option>
|
2024-09-28 14:31:02 +01:00
|
|
|
<option value="999" <%= userLevel === "999" ? "selected" : "" %>>Admin</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col text-center">
|
|
|
|
<button type="submit" class="btn btn-primary">Save</button>
|
|
|
|
<a type="submit" class="btn btn-danger" href="/admin/users">Cancel</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
2024-10-13 14:13:33 +01:00
|
|
|
<%- include("../base/footer", { apiKey: session.apiKey, username: session.username }) %>
|