From 09b59175eeffe6026a4b48ee3d2f94a83f9dbf09 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Mon, 28 Apr 2025 10:35:45 +0200 Subject: [PATCH] wip --- .../donations/AddDonationModal.svelte | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/components/donations/AddDonationModal.svelte b/src/components/donations/AddDonationModal.svelte index 5946715c..c4fa24ee 100644 --- a/src/components/donations/AddDonationModal.svelte +++ b/src/components/donations/AddDonationModal.svelte @@ -22,7 +22,6 @@ $: donors = []; $: runners = []; $: type = "distance"; - $: is_fixed = false; $: is_paid = false; $: amount_input = 0; $: processed_last_submit = true; @@ -47,7 +46,7 @@ let amount_cent = Math.floor(amount_input * 100); processed_last_submit = false; toast.loading($_("adding-donation")); - if (is_fixed) { + if (type === "fixed") { let postdata = { donor, amount: amount_cent, @@ -73,7 +72,8 @@ .finally(() => { processed_last_submit = true; }); - } else { + } else if (type === "anonymous") { + } else if (type === "distance") { let postdata = { donor, runner, @@ -258,7 +258,7 @@ on:clear={() => (donors = null)} /> - {#if !is_fixed} + {#if type === "distance"}
{/if}
- {#if is_fixed} -
+ {#if type === "fixed"} +
+ -

- - - {#if is_paid} - {$_("paid")} - {:else} - {$_("open")} - {/if} - -

{/if} {/if}