fix(badges): move Reports link to trusted+edit toolbar, add reprint count
Reports link moved out of the enable_mass_print gate into the main trusted+edit-mode toolbar, to the right of Templates — visible whenever staff are in edit mode regardless of mass-print config. Reports page header now shows reprint count in parentheses when > 0, e.g. "142 badges · 98 printed (7 reprints)". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -492,6 +492,12 @@ async function handle_search_refresh(params: any) {
|
|||||||
Templates
|
Templates
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
<a
|
||||||
|
href={`/events/${$events_slct?.event_id}/badges/reports`}
|
||||||
|
class="btn btn-sm preset-tonal-surface border-surface-300-700 border">
|
||||||
|
<TrendingUp size="1em" />
|
||||||
|
Reports
|
||||||
|
</a>
|
||||||
|
|
||||||
{#if badges_loc.current.enable_add_badge_btn ?? true}
|
{#if badges_loc.current.enable_add_badge_btn ?? true}
|
||||||
<button
|
<button
|
||||||
@@ -545,11 +551,6 @@ async function handle_search_refresh(params: any) {
|
|||||||
class="btn btn-tertiary">
|
class="btn btn-tertiary">
|
||||||
<ChartColumnBig size="1em" /> Badge Printing Stats
|
<ChartColumnBig size="1em" /> Badge Printing Stats
|
||||||
</a>
|
</a>
|
||||||
<a
|
|
||||||
href={`/events/${$events_slct?.event_id}/badges/reports`}
|
|
||||||
class="btn btn-tertiary">
|
|
||||||
<TrendingUp size="1em" /> Badge Reports
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ let lq__badge_li = $derived(
|
|||||||
let is_trusted = $derived($ae_loc?.trusted_access === true);
|
let is_trusted = $derived($ae_loc?.trusted_access === true);
|
||||||
let badge_count = $derived($lq__badge_li?.length ?? 0);
|
let badge_count = $derived($lq__badge_li?.length ?? 0);
|
||||||
let printed_count = $derived($lq__badge_li?.filter((b) => (b.print_count ?? 0) >= 1).length ?? 0);
|
let printed_count = $derived($lq__badge_li?.filter((b) => (b.print_count ?? 0) >= 1).length ?? 0);
|
||||||
|
let reprint_count = $derived(
|
||||||
|
$lq__badge_li?.reduce((sum, b) => sum + Math.max(0, (b.print_count ?? 0) - 1), 0) ?? 0
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -72,7 +75,7 @@ let printed_count = $derived($lq__badge_li?.filter((b) => (b.print_count ?? 0) >
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm text-gray-500">
|
<div class="text-sm text-gray-500">
|
||||||
{badge_count} badges · {printed_count} printed
|
{badge_count} badges · {printed_count} printed{reprint_count > 0 ? ` (${reprint_count} reprint${reprint_count !== 1 ? 's' : ''})` : ''}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user