chore(badges): tidy badge template form grouping and advanced cfg_json

This commit is contained in:
Scott Idem
2026-04-08 13:29:11 -04:00
parent b02843e467
commit ef5c807c27

View File

@@ -252,11 +252,12 @@ function handle_cancel() {
<form onsubmit={prevent_default(handle_submit)} class="space-y-4 p-4"> <form onsubmit={prevent_default(handle_submit)} class="space-y-4 p-4">
<h3 class="h3">{template_id ? 'Edit' : 'Create New'} Badge Template</h3> <h3 class="h3">{template_id ? 'Edit' : 'Create New'} Badge Template</h3>
<section class="space-y-3">
<h4 class="font-semibold">General</h4>
<label class="label"> <label class="label">
<span>Template Name</span> <span>Template Name</span>
<input type="text" bind:value={name} class="input" required /> <input type="text" bind:value={name} class="input" required />
</label> </label>
<label class="label"> <label class="label">
<span>Background Image Path (URL) — full-badge background, replaces header</span> <span>Background Image Path (URL) — full-badge background, replaces header</span>
<input type="text" bind:value={background_image_path} class="input" /> <input type="text" bind:value={background_image_path} class="input" />
@@ -266,7 +267,10 @@ function handle_cancel() {
⚠ When a background image is set, the header path and logo/text header are hidden on the badge front — the background image covers the full badge. ⚠ When a background image is set, the header path and logo/text header are hidden on the badge front — the background image covers the full badge.
</p> </p>
{/if} {/if}
</section>
<section class="space-y-3">
<h4 class="font-semibold">Header & Branding</h4>
<label class="label"> <label class="label">
<span>Header Path (URL) — top banner image (used when no background image)</span> <span>Header Path (URL) — top banner image (used when no background image)</span>
<input type="text" bind:value={header_path} class="input" /> <input type="text" bind:value={header_path} class="input" />
@@ -289,12 +293,18 @@ function handle_cancel() {
<span>Secondary Header Path (URL, back of badge)</span> <span>Secondary Header Path (URL, back of badge)</span>
<input type="text" bind:value={secondary_header_path} class="input" /> <input type="text" bind:value={secondary_header_path} class="input" />
</label> </label>
</section>
<section class="space-y-3">
<h4 class="font-semibold">Footer</h4>
<label class="label"> <label class="label">
<span>Footer Text (HTML allowed)</span> <span>Footer Text (HTML allowed)</span>
<textarea bind:value={footer_text} class="textarea" rows="2"></textarea> <textarea bind:value={footer_text} class="textarea" rows="2"></textarea>
</label> </label>
</section>
<section class="space-y-3">
<h4 class="font-semibold">QR & Wireless</h4>
<label class="label flex items-center gap-2"> <label class="label flex items-center gap-2">
<input type="checkbox" bind:checked={show_qr_front} class="checkbox" /> <input type="checkbox" bind:checked={show_qr_front} class="checkbox" />
<span>Show QR Code on Front</span> <span>Show QR Code on Front</span>
@@ -303,7 +313,6 @@ function handle_cancel() {
<input type="checkbox" bind:checked={show_qr_back} class="checkbox" /> <input type="checkbox" bind:checked={show_qr_back} class="checkbox" />
<span>Show QR Code on Back</span> <span>Show QR Code on Back</span>
</label> </label>
<label class="label"> <label class="label">
<span>Wireless SSID</span> <span>Wireless SSID</span>
<input type="text" bind:value={wireless_ssid} class="input" /> <input type="text" bind:value={wireless_ssid} class="input" />
@@ -312,7 +321,10 @@ function handle_cancel() {
<span>Wireless Password</span> <span>Wireless Password</span>
<input type="text" bind:value={wireless_password} class="input" /> <input type="text" bind:value={wireless_password} class="input" />
</label> </label>
</section>
<section class="space-y-3">
<h4 class="font-semibold">Tickets</h4>
<label class="label"> <label class="label">
<span>Ticket 1 Text (HTML allowed)</span> <span>Ticket 1 Text (HTML allowed)</span>
<textarea bind:value={ticket_1_text} class="textarea" rows="2" <textarea bind:value={ticket_1_text} class="textarea" rows="2"
@@ -328,6 +340,7 @@ function handle_cancel() {
<textarea bind:value={ticket_3_text} class="textarea" rows="2" <textarea bind:value={ticket_3_text} class="textarea" rows="2"
></textarea> ></textarea>
</label> </label>
</section>
<section class="border-t pt-3"> <section class="border-t pt-3">
<button type="button" class="text-sm text-surface-500" onclick={() => (advanced_open = !advanced_open)}> <button type="button" class="text-sm text-surface-500" onclick={() => (advanced_open = !advanced_open)}>