Added event edit.
This commit is contained in:
parent
a60ef7d25b
commit
4d3da023fc
2 changed files with 72 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ Coleads are scoped to one or more departments. When creating a colead user, assi
|
||||||
|
|
||||||
## Event Setup
|
## Event Setup
|
||||||
|
|
||||||
1. **Configure your event** — set the event name, venue, dates, and timezone via the API (`PUT /api/event`). These appear on the Dashboard.
|
1. **Configure your event** — go to **Settings** and set the event name, venue, dates, and timezone. These appear on the Dashboard and volunteer signup page.
|
||||||
2. **Create departments** — under Departments, add each department your event needs (e.g., Gate, Greeters, Rangers, Build, LNT).
|
2. **Create departments** — under Departments, add each department your event needs (e.g., Gate, Greeters, Rangers, Build, LNT).
|
||||||
3. **Import participants** — see next section.
|
3. **Import participants** — see next section.
|
||||||
4. **Create shifts** — under Schedule, create shifts for each department with day, start/end time, and capacity.
|
4. **Create shifts** — under Schedule, create shifts for each department with day, start/end time, and capacity.
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { api } from '../api.js'
|
import { api } from '../api.js'
|
||||||
|
import { db } from '../db.js'
|
||||||
|
|
||||||
let loading = $state(true)
|
let loading = $state(true)
|
||||||
let saving = $state(false)
|
let saving = $state(false)
|
||||||
|
let savingEvent = $state(false)
|
||||||
let testing = $state(false)
|
let testing = $state(false)
|
||||||
let error = $state('')
|
let error = $state('')
|
||||||
let success = $state('')
|
let success = $state('')
|
||||||
|
|
@ -18,10 +20,23 @@
|
||||||
let testEmail = $state('')
|
let testEmail = $state('')
|
||||||
let noteLabel = $state('Additional note')
|
let noteLabel = $state('Additional note')
|
||||||
let noteRequired = $state(false)
|
let noteRequired = $state(false)
|
||||||
|
let eventName = $state('')
|
||||||
|
let eventVenue = $state('')
|
||||||
|
let eventStartDate = $state('')
|
||||||
|
let eventEndDate = $state('')
|
||||||
|
let eventTimezone = $state('')
|
||||||
let shiftSignupsOpen = $state(false)
|
let shiftSignupsOpen = $state(false)
|
||||||
let togglingSignups = $state(false)
|
let togglingSignups = $state(false)
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
try {
|
||||||
|
const ev = await api.event.get()
|
||||||
|
eventName = ev.name ?? ''
|
||||||
|
eventVenue = ev.venue ?? ''
|
||||||
|
eventStartDate = ev.start_date ?? ''
|
||||||
|
eventEndDate = ev.end_date ?? ''
|
||||||
|
eventTimezone = ev.timezone ?? ''
|
||||||
|
} catch {}
|
||||||
try {
|
try {
|
||||||
const s = await api.settings.get()
|
const s = await api.settings.get()
|
||||||
smtpHost = s.smtp_host ?? ''
|
smtpHost = s.smtp_host ?? ''
|
||||||
|
|
@ -41,6 +56,28 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function saveEvent(e) {
|
||||||
|
e.preventDefault()
|
||||||
|
savingEvent = true
|
||||||
|
error = ''
|
||||||
|
success = ''
|
||||||
|
try {
|
||||||
|
const updated = await api.event.update({
|
||||||
|
name: eventName,
|
||||||
|
venue: eventVenue,
|
||||||
|
start_date: eventStartDate,
|
||||||
|
end_date: eventEndDate,
|
||||||
|
timezone: eventTimezone,
|
||||||
|
})
|
||||||
|
await db.event.put({ ...updated, id: 1 })
|
||||||
|
success = 'Event saved.'
|
||||||
|
} catch (err) {
|
||||||
|
error = err.message
|
||||||
|
} finally {
|
||||||
|
savingEvent = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function save(e) {
|
async function save(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
saving = true
|
saving = true
|
||||||
|
|
@ -127,6 +164,39 @@
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<div class="text-muted">Loading…</div>
|
<div class="text-muted">Loading…</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
<form onsubmit={saveEvent}>
|
||||||
|
<div class="card" style="margin-bottom:1.5rem">
|
||||||
|
<h2 style="font-size:0.95rem;font-weight:700;margin-bottom:1rem">Event</h2>
|
||||||
|
<div style="display:grid;grid-template-columns:1fr 1fr;gap:1rem">
|
||||||
|
<div class="form-group" style="grid-column:1/-1">
|
||||||
|
<label for="e-name">Event Name *</label>
|
||||||
|
<input id="e-name" bind:value={eventName} required placeholder="My Event 2026" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="grid-column:1/-1">
|
||||||
|
<label for="e-venue">Venue</label>
|
||||||
|
<input id="e-venue" bind:value={eventVenue} placeholder="Location name" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="e-start">Start Date *</label>
|
||||||
|
<input id="e-start" type="date" bind:value={eventStartDate} required />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="e-end">End Date *</label>
|
||||||
|
<input id="e-end" type="date" bind:value={eventEndDate} required />
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="grid-column:1/-1">
|
||||||
|
<label for="e-tz">Timezone</label>
|
||||||
|
<input id="e-tz" bind:value={eventTimezone} placeholder="America/Los_Angeles" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<button type="submit" class="btn btn-primary" disabled={savingEvent}>
|
||||||
|
{savingEvent ? 'Saving…' : 'Save Event'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<form onsubmit={save}>
|
<form onsubmit={save}>
|
||||||
<div class="card" style="margin-bottom:1.5rem">
|
<div class="card" style="margin-bottom:1.5rem">
|
||||||
<h2 style="font-size:0.95rem;font-weight:700;margin-bottom:1rem">SMTP Email</h2>
|
<h2 style="font-size:0.95rem;font-weight:700;margin-bottom:1rem">SMTP Email</h2>
|
||||||
|
|
@ -160,7 +230,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="s-url">Base URL <span class="text-muted" style="font-weight:400">(for volunteer token links)</span></label>
|
<label for="s-url">Base URL <span class="text-muted" style="font-weight:400">(for kiosk links in emails)</span></label>
|
||||||
<input id="s-url" bind:value={baseURL} placeholder="https://events.example.com" />
|
<input id="s-url" bind:value={baseURL} placeholder="https://events.example.com" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue