feat(idaa/recovery_meetings): collapse Admin Options section by default
Admin Options are rarely changed; collapsing by default reduces visual noise on the long edit form. Hidden inputs preserve status/enable/hide/ priority/sort/group values when the section is collapsed so a save never silently resets admin fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,9 @@
|
|||||||
// Trusted+ users see no lock UI; new meetings start unlocked.
|
// Trusted+ users see no lock UI; new meetings start unlocked.
|
||||||
let contact_1_locked = $state(!!$idaa_slct.event_id && !$ae_loc.trusted_access);
|
let contact_1_locked = $state(!!$idaa_slct.event_id && !$ae_loc.trusted_access);
|
||||||
|
|
||||||
|
// Admin Options section collapsed by default — trusted users rarely need these fields.
|
||||||
|
let show_admin_options = $state(false);
|
||||||
|
|
||||||
// Auto-expand Contact 2 if the meeting already has data in that slot,
|
// Auto-expand Contact 2 if the meeting already has data in that slot,
|
||||||
// so existing contact info is never silently hidden on load.
|
// so existing contact info is never silently hidden on load.
|
||||||
let show_contact_2 = $state(
|
let show_contact_2 = $state(
|
||||||
@@ -1634,7 +1637,7 @@ Copy and paste link: <a href="${link_base_url}?event_id=${event_do.event_id}">${
|
|||||||
onclick={() => (show_contact_2 = !show_contact_2)}
|
onclick={() => (show_contact_2 = !show_contact_2)}
|
||||||
>
|
>
|
||||||
<span class="fas fa-{show_contact_2 ? 'caret-down' : 'caret-right'} text-xs opacity-60"></span>
|
<span class="fas fa-{show_contact_2 ? 'caret-down' : 'caret-right'} text-xs opacity-60"></span>
|
||||||
<h4 class="subsection-heading !mb-0">
|
<h4 class="subsection-heading mb-0!">
|
||||||
<span class="fas fa-user-plus"></span> Contact 2 (Optional)
|
<span class="fas fa-user-plus"></span> Contact 2 (Optional)
|
||||||
</h4>
|
</h4>
|
||||||
</button>
|
</button>
|
||||||
@@ -1724,96 +1727,116 @@ Copy and paste link: <a href="${link_base_url}?event_id=${event_do.event_id}">${
|
|||||||
============================================================ -->
|
============================================================ -->
|
||||||
{#if $ae_loc.trusted_access}
|
{#if $ae_loc.trusted_access}
|
||||||
<div class="section-card section-card--admin" id="section__admin_options">
|
<div class="section-card section-card--admin" id="section__admin_options">
|
||||||
<h3 class="section-heading">
|
<button
|
||||||
<span class="fas fa-cogs"></span>
|
type="button"
|
||||||
Admin Options
|
class="flex flex-row items-center gap-2 text-left w-full"
|
||||||
</h3>
|
onclick={() => (show_admin_options = !show_admin_options)}
|
||||||
|
>
|
||||||
|
<span class="fas fa-{show_admin_options ? 'caret-down' : 'caret-right'} text-xs opacity-60"></span>
|
||||||
|
<h3 class="section-heading mb-0!">
|
||||||
|
<span class="fas fa-cogs"></span>
|
||||||
|
Admin Options
|
||||||
|
</h3>
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Status -->
|
{#if show_admin_options}
|
||||||
<label class="field-label" for="status">
|
<!-- Status -->
|
||||||
Status
|
<label class="field-label" for="status">
|
||||||
<input
|
Status
|
||||||
type="text"
|
|
||||||
id="status"
|
|
||||||
name="status"
|
|
||||||
placeholder="e.g. active, pending, closed"
|
|
||||||
value={$lq__event_obj?.status ?? ''}
|
|
||||||
class="field-input w-52"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<!-- Enable / Hide / Priority toggles -->
|
|
||||||
<div class="flex flex-row flex-wrap gap-4">
|
|
||||||
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="enable">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id="enable"
|
|
||||||
name="enable"
|
|
||||||
checked={$lq__event_obj?.enable ?? true}
|
|
||||||
class="checkbox"
|
|
||||||
/>
|
|
||||||
Enabled
|
|
||||||
</label>
|
|
||||||
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="hide">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id="hide"
|
|
||||||
name="hide"
|
|
||||||
checked={$lq__event_obj?.hide ?? false}
|
|
||||||
class="checkbox"
|
|
||||||
/>
|
|
||||||
Hidden
|
|
||||||
</label>
|
|
||||||
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="priority">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id="priority"
|
|
||||||
name="priority"
|
|
||||||
checked={$lq__event_obj?.priority ?? false}
|
|
||||||
class="checkbox"
|
|
||||||
/>
|
|
||||||
Priority (Featured)
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Sort + Group -->
|
|
||||||
<div class="flex flex-row flex-wrap gap-3">
|
|
||||||
<label class="field-label" for="sort">
|
|
||||||
Sort Order
|
|
||||||
<span class="field-hint">Lower numbers appear first</span>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
id="sort"
|
|
||||||
name="sort"
|
|
||||||
placeholder="0"
|
|
||||||
value={$lq__event_obj?.sort ?? ''}
|
|
||||||
class="field-input w-28"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label class="field-label" for="group">
|
|
||||||
Group
|
|
||||||
<span class="field-hint">Optional grouping label</span>
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="group"
|
id="status"
|
||||||
name="group"
|
name="status"
|
||||||
placeholder="e.g. North America"
|
placeholder="e.g. active, pending, closed"
|
||||||
value={$lq__event_obj?.group ?? ''}
|
value={$lq__event_obj?.status ?? ''}
|
||||||
class="field-input w-48"
|
class="field-input w-52"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Notes — internal, not visible to members -->
|
<!-- Enable / Hide / Priority toggles -->
|
||||||
<label class="field-label" for="notes">
|
<div class="flex flex-row flex-wrap gap-4">
|
||||||
Admin Notes
|
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="enable">
|
||||||
<span class="field-hint">Internal only — not visible to members</span>
|
<input
|
||||||
<AE_Comp_Editor_TipTap
|
type="checkbox"
|
||||||
bind:content={notes_new_html}
|
id="enable"
|
||||||
class_li="field-richtext"
|
name="enable"
|
||||||
placeholder="Internal notes about this meeting"
|
checked={$lq__event_obj?.enable ?? true}
|
||||||
/>
|
class="checkbox"
|
||||||
</label>
|
/>
|
||||||
|
Enabled
|
||||||
|
</label>
|
||||||
|
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="hide">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="hide"
|
||||||
|
name="hide"
|
||||||
|
checked={$lq__event_obj?.hide ?? false}
|
||||||
|
class="checkbox"
|
||||||
|
/>
|
||||||
|
Hidden
|
||||||
|
</label>
|
||||||
|
<label class="flex items-center gap-2 cursor-pointer text-sm font-semibold" for="priority">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="priority"
|
||||||
|
name="priority"
|
||||||
|
checked={$lq__event_obj?.priority ?? false}
|
||||||
|
class="checkbox"
|
||||||
|
/>
|
||||||
|
Priority (Featured)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Sort + Group -->
|
||||||
|
<div class="flex flex-row flex-wrap gap-3">
|
||||||
|
<label class="field-label" for="sort">
|
||||||
|
Sort Order
|
||||||
|
<span class="field-hint">Lower numbers appear first</span>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
id="sort"
|
||||||
|
name="sort"
|
||||||
|
placeholder="0"
|
||||||
|
value={$lq__event_obj?.sort ?? ''}
|
||||||
|
class="field-input w-28"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label class="field-label" for="group">
|
||||||
|
Group
|
||||||
|
<span class="field-hint">Optional grouping label</span>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="group"
|
||||||
|
name="group"
|
||||||
|
placeholder="e.g. North America"
|
||||||
|
value={$lq__event_obj?.group ?? ''}
|
||||||
|
class="field-input w-48"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Notes — internal, not visible to members -->
|
||||||
|
<label class="field-label" for="notes">
|
||||||
|
Admin Notes
|
||||||
|
<span class="field-hint">Internal only — not visible to members</span>
|
||||||
|
<AE_Comp_Editor_TipTap
|
||||||
|
bind:content={notes_new_html}
|
||||||
|
class_li="field-richtext"
|
||||||
|
placeholder="Internal notes about this meeting"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
{:else}
|
||||||
|
<!-- Hidden inputs preserve admin field values when section is collapsed.
|
||||||
|
Checkboxes are omitted from FormData when unchecked, so we use
|
||||||
|
hidden inputs with '1'/'0' string values that the submit handler
|
||||||
|
already converts via form_data.get(). -->
|
||||||
|
<input type="hidden" name="status" value={$lq__event_obj?.status ?? ''} />
|
||||||
|
<input type="hidden" name="enable" value={$lq__event_obj?.enable ? 'true' : 'false'} />
|
||||||
|
<input type="hidden" name="hide" value={$lq__event_obj?.hide ? 'true' : 'false'} />
|
||||||
|
<input type="hidden" name="priority" value={$lq__event_obj?.priority ? 'true' : 'false'} />
|
||||||
|
<input type="hidden" name="sort" value={$lq__event_obj?.sort ?? ''} />
|
||||||
|
<input type="hidden" name="group" value={$lq__event_obj?.group ?? ''} />
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user