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:
Jennie Robinson Faber 2025-10-13 15:05:29 +01:00
parent 9b45652b83
commit 3fea484585
13 changed files with 788 additions and 785 deletions

View file

@ -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

View file

@ -1,10 +1,10 @@
<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">
<h1 class="text-2xl font-bold text-gray-900">Event Management</h1>
<p class="text-gray-600">
<h1 class="text-2xl font-bold text-highlighted">Event Management</h1>
<p class="text-muted">
Create, manage, and monitor Ghost Guild events and workshops
</p>
</div>
@ -15,38 +15,41 @@
<!-- Search and Actions -->
<div class="mb-6 flex justify-between items-center">
<div class="flex gap-4 items-center">
<input
<UInput
v-model="searchQuery"
placeholder="Search events..."
class="border border-gray-300 rounded-lg px-4 py-2 w-80 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
class="w-80"
/>
<select
<USelect
v-model="typeFilter"
class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
>
<option value="">All Types</option>
<option value="community">Community</option>
<option value="workshop">Workshop</option>
<option value="social">Social</option>
<option value="showcase">Showcase</option>
</select>
<select
:items="[
{ label: 'All Types', value: '' },
{ label: 'Community', value: 'community' },
{ label: 'Workshop', value: 'workshop' },
{ label: 'Social', value: 'social' },
{ label: 'Showcase', value: 'showcase' },
]"
class="w-full"
/>
<USelect
v-model="statusFilter"
class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
>
<option value="">All Status</option>
<option value="upcoming">Upcoming</option>
<option value="ongoing">Ongoing</option>
<option value="past">Past</option>
</select>
<select
:items="[
{ label: 'All Status', value: '' },
{ label: 'Upcoming', value: 'upcoming' },
{ label: 'Ongoing', value: 'ongoing' },
{ label: 'Past', value: 'past' },
]"
class="w-full"
/>
<USelect
v-model="seriesFilter"
class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
>
<option value="">All Events</option>
<option value="series-only">Series Events Only</option>
<option value="standalone-only">Standalone Only</option>
</select>
:items="[
{ label: 'All Events', value: '' },
{ label: 'Series Events Only', value: 'series-only' },
{ label: 'Standalone Only', value: 'standalone-only' },
]"
class="w-full"
/>
</div>
<NuxtLink
to="/admin/events/create"
@ -58,7 +61,7 @@
</div>
<!-- Events Table -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="bg-elevated rounded-lg shadow overflow-hidden">
<div v-if="pending" class="p-8 text-center">
<div class="inline-flex items-center">
<div
@ -73,45 +76,45 @@
</div>
<table v-else class="w-full">
<thead class="bg-gray-50">
<thead class="bg-muted">
<tr>
<th
class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-6 py-4 text-left text-xs font-medium text-dimmed uppercase tracking-wider"
>
Title
</th>
<th
class="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-4 py-4 text-left text-xs font-medium text-dimmed uppercase tracking-wider"
>
Type
</th>
<th
class="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-4 py-4 text-left text-xs font-medium text-dimmed uppercase tracking-wider"
>
Date
</th>
<th
class="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-4 py-4 text-left text-xs font-medium text-dimmed uppercase tracking-wider"
>
Status
</th>
<th
class="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-4 py-4 text-left text-xs font-medium text-dimmed uppercase tracking-wider"
>
Registration
</th>
<th
class="px-6 py-4 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"
class="px-6 py-4 text-right text-xs font-medium text-dimmed uppercase tracking-wider"
>
Actions
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tbody class="bg-elevated divide-y divide-default">
<tr
v-for="event in filteredEvents"
:key="event._id"
class="hover:bg-gray-50"
class="hover:bg-muted"
>
<!-- Title Column -->
<td class="px-6 py-6">
@ -120,7 +123,7 @@
v-if="
event.featureImage?.url && !event.featureImage?.publicId
"
class="flex-shrink-0 w-12 h-12 bg-gray-100 rounded-lg overflow-hidden"
class="flex-shrink-0 w-12 h-12 bg-accented rounded-lg overflow-hidden"
>
<img
:src="event.featureImage.url"
@ -131,18 +134,18 @@
</div>
<div
v-else
class="flex-shrink-0 w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center"
class="flex-shrink-0 w-12 h-12 bg-accented rounded-lg flex items-center justify-center"
>
<Icon
name="heroicons:calendar-days"
class="w-6 h-6 text-gray-400"
class="w-6 h-6 text-muted"
/>
</div>
<div class="flex-1 min-w-0">
<div class="text-sm font-semibold text-gray-900 mb-1">
<div class="text-sm font-semibold text-highlighted mb-1">
{{ event.title }}
</div>
<div class="text-sm text-gray-500 line-clamp-2">
<div class="text-sm text-dimmed line-clamp-2">
{{ event.description.substring(0, 100) }}...
</div>
<div v-if="event.series?.isSeriesEvent" class="mt-2 mb-2">
@ -176,15 +179,15 @@
>
<Icon
name="heroicons:user-group"
class="w-3 h-3 text-gray-400"
class="w-3 h-3 text-muted"
/>
<span class="text-xs text-gray-500">{{
<span class="text-xs text-dimmed">{{
event.targetCircles.join(", ")
}}</span>
</div>
<div
v-if="!event.isVisible"
class="flex items-center text-xs text-gray-500"
class="flex items-center text-xs text-dimmed"
>
<Icon name="heroicons:eye-slash" class="w-3 h-3 mr-1" />
Hidden
@ -205,12 +208,12 @@
</td>
<!-- Date Column -->
<td class="px-4 py-6 whitespace-nowrap text-sm text-gray-600">
<td class="px-4 py-6 whitespace-nowrap text-sm text-muted">
<div class="space-y-1">
<div class="font-medium">
{{ formatDate(event.startDate) }}
</div>
<div class="text-xs text-gray-500">
<div class="text-xs text-dimmed">
{{ formatTime(event.startDate) }}
</div>
</div>
@ -245,11 +248,11 @@
</div>
<div
v-else
class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-gray-100 text-gray-800"
class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-accented text-default"
>
Optional
</div>
<div v-if="event.maxAttendees" class="text-xs text-gray-500">
<div v-if="event.maxAttendees" class="text-xs text-dimmed">
{{ event.registeredCount || 0 }} / {{ event.maxAttendees }}
</div>
</div>
@ -260,21 +263,21 @@
<div class="flex items-center justify-end space-x-2">
<NuxtLink
:to="`/events/${event.slug || String(event._id)}`"
class="p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-full transition-colors"
class="p-2 text-dimmed hover:text-default hover:bg-accented rounded-full transition-colors"
title="View Event"
>
<Icon name="heroicons:eye" class="w-4 h-4" />
</NuxtLink>
<button
@click="editEvent(event)"
class="p-2 text-primary-500 hover:text-primary-700 hover:bg-primary-50 rounded-full transition-colors"
class="p-2 text-primary hover:text-primary hover:bg-primary/10 rounded-full transition-colors"
title="Edit Event"
>
<Icon name="heroicons:pencil-square" class="w-4 h-4" />
</button>
<button
@click="duplicateEvent(event)"
class="p-2 text-primary-500 hover:text-primary-700 hover:bg-primary-50 rounded-full transition-colors"
class="p-2 text-primary hover:text-primary hover:bg-primary/10 rounded-full transition-colors"
title="Duplicate Event"
>
<Icon name="heroicons:document-duplicate" class="w-4 h-4" />
@ -294,7 +297,7 @@
<div
v-if="!pending && !error && filteredEvents.length === 0"
class="p-8 text-center text-gray-500"
class="p-8 text-center text-dimmed"
>
No events found matching your criteria
</div>