Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import TicketTypeRow from "./TicketTypeRow.vue"
const props = defineProps<{ organizer: TicketTypeOrganizer; canWrite?: boolean }>()
defineEmits<{
open: [name: string]
add: [category: string]
addCategory: []
editCategory: [category: TicketCategoryItem]
}>()
Expand Down Expand Up @@ -110,5 +111,13 @@ const chips = computed(() => [
No ticket types in this category yet
</p>
</section>
<Button
v-if="canWrite"
size="md"
variant="ghost"
icon-left="lucide-plus"
label="Add ticket type"
@click="$emit('add', selectedGroup?.key ?? '')"
/>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,23 @@ const viewOptions = [
empty-title="No ticket types yet"
empty-description="Add one so people can register."
empty-icon="lucide-ticket"
:empty-action="
page.can_write
? { label: 'Add ticket type', iconLeft: 'lucide-plus', onClick: () => $emit('add', '') }
: null
"
>
<template #toolbar>
<div class="flex items-center gap-2">
<TabButtons v-if="!isMobile" v-model="view" :options="viewOptions" />
<template v-if="page.can_write">
<Button
v-if="!isMobile"
class="ml-auto"
variant="ghost"
icon-left="lucide-folder-plus"
label="New Category"
@click="$emit('addCategory')"
/>
<Button
:class="{ 'ml-auto': isMobile }"
variant="outline"
icon-left="lucide-plus"
label="Add"
@click="$emit('add', '')"
/>
</template>
<Button
v-if="page.can_write && !isMobile"
class="ml-auto"
variant="outline"
icon-left="lucide-folder-plus"
label="New Category"
@click="$emit('addCategory')"
/>
</div>
</template>

Expand All @@ -68,6 +64,7 @@ const viewOptions = [
:organizer="organizer"
:can-write="page.can_write"
@open="$emit('open', $event)"
@add="$emit('add', $event)"
@add-category="$emit('addCategory')"
@edit-category="$emit('editCategory', $event)"
/>
Expand All @@ -84,6 +81,14 @@ const viewOptions = [
@click="$emit('open', ticketType.name)"
/>
</li>
<li v-if="page.can_write">
<Button
variant="ghost"
icon-left="lucide-plus"
label="Add ticket type"
@click="$emit('add', '')"
/>
</li>
</ul>
<component
:is="view === 'board' ? TicketTypeBoard : TicketTypeGroups"
Expand Down
Loading