allow for a starting date and hidden hunt if it hasnt started
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 31s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 31s
This commit is contained in:
@@ -40,6 +40,18 @@
|
||||
<div class="form-hint">Leave blank for no expiry.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="start_date">Start Date (optional)</label>
|
||||
<input type="datetime-local" id="start_date" name="start_date" class="form-control">
|
||||
<div class="form-hint">When the hunt becomes active. Leave blank to start immediately.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: flex; align-items: center; gap: 0.5rem;">
|
||||
<input type="checkbox" id="hidden_until_start" name="hidden_until_start" value="1">
|
||||
<label for="hidden_until_start" style="margin: 0; cursor: pointer;">Hidden until start date</label>
|
||||
<div class="form-hint" style="margin-left: auto;">Keep this hunt secret until the start time.</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; justify-content: center;">Create Hunt</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -18,10 +18,18 @@
|
||||
<h3><%= hunt.name %></h3>
|
||||
<span class="meta"><%= hunt.short_name %> · <%= hunt.package_count %> packages
|
||||
<% if (isAdmin && hunt.creator_name) { %> · by <%= hunt.creator_name %><% } %>
|
||||
<% if (hunt.expiry_date) { %> · Expires: <%= new Date(hunt.expiry_date).toLocaleDateString() %><% } %>
|
||||
<% if (hunt.expiry_date) { %> · Expires <time datetime="<%= hunt.expiry_date %>"><%= new Date(hunt.expiry_date).toLocaleDateString() %></time><% } %>
|
||||
<% if (hunt.start_date) { %> · Starts <time datetime="<%= hunt.start_date %>"><%= new Date(hunt.start_date).toLocaleDateString() %></time><% } %>
|
||||
</span>
|
||||
</div>
|
||||
<span class="badge">Manage</span>
|
||||
<div style="display: flex; gap: 0.4rem; align-items: center;">
|
||||
<% if (hunt.hidden_until_start && hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %>
|
||||
<span class="badge expired" style="font-size: 0.7rem;">Hidden</span>
|
||||
<% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %>
|
||||
<span class="badge" style="font-size: 0.7rem;">Upcoming</span>
|
||||
<% } %>
|
||||
<span class="badge">Manage</span>
|
||||
</div>
|
||||
</a>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
@@ -36,6 +36,19 @@
|
||||
<div class="form-hint">Leave blank for no expiry.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="start_date">Start Date (optional)</label>
|
||||
<input type="datetime-local" id="start_date" name="start_date" class="form-control"
|
||||
value="<%= hunt.start_date ? new Date(hunt.start_date).toISOString().slice(0, 16) : '' %>">
|
||||
<div class="form-hint">When the hunt becomes active. Leave blank to start immediately.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: flex; align-items: center; gap: 0.5rem;">
|
||||
<input type="checkbox" id="hidden_until_start" name="hidden_until_start" value="1" <%= hunt.hidden_until_start ? 'checked' : '' %>>
|
||||
<label for="hidden_until_start" style="margin: 0; cursor: pointer;">Hidden until start date</label>
|
||||
<div class="form-hint" style="margin-left: auto;">Keep this hunt secret until the start time.</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; justify-content: center;">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -42,9 +42,15 @@
|
||||
<div class="label">Discovery Rate</div>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<div class="value"><%= hunt.expiry_date ? new Date(hunt.expiry_date).toLocaleDateString() : 'Never' %></div>
|
||||
<div class="value"><% if (hunt.expiry_date) { %><time datetime="<%= hunt.expiry_date %>"><%= new Date(hunt.expiry_date).toLocaleDateString() %></time><% } else { %>Never<% } %></div>
|
||||
<div class="label">Expires</div>
|
||||
</div>
|
||||
<% if (hunt.start_date) { %>
|
||||
<div class="stat-box">
|
||||
<div class="value"><time datetime="<%= hunt.start_date %>"><%= new Date(hunt.start_date).toLocaleDateString() %></time></div>
|
||||
<div class="label">Starts</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (typeof stats !== 'undefined' && stats.topFinders.length > 0) { %>
|
||||
|
||||
@@ -52,10 +52,14 @@
|
||||
<a href="/hunt/<%= hunt.short_name %>" class="hunt-card">
|
||||
<div class="hunt-info">
|
||||
<h3><%= hunt.name %></h3>
|
||||
<span class="meta"><%= hunt.short_name %> · <%= hunt.package_count %> packages · by <%= hunt.creator_name %></span>
|
||||
<span class="meta"><%= hunt.short_name %> · <%= hunt.package_count %> packages · by <%= hunt.creator_name %>
|
||||
<% if (hunt.expiry_date) { %> · Expires <time datetime="<%= hunt.expiry_date %>"><%= new Date(hunt.expiry_date).toLocaleDateString() %></time><% } %>
|
||||
</span>
|
||||
</div>
|
||||
<% if (hunt.expiry_date && new Date(hunt.expiry_date) < new Date()) { %>
|
||||
<% if (hunt.expiry_date && new Date(hunt.expiry_date + 'Z') < new Date()) { %>
|
||||
<span class="badge expired">Expired</span>
|
||||
<% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %>
|
||||
<span class="badge">Upcoming</span>
|
||||
<% } else { %>
|
||||
<span class="badge"><%= hunt.package_count %> packages</span>
|
||||
<% } %>
|
||||
|
||||
@@ -14,12 +14,17 @@
|
||||
<h3><%= hunt.name %></h3>
|
||||
<span class="meta"><%= hunt.short_name %> · <%= hunt.package_count %> packages · by <%= hunt.creator_name %>
|
||||
<% if (hunt.expiry_date) { %>
|
||||
· Expires: <%= new Date(hunt.expiry_date).toLocaleDateString() %>
|
||||
· Expires <time datetime="<%= hunt.expiry_date %>"><%= new Date(hunt.expiry_date).toLocaleDateString() %></time>
|
||||
<% } %>
|
||||
<% if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %>
|
||||
· 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()) { %>
|
||||
<% if (hunt.expiry_date && new Date(hunt.expiry_date + 'Z') < new Date()) { %>
|
||||
<span class="badge expired">Expired</span>
|
||||
<% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %>
|
||||
<span class="badge">Upcoming</span>
|
||||
<% } else { %>
|
||||
<span class="badge"><%= hunt.package_count %> packages</span>
|
||||
<% } %>
|
||||
|
||||
Reference in New Issue
Block a user