feat: enhance mobile stats display in manage hunt view
Build Images and Deploy / Update-PROD-Stack (push) Successful in 29s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 29s
This commit is contained in:
@@ -722,6 +722,26 @@ tr:hover {
|
|||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Manage hunt: on mobile, show Total Scans, Discovery Rate, Starts, Expires */
|
||||||
|
.manage-stats {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.manage-stats-row-1 {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
.manage-stats-row-2 {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
.manage-stats-row-1 .stat-box:nth-child(1),
|
||||||
|
.manage-stats-row-1 .stat-box:nth-child(2) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide-mobile {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Package grid */
|
/* Package grid */
|
||||||
.package-grid {
|
.package-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|||||||
@@ -20,37 +20,39 @@
|
|||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<div class="stats-row">
|
<div class="manage-stats">
|
||||||
<div class="stat-box">
|
<div class="stats-row manage-stats-row-1">
|
||||||
<div class="value"><%= hunt.package_count %></div>
|
<div class="stat-box">
|
||||||
<div class="label">Packages</div>
|
<div class="value"><%= hunt.package_count %></div>
|
||||||
|
<div class="label">Packages</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-box">
|
||||||
|
<div class="value"><%= packages.filter(p => p.scan_count > 0).length %></div>
|
||||||
|
<div class="label">Found</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-box">
|
||||||
|
<div class="value"><% if (hunt.start_date) { %><time datetime="<%= hunt.start_date %>"><%= new Date(hunt.start_date).toLocaleDateString() %></time><% } else { %>—<% } %></div>
|
||||||
|
<div class="label">Starts</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-box">
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-box">
|
<div class="stats-row manage-stats-row-2">
|
||||||
<div class="value"><%= packages.filter(p => p.scan_count > 0).length %></div>
|
<div class="stat-box">
|
||||||
<div class="label">Found</div>
|
<div class="value"><%= packages.reduce((sum, p) => sum + p.scan_count, 0) %></div>
|
||||||
|
<div class="label">Total Scans</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-box hide-mobile">
|
||||||
|
<div class="value"><%= typeof stats !== 'undefined' ? stats.uniquePlayers : 0 %></div>
|
||||||
|
<div class="label">Players</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-box">
|
||||||
|
<div class="value"><%= typeof stats !== 'undefined' ? stats.discoveryRate + '%' : '0%' %></div>
|
||||||
|
<div class="label">Discovery Rate</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-box">
|
|
||||||
<div class="value"><%= packages.reduce((sum, p) => sum + p.scan_count, 0) %></div>
|
|
||||||
<div class="label">Total Scans</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-box">
|
|
||||||
<div class="value"><%= typeof stats !== 'undefined' ? stats.uniquePlayers : 0 %></div>
|
|
||||||
<div class="label">Players</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-box">
|
|
||||||
<div class="value"><%= typeof stats !== 'undefined' ? stats.discoveryRate + '%' : '0%' %></div>
|
|
||||||
<div class="label">Discovery Rate</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-box">
|
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
<% if (typeof stats !== 'undefined' && stats.topFinders.length > 0) { %>
|
<% if (typeof stats !== 'undefined' && stats.topFinders.length > 0) { %>
|
||||||
@@ -101,10 +103,10 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th class="hide-mobile">#</th>
|
||||||
<th>Code</th>
|
<th>Code</th>
|
||||||
<th>Scans</th>
|
<th class="hide-mobile">Scans</th>
|
||||||
<th>First Scanner</th>
|
<th class="hide-mobile">First Scanner</th>
|
||||||
<th>Last Scanner</th>
|
<th>Last Scanner</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -112,10 +114,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% packages.forEach(pkg => { %>
|
<% packages.forEach(pkg => { %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong><%= pkg.card_number %></strong></td>
|
<td class="hide-mobile"><strong><%= pkg.card_number %></strong></td>
|
||||||
<td style="font-family: monospace;"><%= pkg.unique_code %></td>
|
<td style="font-family: monospace;"><%= pkg.unique_code %></td>
|
||||||
<td><%= pkg.scan_count %></td>
|
<td class="hide-mobile"><%= pkg.scan_count %></td>
|
||||||
<td><% if (pkg.first_scanner_name) { %><a href="/player/<%= pkg.first_scanner_name %>"><%= pkg.first_scanner_name %></a><% } else { %>---<% } %></td>
|
<td class="hide-mobile"><% if (pkg.first_scanner_name) { %><a href="/player/<%= pkg.first_scanner_name %>"><%= pkg.first_scanner_name %></a><% } else { %>---<% } %></td>
|
||||||
<td><% if (pkg.last_scanner_name) { %><a href="/player/<%= pkg.last_scanner_name %>"><%= pkg.last_scanner_name %></a><% } else { %>---<% } %></td>
|
<td><% if (pkg.last_scanner_name) { %><a href="/player/<%= pkg.last_scanner_name %>"><%= pkg.last_scanner_name %></a><% } else { %>---<% } %></td>
|
||||||
<td>
|
<td>
|
||||||
<div style="display: flex; gap: 0.4rem; align-items: stretch;">
|
<div style="display: flex; gap: 0.4rem; align-items: stretch;">
|
||||||
|
|||||||
Reference in New Issue
Block a user