Separate event dipslay from event slot display
Pull out the list of events into its own page sorted by name and show the event slots in chronological order on the schedule page, with past slots hidden by default. This makes the content underneath the schedule the most immediately useful to have in the moment, while the full list is kept separately and in a predictable order.
This commit is contained in:
parent
848a330f3a
commit
ae1c653af6
5 changed files with 198 additions and 5 deletions
68
components/CardEventSlot.vue
Normal file
68
components/CardEventSlot.vue
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
<template>
|
||||
<section class="eventSlot">
|
||||
<hgroup>
|
||||
<h3>{{ event?.name }}</h3>
|
||||
<p>
|
||||
{{ formatTime(slot.start) }} - {{ formatTime(slot.end) }}
|
||||
</p>
|
||||
</hgroup>
|
||||
<p>{{ event?.description ?? "No description provided" }}</p>
|
||||
<p v-if="locations.length">
|
||||
At {{ locations.map(location => location?.name ?? "unknown").join(" + ") }}
|
||||
</p>
|
||||
<p v-if="event?.interested">
|
||||
{{ event?.interested }}
|
||||
<template v-if="slot.interested">
|
||||
+ {{ slot.interested }}
|
||||
</template>
|
||||
interested
|
||||
</p>
|
||||
<p v-if="slot.assigned.size">
|
||||
Crew:
|
||||
{{ [...slot.assigned].map(id => usersStore.users.get(id)?.name).join(", ") }}
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { DateTime } from '~/shared/utils/luxon';
|
||||
|
||||
const props = defineProps<{
|
||||
event?: ClientScheduleEvent,
|
||||
slot: ClientScheduleEventSlot,
|
||||
}>()
|
||||
const scheduleStore = useSchedulesStore();
|
||||
const schedule = scheduleStore.activeSchedule;
|
||||
|
||||
const usersStore = useUsersStore();
|
||||
const locations = computed(() => [...props.slot.locationIds].map(id => schedule.value.locations.get(id)));
|
||||
|
||||
function formatTime(time: DateTime) {
|
||||
return time.toFormat("yyyy-LL-dd HH:mm");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.eventSlot {
|
||||
background: color-mix(in oklab, var(--background), grey 20%);
|
||||
padding: 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.eventSlot h3 {
|
||||
margin: 0;
|
||||
}
|
||||
.eventSlot + .eventSlot {
|
||||
margin-block-start: 0.5rem;
|
||||
}
|
||||
|
||||
button {
|
||||
padding-inline: 0.2em;
|
||||
}
|
||||
button.active {
|
||||
color: color-mix(in oklab, var(--foreground), green 50%);
|
||||
}
|
||||
</style>
|
|
@ -9,6 +9,9 @@
|
|||
<li>
|
||||
<NuxtLink to="/">Home</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/events">Events</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/schedule">Schedule</NuxtLink>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue