From 82316d99af6422e38980f1844b5fbe3fa08eb2dd Mon Sep 17 00:00:00 2001 From: Borja Robert Date: Wed, 5 Oct 2022 12:12:05 +0200 Subject: [PATCH 1/2] =?UTF-8?q?separo=20city=20del=20resto=20de=20address?= =?UTF-8?q?=20para=20tener=20m=C3=A1s=20flexibilidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/City.svelte | 35 ++++++++++++++++++++++++++++++++++ src/lib/components/Text.svelte | 7 +++---- src/lib/form/Form.svelte | 8 +++++--- src/lib/preview/Preview.svelte | 2 ++ src/lib/stores/store.js | 1 + src/lib/templates/azul.js | 12 ++++++++++++ src/lib/templates/corazon.js | 12 ++++++++++++ src/lib/templates/templates.js | 1 + src/lib/templates/verde.js | 14 +++++++++++++- 9 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 src/lib/components/City.svelte diff --git a/src/lib/components/City.svelte b/src/lib/components/City.svelte new file mode 100644 index 0000000..e5147d2 --- /dev/null +++ b/src/lib/components/City.svelte @@ -0,0 +1,35 @@ + + +{#if templates[templateIndex] && $city} +
+ {$city} +
+{/if} + + diff --git a/src/lib/components/Text.svelte b/src/lib/components/Text.svelte index 73ae1b0..636b0de 100644 --- a/src/lib/components/Text.svelte +++ b/src/lib/components/Text.svelte @@ -7,7 +7,8 @@ date, time, weekday, - address + address, + city } from '$lib/stores/store'; import { convertDate } from '$lib/convertDate'; @@ -18,8 +19,6 @@ $: if ($date !== '') { textDate = convertDate($date); } - - $: city = $address.split('\n')[$address.split('\n').length - 1];
@@ -29,7 +28,7 @@ {#if checked}

Estimada/o amiga/o:

-

El {$weekday.toLowerCase()}, {textDate}, celebramos el acto '{$title}' en {city}.

+

El {$weekday.toLowerCase()}, {textDate}, celebramos el acto '{$title}' en {$city}.

Como siempre, la entrada es gratuita hasta completar aforo.

El acto comienza a las {$time}.

{@html $content}

diff --git a/src/lib/form/Form.svelte b/src/lib/form/Form.svelte index 8528ced..6268559 100644 --- a/src/lib/form/Form.svelte +++ b/src/lib/form/Form.svelte @@ -12,6 +12,7 @@ time, weekday, address, + city, canvas } from '$lib/stores/store'; @@ -117,9 +118,10 @@ bind:value={$address} type="text" name="address" - placeholder="Ej. Calle del Abeto, 4 -Albacete" + placeholder="Ej. Calle del Abeto, 4" /> + +
@@ -160,7 +162,7 @@ Albacete" font-size: 0.8rem; font-family: sans-serif; padding: 0.5rem; - min-height: 5rem; + min-height: 3rem; line-height: 1.3rem; resize: vertical; } diff --git a/src/lib/preview/Preview.svelte b/src/lib/preview/Preview.svelte index e34cad1..381c496 100644 --- a/src/lib/preview/Preview.svelte +++ b/src/lib/preview/Preview.svelte @@ -13,6 +13,7 @@ import Weekday from '$lib/components/Weekday.svelte'; import Address from '$lib/components/Address.svelte'; import Text from '$lib/components/Text.svelte'; + import City from '$lib/components/City.svelte';
@@ -26,6 +27,7 @@