<%- include('../partials/header') %>

<%= typeof isAdmin !== 'undefined' && isAdmin ? 'Admin' : 'Organizer' %> Dashboard

+ New Hunt
<% if (hunts.length === 0) { %>

You haven't created any hunts yet.

Create Your First Hunt
<% } else { %> <% hunts.forEach(hunt => { %>

<%= hunt.name %>

<%= hunt.short_name %> · <%= hunt.package_count %> packages <% if (hunt.expiry_date) { %> · Expires: <%= new Date(hunt.expiry_date).toLocaleDateString() %><% } %>
Manage
<% }) %> <% } %> <% if (typeof isAdmin !== 'undefined' && isAdmin) { %>

Password Reset

Generate a one-time password reset link for a user. The link expires in 24 hours.

<% if (typeof resetUrl !== 'undefined' && resetUrl) { %>

Reset link for <%= resetUsername %>:

Send this link to the user. It expires in 24 hours and can only be used once.

<% } %>

Manage Roles

Grant or revoke the Organizer role. Organizers can create hunts and manage their own hunts only.

<% if (typeof users !== 'undefined' && users) { users.filter(u => !u.is_admin).forEach(u => { %> <% }); } %>
UserRoleAction
<%= u.username %> <%= u.is_organizer ? 'Organizer' : 'Player' %> <% if (u.is_organizer) { %>
<% } else { %>
<% } %>
<% } %>
<%- include('../partials/footer') %>