Files
loot-hunt/src/views/hunt/list.ejs
Mike Johnston 6e4b1b972b
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 29s
fix: update date handling to remove timezone offset for hunts
2026-03-20 11:15:26 -04:00

37 lines
1.5 KiB
Plaintext

<%- include('../partials/header') %>
<div class="container">
<h1 style="margin-bottom: 1.5rem;">All Hunts</h1>
<% if (hunts.length === 0) { %>
<div class="card" style="text-align: center; padding: 3rem;">
<p style="color: var(--muted);">No hunts have been created yet.</p>
</div>
<% } else { %>
<% hunts.forEach(hunt => { %>
<a href="/hunt/<%= hunt.short_name %>" class="hunt-card">
<div class="hunt-info">
<h3><%= hunt.name %></h3>
<span class="meta"><%= hunt.short_name %> &middot; <%= hunt.package_count %> packages &middot; by <%= hunt.creator_name %>
<% if (hunt.expiry_date) { %>
&middot; Expires <time datetime="<%= hunt.expiry_date %>"><%= new Date(hunt.expiry_date).toLocaleDateString() %></time>
<% } %>
<% if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %>
&middot; Starts <time datetime="<%= hunt.start_date %>"><%= new Date(hunt.start_date).toLocaleDateString() %></time>
<% } %>
</span>
</div>
<% if (hunt.expiry_date && new Date(hunt.expiry_date) < new Date()) { %>
<span class="badge expired">Expired</span>
<% } else if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %>
<span class="badge">Upcoming</span>
<% } else { %>
<span class="badge"><%= hunt.package_count %> packages</span>
<% } %>
</a>
<% }) %>
<% } %>
</div>
<%- include('../partials/footer') %>