2024-09-19 00:41:40 +01:00
<%- include("../base/header", { title: "Home", userId: session.userId }) %>
2024-04-23 00:58:07 +01:00
<div class="row">
2024-07-15 23:31:50 +01:00
<div class="col text-center pb-5 lg-sm-0">
2024-04-23 00:58:07 +01:00
<h1>Welcome back <%= user.Username %>!</h1>
<h3>What would you like to do?</h3>
2024-07-15 23:31:50 +01:00
<div class="mt-3 text-nowrap">
2024-04-23 00:58:07 +01:00
<div>
2024-09-26 00:47:08 +01:00
<a class="btn btn-primary btn-lg me-2" href="/account/changeusername">Change Username</a>
2024-09-28 01:31:46 +01:00
<a class="btn btn-primary btn-lg disabled" href="/account/password">Change Password</a>
2024-04-23 00:58:07 +01:00
</div>
<div class="mt-3">
2024-04-23 17:01:25 +01:00
<a class="btn btn-primary btn-lg me-2" href="/party/create">Create Party</a>
2024-09-28 01:31:46 +01:00
<a class="btn btn-primary btn-lg" href="/party/join">Join Party</a>
2024-04-23 00:58:07 +01:00
</div>
2024-09-29 21:35:36 +01:00
<% if (user.UserLevel === UserLevel.BadgeEditor) { %>
<div class="mt-3">
<a class="btn btn-primary btn-lg" href="/admin/badges">Badge Management</a>
</div>
<% } %>
2024-09-28 01:31:46 +01:00
<% if (user.UserLevel === UserLevel.Admin) { %>
<div class="mt-3">
<a class="btn btn-primary btn-lg" href="/admin">Admin Dashboard</a>
</div>
<% } %>
2024-04-23 00:58:07 +01:00
</div>
</div>
<div class="col">
<h3>Your Parties</h3>
<% if (parties.length > 0) { %>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Name</th>
2024-04-23 17:01:25 +01:00
<th scope="col">Code</th>
2024-04-23 00:58:07 +01:00
<th scope="col"></th>
</tr>
2024-04-23 17:01:25 +01:00
</thead>
<tbody>
<% for (const party of parties) { %>
<tr>
<td><%= party.Name %></td>
2024-09-28 01:31:46 +01:00
<td class="align-middle"><%= party.PartyRef %></td>
<td class="text-end text-nowrap align-middle">
2024-04-24 00:05:57 +01:00
<% if (activeUserParty && activeUserParty.PartyId === party.Id) { %>
<a href="/party/deactivate" class="btn btn-sm btn-success me-2">Deactivate</a>
<% } else { %>
2024-09-28 01:31:46 +01:00
<a href="/party/setactive?id=<%= party.Id %>" class="btn btn-sm btn-success me-2"> Activate </a>
2024-04-24 00:05:57 +01:00
<% } %>
2024-04-23 17:01:25 +01:00
<% if (party.CreatedByUserId === user.Id) { %>
2024-09-23 23:55:00 +01:00
<a href="/party/delete?id=<%= party.Id %>" class="btn btn-sm btn-danger" onclick="return confirm(`Are you sure you want to delete '<%= party.Name %>'?\nThis will remove all users in this party from it.\nThis action cannot be undone.`)">Delete</a>
2024-04-23 17:01:25 +01:00
<% } else { %>
2024-09-28 01:31:46 +01:00
<a href="/party/leave?id=<%= party.Id %>" class="btn btn-sm btn-danger" style="width:4.275rem" onclick="return confirm(`Are you sure you want to leave '<%= party.Name %>'?`)">Leave</a>
2024-04-23 17:01:25 +01:00
<% } %>
</td>
</tr>
<% } %>
</tbody>
2024-04-23 00:58:07 +01:00
</table>
<% } else { %>
<div class="alert alert-primary" role="alert">You are not in any parties.</div>
<% } %>
</div>
</div>
2024-10-08 09:41:47 +01:00
<div class="row">
<div class="col">
<h3>Badges</h3>
<div class="row mt-4">
<div class="col">
<% for (let i = 0; i < 71; i++) { %>
<img class="mb-3" src="https://eusv.net/Mu6LedXkxrZDUB">
<% } %>
</div>
</div>
</div>
</div>
2024-09-19 00:41:40 +01:00
<%- include("../base/footer") %>