Badges: template controls cfg, collapsible form sections, navigation polish
- badge_template_form: fix default field visibility (location off render, pronouns/leads excluded from controls); fix duplicate QR checkboxes by removing orphan show_qr_front/back state vars; reorganize Advanced cfg_json into labeled sub-groups; make all 5 non-Advanced sections collapsible (general starts open, rest collapsed) - print_controls: add DEFAULT_SHOWN constant so field_shown() uses explicit whitelist fallback instead of showing all fields when no controls_cfg is set - badges config +page: add Templates navigation button in header (FileText icon) - templates +page: add back-nav header with ArrowLeft to badges/config, Settings icon, page title Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -153,11 +153,16 @@ const DEFAULT_AUTH_EDITABLE = [
|
||||
'pronouns'
|
||||
];
|
||||
|
||||
// Default shown fields in the controls panel when the template has no explicit controls_cfg.
|
||||
// Pronouns and lead scanning are off by default — most events don't expose them.
|
||||
// WHY: prevents clutter for attendees at the badge table; events that need them must opt in via template config.
|
||||
const DEFAULT_SHOWN = ['name', 'title', 'affiliations', 'location'];
|
||||
|
||||
/** Is this field card shown in the panel at all? trusted+edit always sees all fields. */
|
||||
function field_shown(field: string): boolean {
|
||||
if (is_trusted && is_global_edit_mode) return true;
|
||||
const cfg = template_controls_cfg;
|
||||
if (!cfg?.shown) return true;
|
||||
if (!cfg?.shown) return DEFAULT_SHOWN.includes(field);
|
||||
return cfg.shown.includes(field);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user