Switch UI components to new design system tokens
Standardizes color values and styling using the new tokens: - Replaces hardcoded colors with semantic variables - Updates background/text/border classes for light/dark mode - Migrates inputs to UInput/USelect/UTextarea components - Removes redundant style declarations
This commit is contained in:
parent
9b45652b83
commit
3fea484585
13 changed files with 788 additions and 785 deletions
|
|
@ -1,20 +1,17 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="bg-white border-b">
|
||||
<div class="bg-elevated border-b">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="py-6">
|
||||
<div class="flex items-center gap-4 mb-2">
|
||||
<NuxtLink
|
||||
to="/admin/events"
|
||||
class="text-gray-500 hover:text-gray-700"
|
||||
>
|
||||
<NuxtLink to="/admin/events" class="text-dimmed hover:text-default">
|
||||
<Icon name="heroicons:arrow-left" class="w-5 h-5" />
|
||||
</NuxtLink>
|
||||
<h1 class="text-2xl font-bold text-gray-900">
|
||||
<h1 class="text-2xl font-bold text-highlighted">
|
||||
{{ editingEvent ? "Edit Event" : "Create New Event" }}
|
||||
</h1>
|
||||
</div>
|
||||
<p class="text-gray-600">
|
||||
<p class="text-muted">
|
||||
Fill out the form below to create or update an event
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -68,24 +65,21 @@
|
|||
<form @submit.prevent="saveEvent">
|
||||
<!-- Basic Information -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Basic Information
|
||||
</h2>
|
||||
|
||||
<div class="grid grid-cols-1 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Event Title <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.title"
|
||||
type="text"
|
||||
placeholder="Enter a clear, descriptive event title"
|
||||
required
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
:class="{
|
||||
'border-red-300 focus:ring-red-500': fieldErrors.title,
|
||||
}"
|
||||
:color="fieldErrors.title ? 'error' : undefined"
|
||||
class="w-full"
|
||||
/>
|
||||
<p v-if="fieldErrors.title" class="mt-1 text-sm text-red-600">
|
||||
{{ fieldErrors.title }}
|
||||
|
|
@ -93,52 +87,50 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Feature Image</label
|
||||
>
|
||||
<ImageUpload v-model="eventForm.featureImage" />
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
Upload a high-quality image (1200x630px recommended) to
|
||||
represent your event
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Event Description <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<textarea
|
||||
<UTextarea
|
||||
v-model="eventForm.description"
|
||||
placeholder="Provide a clear description of what attendees can expect from this event"
|
||||
required
|
||||
rows="4"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
:class="{
|
||||
'border-red-300 focus:ring-red-500': fieldErrors.description,
|
||||
}"
|
||||
></textarea>
|
||||
:rows="4"
|
||||
:color="fieldErrors.description ? 'error' : undefined"
|
||||
class="w-full"
|
||||
/>
|
||||
<p
|
||||
v-if="fieldErrors.description"
|
||||
class="mt-1 text-sm text-red-600"
|
||||
>
|
||||
{{ fieldErrors.description }}
|
||||
</p>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
This will be displayed on the event listing and detail pages
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Additional Content</label
|
||||
>
|
||||
<textarea
|
||||
<UTextarea
|
||||
v-model="eventForm.content"
|
||||
placeholder="Add detailed information, agenda, requirements, or other important details"
|
||||
rows="6"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
></textarea>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
:rows="6"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
Optional: Provide additional context, agenda items, or detailed
|
||||
requirements
|
||||
</p>
|
||||
|
|
@ -148,53 +140,51 @@
|
|||
|
||||
<!-- Event Details -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Event Details
|
||||
</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Event Type <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<select
|
||||
<USelect
|
||||
v-model="eventForm.eventType"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
>
|
||||
<option value="community">Community Meetup</option>
|
||||
<option value="workshop">Workshop</option>
|
||||
<option value="social">Social Event</option>
|
||||
<option value="showcase">Showcase</option>
|
||||
</select>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
:items="[
|
||||
{ label: 'Community Meetup', value: 'community' },
|
||||
{ label: 'Workshop', value: 'workshop' },
|
||||
{ label: 'Social Event', value: 'social' },
|
||||
{ label: 'Showcase', value: 'showcase' },
|
||||
]"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
Choose the category that best describes your event
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Location <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.location"
|
||||
type="text"
|
||||
placeholder="e.g., https://zoom.us/j/123... or #channel-name"
|
||||
required
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
:class="{
|
||||
'border-red-300 focus:ring-red-500': fieldErrors.location,
|
||||
}"
|
||||
:color="fieldErrors.location ? 'error' : undefined"
|
||||
class="w-full"
|
||||
/>
|
||||
<p v-if="fieldErrors.location" class="mt-1 text-sm text-red-600">
|
||||
{{ fieldErrors.location }}
|
||||
</p>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
Enter a video conference link or Slack channel (starting with #)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Start Date & Time <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<NaturalDateInput
|
||||
|
|
@ -211,7 +201,7 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
End Date & Time <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<NaturalDateInput
|
||||
|
|
@ -228,30 +218,30 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Max Attendees</label
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.maxAttendees"
|
||||
type="number"
|
||||
min="1"
|
||||
placeholder="Leave blank for unlimited"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
Set a maximum number of attendees (optional)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Registration Deadline</label
|
||||
>
|
||||
<NaturalDateInput
|
||||
v-model="eventForm.registrationDeadline"
|
||||
placeholder="e.g., 'tomorrow at noon', '1 hour before event'"
|
||||
/>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
<p class="mt-1 text-sm text-dimmed">
|
||||
When should registration close? (optional)
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -260,12 +250,12 @@
|
|||
|
||||
<!-- Target Audience -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Target Audience
|
||||
</h2>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-3"
|
||||
<label class="block text-sm font-medium text-default mb-3"
|
||||
>Target Circles</label
|
||||
>
|
||||
<div class="space-y-3">
|
||||
|
|
@ -274,13 +264,13 @@
|
|||
v-model="eventForm.targetCircles"
|
||||
value="community"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Community Circle</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
New members and those exploring the community
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -290,13 +280,13 @@
|
|||
v-model="eventForm.targetCircles"
|
||||
value="founder"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Founder Circle</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Entrepreneurs and business leaders
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -306,19 +296,19 @@
|
|||
v-model="eventForm.targetCircles"
|
||||
value="practitioner"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Practitioner Circle</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Experts and professionals sharing knowledge
|
||||
</p>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-dimmed">
|
||||
Select which circles this event is most relevant for (leave blank
|
||||
for all circles)
|
||||
</p>
|
||||
|
|
@ -327,20 +317,20 @@
|
|||
|
||||
<!-- Ticketing -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">Ticketing</h2>
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">Ticketing</h2>
|
||||
|
||||
<div class="space-y-6">
|
||||
<label class="flex items-start">
|
||||
<input
|
||||
v-model="eventForm.tickets.enabled"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Enable Ticketing</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Allow ticket sales for this event
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -348,19 +338,19 @@
|
|||
|
||||
<div
|
||||
v-if="eventForm.tickets.enabled"
|
||||
class="ml-6 space-y-4 p-4 bg-gray-50 rounded-lg"
|
||||
class="ml-6 space-y-4 p-4 bg-muted rounded-lg"
|
||||
>
|
||||
<label class="flex items-start">
|
||||
<input
|
||||
v-model="eventForm.tickets.public.available"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Public Tickets Available</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Allow non-members to purchase tickets
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -369,78 +359,77 @@
|
|||
<div v-if="eventForm.tickets.public.available" class="space-y-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Ticket Name</label
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.tickets.public.name"
|
||||
type="text"
|
||||
placeholder="e.g., General Admission"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Price (CAD)</label
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.tickets.public.price"
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
placeholder="0.00"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="mt-1 text-xs text-gray-500">
|
||||
<p class="mt-1 text-xs text-dimmed">
|
||||
Set to 0 for free public events
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Ticket Description</label
|
||||
>
|
||||
<textarea
|
||||
<UTextarea
|
||||
v-model="eventForm.tickets.public.description"
|
||||
placeholder="What's included with this ticket..."
|
||||
rows="2"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
></textarea>
|
||||
:rows="2"
|
||||
class="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Quantity Available</label
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.tickets.public.quantity"
|
||||
type="number"
|
||||
min="1"
|
||||
placeholder="Leave blank for unlimited"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Early Bird Price (Optional)</label
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.tickets.public.earlyBirdPrice"
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
placeholder="0.00"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="w-full"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="eventForm.tickets.public.earlyBirdPrice > 0">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Early Bird Deadline</label
|
||||
>
|
||||
<div class="md:w-1/2">
|
||||
|
|
@ -449,7 +438,7 @@
|
|||
placeholder="e.g., '1 week before event', 'next Monday'"
|
||||
/>
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-gray-500">
|
||||
<p class="mt-1 text-xs text-dimmed">
|
||||
Price increases to regular price after this date
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -467,7 +456,7 @@
|
|||
|
||||
<!-- Series Management -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Series Management
|
||||
</h2>
|
||||
|
||||
|
|
@ -476,13 +465,13 @@
|
|||
<input
|
||||
v-model="eventForm.series.isSeriesEvent"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-purple-600 focus:ring-purple-500 mt-1"
|
||||
class="rounded border-default text-purple-600 focus:ring-purple-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Part of Event Series</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
This event is part of a multi-event series
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -490,29 +479,26 @@
|
|||
|
||||
<div
|
||||
v-if="eventForm.series.isSeriesEvent"
|
||||
class="ml-6 space-y-4 p-4 bg-purple-50 rounded-lg border border-purple-200"
|
||||
class="ml-6 space-y-4 p-4 bg-purple-500/10 rounded-lg border border-purple-500/20"
|
||||
>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Select Series <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<div class="flex gap-2">
|
||||
<select
|
||||
<USelect
|
||||
v-model="selectedSeriesId"
|
||||
@change="onSeriesSelect"
|
||||
class="flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-purple-500 focus:border-transparent"
|
||||
>
|
||||
<option value="">
|
||||
Choose existing series or create new...
|
||||
</option>
|
||||
<option
|
||||
v-for="series in availableSeries"
|
||||
:key="series.id"
|
||||
:value="series.id"
|
||||
>
|
||||
{{ series.title }} ({{ series.eventCount || 0 }} events)
|
||||
</option>
|
||||
</select>
|
||||
@update:model-value="onSeriesSelect"
|
||||
:items="
|
||||
availableSeries.map((series) => ({
|
||||
label: `${series.title} (${series.eventCount || 0} events)`,
|
||||
value: series.id,
|
||||
}))
|
||||
"
|
||||
placeholder="Choose existing series or create new..."
|
||||
value-key="value"
|
||||
class="flex-1 w-full"
|
||||
/>
|
||||
<NuxtLink
|
||||
to="/admin/series/create"
|
||||
class="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 text-sm font-medium whitespace-nowrap"
|
||||
|
|
@ -520,7 +506,7 @@
|
|||
New Series
|
||||
</NuxtLink>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
<p class="text-xs text-dimmed mt-1">
|
||||
Select an existing series or create a new one
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -530,19 +516,18 @@
|
|||
class="space-y-4"
|
||||
>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Series Title <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.series.title"
|
||||
type="text"
|
||||
placeholder="e.g., Cooperative Game Development Fundamentals"
|
||||
required
|
||||
:readonly="selectedSeriesId"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-purple-500 focus:border-transparent"
|
||||
:class="{ 'bg-gray-100': selectedSeriesId }"
|
||||
:class="{ 'bg-accented': selectedSeriesId }"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
<p class="text-xs text-dimmed mt-1">
|
||||
{{
|
||||
selectedSeriesId
|
||||
? "From selected series"
|
||||
|
|
@ -552,19 +537,19 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
<label class="block text-sm font-medium text-default mb-2">
|
||||
Series Description <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<textarea
|
||||
<UTextarea
|
||||
v-model="eventForm.series.description"
|
||||
placeholder="Describe what the series covers and its goals"
|
||||
required
|
||||
rows="3"
|
||||
:rows="3"
|
||||
:readonly="selectedSeriesId"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-purple-500 focus:border-transparent"
|
||||
:class="{ 'bg-gray-100': selectedSeriesId }"
|
||||
></textarea>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
:class="{ 'bg-accented': selectedSeriesId }"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="text-xs text-dimmed mt-1">
|
||||
{{
|
||||
selectedSeriesId
|
||||
? "From selected series"
|
||||
|
|
@ -573,8 +558,11 @@
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<div v-if="selectedSeriesId" class="p-3 bg-blue-50 rounded-lg">
|
||||
<p class="text-sm text-blue-700">
|
||||
<div
|
||||
v-if="selectedSeriesId"
|
||||
class="p-3 bg-blue-500/10 rounded-lg border border-blue-500/20"
|
||||
>
|
||||
<p class="text-sm text-blue-600 dark:text-blue-400">
|
||||
<strong>Note:</strong> This event will be added to the
|
||||
existing "{{ eventForm.series.title }}" series.
|
||||
</p>
|
||||
|
|
@ -586,7 +574,9 @@
|
|||
|
||||
<!-- Event Agenda -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">Event Agenda</h2>
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Event Agenda
|
||||
</h2>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
|
|
@ -594,11 +584,10 @@
|
|||
:key="index"
|
||||
class="flex gap-2"
|
||||
>
|
||||
<input
|
||||
<UInput
|
||||
v-model="eventForm.agenda[index]"
|
||||
type="text"
|
||||
placeholder="Enter agenda item (e.g., 'Introduction and welcome - 10 mins')"
|
||||
class="flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
class="flex-1 w-full"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -619,7 +608,7 @@
|
|||
</button>
|
||||
</div>
|
||||
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-dimmed">
|
||||
Add agenda items to help attendees know what to expect during the
|
||||
event
|
||||
</p>
|
||||
|
|
@ -627,7 +616,7 @@
|
|||
|
||||
<!-- Event Settings -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<h2 class="text-lg font-semibold text-highlighted mb-4">
|
||||
Event Settings
|
||||
</h2>
|
||||
|
||||
|
|
@ -637,13 +626,13 @@
|
|||
<input
|
||||
v-model="eventForm.isOnline"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Online Event</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Event will be conducted virtually
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -653,13 +642,13 @@
|
|||
<input
|
||||
v-model="eventForm.registrationRequired"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Registration Required</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Attendees must register before attending
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -671,13 +660,13 @@
|
|||
<input
|
||||
v-model="eventForm.isVisible"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500 mt-1"
|
||||
class="rounded border-default text-blue-600 focus:ring-blue-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Visible on Public Calendar</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Event will appear on the public events page
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -687,13 +676,13 @@
|
|||
<input
|
||||
v-model="eventForm.isCancelled"
|
||||
type="checkbox"
|
||||
class="rounded border-gray-300 text-red-600 focus:ring-red-500 mt-1"
|
||||
class="rounded border-default text-red-600 focus:ring-red-500 mt-1"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<span class="text-sm font-medium text-gray-700"
|
||||
<span class="text-sm font-medium text-default"
|
||||
>Event Cancelled</span
|
||||
>
|
||||
<p class="text-xs text-gray-500">
|
||||
<p class="text-xs text-dimmed">
|
||||
Mark this event as cancelled
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -704,27 +693,28 @@
|
|||
|
||||
<!-- Cancellation Message (conditional) -->
|
||||
<div v-if="eventForm.isCancelled" class="mb-8">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2"
|
||||
<label class="block text-sm font-medium text-default mb-2"
|
||||
>Cancellation Message</label
|
||||
>
|
||||
<textarea
|
||||
<UTextarea
|
||||
v-model="eventForm.cancellationMessage"
|
||||
placeholder="Explain why the event was cancelled and any next steps..."
|
||||
rows="3"
|
||||
class="w-full border border-red-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-red-500 focus:border-transparent"
|
||||
></textarea>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
:rows="3"
|
||||
color="error"
|
||||
class="w-full"
|
||||
/>
|
||||
<p class="text-xs text-dimmed mt-1">
|
||||
This message will be displayed to users viewing the event page
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div
|
||||
class="flex justify-between items-center pt-6 border-t border-gray-200"
|
||||
class="flex justify-between items-center pt-6 border-t border-default"
|
||||
>
|
||||
<NuxtLink
|
||||
to="/admin/events"
|
||||
class="px-4 py-2 text-gray-600 hover:text-gray-900 font-medium"
|
||||
class="px-4 py-2 text-muted hover:text-highlighted font-medium"
|
||||
>
|
||||
Cancel
|
||||
</NuxtLink>
|
||||
|
|
@ -773,7 +763,7 @@ const editingEvent = ref(null);
|
|||
const showSuccessMessage = ref(false);
|
||||
const formErrors = ref([]);
|
||||
const fieldErrors = ref({});
|
||||
const selectedSeriesId = ref("");
|
||||
const selectedSeriesId = ref(null);
|
||||
const availableSeries = ref([]);
|
||||
|
||||
const eventForm = reactive({
|
||||
|
|
@ -827,7 +817,9 @@ const removeAgendaItem = (index) => {
|
|||
onMounted(async () => {
|
||||
try {
|
||||
const response = await $fetch("/api/admin/series");
|
||||
console.log("Loaded series:", response);
|
||||
availableSeries.value = response;
|
||||
console.log("availableSeries.value:", availableSeries.value);
|
||||
} catch (error) {
|
||||
console.error("Failed to load series:", error);
|
||||
}
|
||||
|
|
@ -835,14 +827,21 @@ onMounted(async () => {
|
|||
|
||||
// Handle series selection
|
||||
const onSeriesSelect = () => {
|
||||
console.log(
|
||||
"onSeriesSelect called, selectedSeriesId:",
|
||||
selectedSeriesId.value,
|
||||
);
|
||||
console.log("availableSeries:", availableSeries.value);
|
||||
if (selectedSeriesId.value) {
|
||||
const series = availableSeries.value.find(
|
||||
(s) => s.id === selectedSeriesId.value,
|
||||
);
|
||||
console.log("Found series:", series);
|
||||
if (series) {
|
||||
eventForm.series.id = series.id;
|
||||
eventForm.series.title = series.title;
|
||||
eventForm.series.description = series.description;
|
||||
console.log("Updated eventForm.series:", eventForm.series);
|
||||
}
|
||||
} else {
|
||||
// Reset series form when no series is selected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue