t00-multiuser/server/views/admin/badges.ejs

49 lines
1.6 KiB
Text
Raw Normal View History

2024-09-28 01:31:46 +01:00
<%- include("../base/header", { title: "Badge Management", 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 active"><a>Badge Management</a></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col">
<h1>Badge Management</h1>
</div>
<div class="col-auto">
<a class="btn btn-primary btn-lg me-2" href="/admin/badge">Add Badge</a>
</div>
</div>
<div class="row my-5">
<div class="col">
2024-09-30 01:07:51 +01:00
<table class="table table-striped" style="word-break:break-word">
2024-09-28 01:31:46 +01:00
<thead>
2024-09-30 01:09:56 +01:00
<th>&nbsp;</th>
2024-09-28 01:31:46 +01:00
<th>Name</th>
2024-10-08 11:04:46 +01:00
<th style="white-space:nowrap">Secret</th>
2024-09-28 01:31:46 +01:00
<th>&nbsp;</th>
</thead>
<tbody>
<% for (const badge of badges) { %>
<tr>
<td class="align-middle"><img style="image-rendering:pixelated" src="<%= badge.ImageUrl.trim().length === 0 ? "/img/missing.png" : badge.ImageUrl %>" width="32" height="32" /></td>
<td class="align-middle"><%= badge.Name %></td>
2024-10-08 11:04:46 +01:00
<td class="align-middle text-center"><%= badge.IsSecret ? "Yes" : "No" %></td>
2024-09-28 01:31:46 +01:00
<td class="text-end text-nowrap align-middle">
<a class="btn btn-sm btn-primary" href="/admin/badge?id=<%= badge.Id %>">Edit</a>
<a class="btn btn-sm btn-danger" href="/admin/deletebadge?id=<%= badge.Id %>" onclick="return confirm(`Are you sure you want to delete '<%= badge.Name %>'?`)">Delete</a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
2024-10-12 11:52:13 +01:00
2024-09-28 01:31:46 +01:00
<%- include("../base/footer") %>