feat(badges): add Templates link on badge search page for manager access

Shows a Templates button (manager+ edit mode only) before Create Badge,
linking directly to the badge templates management page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-04 19:03:11 -04:00
parent f5ccd2e3cf
commit 399f98ce8e

View File

@@ -32,7 +32,7 @@ import Comp_badge_obj_li from './ae_comp__badge_obj_li.svelte';
import Comp_badge_create_form from './ae_comp__badge_create_form.svelte';
import Comp_badge_upload_form from './ae_comp__badge_upload_form.svelte';
import { UserPlus, Printer, Upload, FileText, ChartColumnBig } from '@lucide/svelte';
import { UserPlus, Printer, Upload, FileText, ChartColumnBig, LayoutTemplate } from '@lucide/svelte';
// Load templates for this event so the create form can show the selector and
// derive badge_type_code_li from whichever template the user picks.
@@ -484,6 +484,15 @@ async function handle_search_refresh(params: any) {
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<div transition:slide={{ duration: 200 }} class="flex flex-row gap-1 items-center justify-center">
{#if $ae_loc.manager_access}
<a
href="/events/{$events_slct?.event_id}/badges/templates"
class="btn btn-sm preset-tonal-surface border-surface-300-700 border">
<LayoutTemplate size="1em" />
Templates
</a>
{/if}
{#if badges_loc.current.enable_add_badge_btn ?? true}
<button
type="button"