From 6ef938e61e6cd26ecbb9721d76ada9b2a3b805eb Mon Sep 17 00:00:00 2001 From: Felix Ruf Date: Thu, 18 Jan 2024 13:27:47 +0100 Subject: [PATCH] added print functionality to PrintList --- .../src/api/getShowParticipations.ts | 11 ++ .../src/components/misc/ActionButton.vue | 7 +- .../printableList/PrintListPdfTemplate.vue | 144 ++++++++++++++++++ src/Resources/src/enums/Actions.ts | 3 +- src/Resources/src/locales/de.json | 3 +- src/Resources/src/locales/en.json | 3 +- src/Resources/src/views/PrintableList.vue | 103 +++++++++---- 7 files changed, 237 insertions(+), 37 deletions(-) create mode 100644 src/Resources/src/components/printableList/PrintListPdfTemplate.vue diff --git a/src/Resources/src/api/getShowParticipations.ts b/src/Resources/src/api/getShowParticipations.ts index c49db6c49..097ff7294 100644 --- a/src/Resources/src/api/getShowParticipations.ts +++ b/src/Resources/src/api/getShowParticipations.ts @@ -13,12 +13,19 @@ const REFETCH_TIME_ON_ERROR = 10000; export interface IParticipationsState { data: Dictionary>, meals: Dictionary, + event: IEventParticipations, day: DateTime } export interface IBookedData { booked: number[] } + +export interface IEventParticipations { + name: string, + participants: string[] +} + export interface IMealData { title: { en: string, @@ -49,6 +56,10 @@ export interface IMealWithVariations { const participationsState = reactive({ data: {}, meals: {}, + event: { + name: '', + participants: [] + }, day: { date: '', timezone_type: 0, diff --git a/src/Resources/src/components/misc/ActionButton.vue b/src/Resources/src/components/misc/ActionButton.vue index 505c28f88..44d847609 100644 --- a/src/Resources/src/components/misc/ActionButton.vue +++ b/src/Resources/src/components/misc/ActionButton.vue @@ -28,6 +28,11 @@ class="z-[1] aspect-square h-8 w-8" :class="{'mr-1': btnText !== ''}" /> +

import { Action } from '@/enums/Actions'; -import { XIcon, PencilIcon, PlusIcon } from '@heroicons/vue/outline'; +import { XIcon, PencilIcon, PlusIcon, DownloadIcon } from '@heroicons/vue/outline'; import { EyeOffIcon, ScaleIcon } from '@heroicons/vue/solid'; withDefaults(defineProps<{ diff --git a/src/Resources/src/components/printableList/PrintListPdfTemplate.vue b/src/Resources/src/components/printableList/PrintListPdfTemplate.vue new file mode 100644 index 000000000..1588ce61e --- /dev/null +++ b/src/Resources/src/components/printableList/PrintListPdfTemplate.vue @@ -0,0 +1,144 @@ + + + \ No newline at end of file diff --git a/src/Resources/src/enums/Actions.ts b/src/Resources/src/enums/Actions.ts index 7e47e6363..b80c8a4fc 100644 --- a/src/Resources/src/enums/Actions.ts +++ b/src/Resources/src/enums/Actions.ts @@ -3,5 +3,6 @@ export enum Action { DELETE = 'DELETE', CREATE = 'CREATE', HIDE = 'HIDE', - BALANCE = 'BALANCE' + BALANCE = 'BALANCE', + DOWNLOAD = 'DOWNLOAD' } \ No newline at end of file diff --git a/src/Resources/src/locales/de.json b/src/Resources/src/locales/de.json index 0bf86228a..457472674 100644 --- a/src/Resources/src/locales/de.json +++ b/src/Resources/src/locales/de.json @@ -263,7 +263,8 @@ }, "printList": { "title": "Teilnahmen am ", - "participations": "Teilnahmen" + "participations": "Teilnahmen", + "download": "Pdf downloaden" }, "session": { "expired": "Session abgelaufen!" diff --git a/src/Resources/src/locales/en.json b/src/Resources/src/locales/en.json index b2fd877a8..5d0cdf4d9 100644 --- a/src/Resources/src/locales/en.json +++ b/src/Resources/src/locales/en.json @@ -263,7 +263,8 @@ }, "printList": { "title": "Participations on ", - "participations": "Participations" + "participations": "Participations", + "download": "Download pdf" }, "session": { "expired": "Session expired!" diff --git a/src/Resources/src/views/PrintableList.vue b/src/Resources/src/views/PrintableList.vue index ad20175a2..2c8d00382 100644 --- a/src/Resources/src/views/PrintableList.vue +++ b/src/Resources/src/views/PrintableList.vue @@ -1,36 +1,55 @@ \ No newline at end of file