From 14b95876c5a7a27214639088306b269219f94af2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 15 Oct 2022 13:36:25 +0200 Subject: [PATCH] Add a confirmation before deleting the song --- ui/src/routes/musiks/gongs/[gid]/+page.svelte | 44 +++++++++++++++---- .../routes/musiks/tracks/[tid]/+page.svelte | 43 ++++++++++++++---- 2 files changed, 69 insertions(+), 18 deletions(-) diff --git a/ui/src/routes/musiks/gongs/[gid]/+page.svelte b/ui/src/routes/musiks/gongs/[gid]/+page.svelte index 3948a04..e0dc2f2 100644 --- a/ui/src/routes/musiks/gongs/[gid]/+page.svelte +++ b/ui/src/routes/musiks/gongs/[gid]/+page.svelte @@ -3,6 +3,7 @@ import { page } from '$app/stores'; import { + Button, Container, Input, Icon, @@ -20,6 +21,8 @@ goto('musiks/gongs/'); }) } + + let confirmDeletion = false; {#await getGong($page.params.gid)} @@ -47,15 +50,38 @@ - deleteThis(gong)} - > - - Supprimer ce gong - + {#if !confirmDeletion} + confirmDeletion = !confirmDeletion} + > + + Supprimer ce gong + + {:else} + +

+ Êtes-vous sûr ? +

+
+ + +
+
+ {/if}
{/await} diff --git a/ui/src/routes/musiks/tracks/[tid]/+page.svelte b/ui/src/routes/musiks/tracks/[tid]/+page.svelte index efdf1b4..8a2e635 100644 --- a/ui/src/routes/musiks/tracks/[tid]/+page.svelte +++ b/ui/src/routes/musiks/tracks/[tid]/+page.svelte @@ -3,6 +3,7 @@ import { page } from '$app/stores'; import { + Button, Container, Icon, Input, @@ -26,6 +27,8 @@ goto('musiks/tracks/'); }) } + + let confirmDeletion = false; {#await getTrack($page.params.tid)} @@ -60,15 +63,37 @@ - deleteThis(track)} - > - - Supprimer cette piste - + {#if !confirmDeletion} + confirmDeletion = !confirmDeletion} + > + + Supprimer cette piste + + {:else} + +

+ Êtes-vous sûr ? +

+
+ + +
+
+ {/if}
{/await}