diff --git a/documentation/MODULE__AE_Events_Badge_Templates.md b/documentation/MODULE__AE_Events_Badge_Templates.md index acaf6c30..fe89f423 100644 --- a/documentation/MODULE__AE_Events_Badge_Templates.md +++ b/documentation/MODULE__AE_Events_Badge_Templates.md @@ -274,6 +274,24 @@ Per-layout height overrides for the auto-scaling text zones. Set any subset — | `affiliations` | Height of the affiliations text zone | | `location` | Height of the location text zone | +### Punch-Out Hole Markers (`punch_holes`) + +Enables X overlays at the physical badge clip slot positions. Slots are pre-perforated on the badge stock — the markers print on the badge so attendees know where to push them out. + +**Slot dimensions:** 5/8″ wide × 1/8″ tall, 1/4″ from top edge, 3/8″ from left/right edges. Center slot is horizontally centered. + +```json +"punch_holes": { "left": true, "right": true, "center": false } +``` + +| Key | Default | Notes | +| --- | --- | --- | +| `punch_holes.left` | `false` | Left clip slot marker | +| `punch_holes.right` | `false` | Right clip slot marker | +| `punch_holes.center` | `false` | Center clip slot marker (less common) | + +--- + ### Controls Panel (`controls_cfg`) Controls which fields appear in the print controls panel for non-trusted users, and which fields authenticated users may edit. Trusted + Edit Mode always sees and can edit all fields regardless of this config. diff --git a/src/lib/ae_events/types/ae_badge_template_cfg.ts b/src/lib/ae_events/types/ae_badge_template_cfg.ts index 0aca69e5..a63bf08a 100644 --- a/src/lib/ae_events/types/ae_badge_template_cfg.ts +++ b/src/lib/ae_events/types/ae_badge_template_cfg.ts @@ -52,6 +52,16 @@ export interface BadgeTemplateCfg { // Any CSS length: "0.5in", "1rem". Unset = no extra padding. header_padding_bottom?: string; + // Punch-out hole markers: show X overlays at the physical badge clip slot positions. + // Slots are pre-perforated on the badge stock — markers guide attendees to push them out. + // Hole dimensions: 5/8in wide × 1/8in tall, 1/4in from top, 3/8in from left/right edges. + // Center hole: horizontally centered, same vertical position. + punch_holes?: { + left?: boolean; + right?: boolean; + center?: boolean; + }; + // Allow arbitrary extra keys to preserve forward-compatibility. [key: string]: any; } diff --git a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte index 81a5d268..514bd530 100644 --- a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte @@ -326,6 +326,12 @@ let header_margin_top = $derived.by(() => { return v && typeof v === 'string' && v.trim() ? v.trim() : '2rem'; }); +// Punch-out hole markers: which of the three physical badge clip slots to mark. +// Holes are 5/8in × 1/8in, 1/4in from top, 3/8in from left/right edges (center: horizontally centered). +let punch_holes_left = $derived(!!template_cfg?.punch_holes?.left); +let punch_holes_right = $derived(!!template_cfg?.punch_holes?.right); +let punch_holes_center = $derived(!!template_cfg?.punch_holes?.center); + // Full inline style string for the badge_header div. // Combines margin-top, optional bottom border (color + width), and optional bottom padding. // Unset border_color = no border drawn. @@ -662,6 +668,43 @@ const code_to_icon: { {#if show_badge_back}Front of badge{:else}Badge preview{/if} + + {#if punch_holes_left} + + {/if} + {#if punch_holes_right} + + {/if} + {#if punch_holes_center} + + {/if} +