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.
|
||||
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,
|
||||
// so existing contact info is never silently hidden on load.
|
||||
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)}
|
||||
>
|
||||
<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)
|
||||
</h4>
|
||||
</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}
|
||||
<div class="section-card section-card--admin" id="section__admin_options">
|
||||
<h3 class="section-heading">
|
||||
<span class="fas fa-cogs"></span>
|
||||
Admin Options
|
||||
</h3>
|
||||
<button
|
||||
type="button"
|
||||
class="flex flex-row items-center gap-2 text-left w-full"
|
||||
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 -->
|
||||
<label class="field-label" for="status">
|
||||
Status
|
||||
<input
|
||||
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>
|
||||
{#if show_admin_options}
|
||||
<!-- Status -->
|
||||
<label class="field-label" for="status">
|
||||
Status
|
||||
<input
|
||||
type="text"
|
||||
id="group"
|
||||
name="group"
|
||||
placeholder="e.g. North America"
|
||||
value={$lq__event_obj?.group ?? ''}
|
||||
class="field-input w-48"
|
||||
id="status"
|
||||
name="status"
|
||||
placeholder="e.g. active, pending, closed"
|
||||
value={$lq__event_obj?.status ?? ''}
|
||||
class="field-input w-52"
|
||||
/>
|
||||
</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>
|
||||
<!-- 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
|
||||
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>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user