From dce7c26b7eb1347e8b2a88a0a6558470020f5ec1 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 17 Jun 2025 17:25:37 +0200 Subject: [PATCH] Mod popup for copying event --- resources/css/buttons.css | 6 ++++ resources/img/svg/warning-triangle-light.svg | 2 ++ resources/js/components/page/Popups.vue | 19 ++++++----- resources/js/components/ui/ActionButton.vue | 30 +++++------------- resources/js/components/ui/Popup.vue | 33 +++++++++----------- resources/js/stores/swalStore.ts | 2 ++ resources/js/views/form/Index.vue | 24 ++++---------- 7 files changed, 48 insertions(+), 68 deletions(-) create mode 100644 resources/img/svg/warning-triangle-light.svg diff --git a/resources/css/buttons.css b/resources/css/buttons.css index 9bdfb50f..27bfb8bf 100644 --- a/resources/css/buttons.css +++ b/resources/css/buttons.css @@ -31,6 +31,12 @@ @apply bg-yellow-500 text-yellow-100; } } + &.btn-default { + @apply bg-gray-700 text-gray-300; + &:not(.disabled):hover { + @apply bg-gray-500 text-gray-100; + } + } &.btn-info { @apply bg-blue-700 text-blue-300; &:not(.disabled):hover { diff --git a/resources/img/svg/warning-triangle-light.svg b/resources/img/svg/warning-triangle-light.svg new file mode 100644 index 00000000..482d4b3c --- /dev/null +++ b/resources/img/svg/warning-triangle-light.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/js/components/page/Popups.vue b/resources/js/components/page/Popups.vue index fc47ab08..b8d014ae 100644 --- a/resources/js/components/page/Popups.vue +++ b/resources/js/components/page/Popups.vue @@ -1,18 +1,17 @@ + diff --git a/resources/js/components/ui/ActionButton.vue b/resources/js/components/ui/ActionButton.vue index f36695d3..8ab49ca8 100644 --- a/resources/js/components/ui/ActionButton.vue +++ b/resources/js/components/ui/ActionButton.vue @@ -1,28 +1,14 @@ - diff --git a/resources/js/components/ui/Popup.vue b/resources/js/components/ui/Popup.vue index 2b6b0ba0..3dddcc8c 100644 --- a/resources/js/components/ui/Popup.vue +++ b/resources/js/components/ui/Popup.vue @@ -9,7 +9,10 @@ -

+
+ +
+

@@ -24,21 +27,15 @@
- diff --git a/resources/js/stores/swalStore.ts b/resources/js/stores/swalStore.ts index 3aecf810..397a3b6a 100644 --- a/resources/js/stores/swalStore.ts +++ b/resources/js/stores/swalStore.ts @@ -6,6 +6,7 @@ interface Popup { id: string; title: string; body: string; + icon: string|null; confirmButton: string; cancelButton: string; resolve: (id: string) => void; @@ -28,6 +29,7 @@ export default defineStore('swal', { resolve, reject, id: uuidv4(), + icon: 'warning-triangle-light', }); }).then((id) => { this.remove(id); diff --git a/resources/js/views/form/Index.vue b/resources/js/views/form/Index.vue index 92c8f541..15306f50 100644 --- a/resources/js/views/form/Index.vue +++ b/resources/js/views/form/Index.vue @@ -5,22 +5,6 @@ Veranstaltung erstellen - -
-

Diese Veranstaltung löschen?

- -
-
- @@ -205,7 +189,6 @@ const { meta, data, reloadPage, reload, create, single, edit, cancel, submit, re const axios = inject('axios'); const toast = useToast(); -const deleting = ref(null); const showing = ref(null); const fileSettingPopup = ref(null); @@ -236,6 +219,11 @@ async function onCopy(form) { reload(false); } +async function onDelete(form) { + await swal.confirm('Diese Veranstaltung löschen?', `Die Veranstaltung ${form.name} wird gelöscht werden.`); + await remove(form); +} + function setTemplate(template) { active.value = 0; single.value.config = template.config;