From 057d2c7955e852e55f421212659f499831d8d05c Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Thu, 16 Nov 2023 19:54:05 +0100 Subject: [PATCH] FrontEnd: Added Timeline below the slideshow. --- frontend/src/lib/components/education.svelte | 57 ++++++++++++-------- frontend/src/lib/components/slideshow.svelte | 51 +++++++++++++++--- frontend/src/lib/css/education.css | 43 +++++++++++++++ frontend/src/lib/js/date.js | 7 +++ frontend/src/lib/js/processdata.js | 34 +++++++----- frontend/src/lib/js/timeline.js | 18 +++++++ 6 files changed, 166 insertions(+), 44 deletions(-) create mode 100644 frontend/src/lib/js/timeline.js diff --git a/frontend/src/lib/components/education.svelte b/frontend/src/lib/components/education.svelte index 8bd3dfb..4bbb91a 100644 --- a/frontend/src/lib/components/education.svelte +++ b/frontend/src/lib/components/education.svelte @@ -2,39 +2,50 @@ import SvgIcon from "@jamescoyle/svelte-icon"; import { mdiMapMarker, mdiCog } from "@mdi/js"; import "$lib/css/education.css"; + import { formatYear } from "$lib/js/date.js" export let active = false; export let data; - + const title = data.school; const location = data.school_location; const speciality = data.speciality; const option = data.school_options; const picture = data.picture_url; + const end_year = data.end_year === null ? '' : formatYear(data.end_year); + const start_year = data.start_year === null ? '' : (data.end_year === null ? formatYear(data.start_year) : '-'+formatYear(data.start_year)); -
-
- Education +
+
+
+ Education +
+
+

{title}

+ {#if location} +
+ +

+ {location} +

+
+ {/if} + {#if speciality} +
+ +

+ {speciality} +

+
+ {/if} + {#if option} +

{option}

+ {/if} +
-
-

{title}

- {#if location} -
- -

{location}

-
- {/if} - {#if speciality} -
- -

- {speciality} -

-
- {/if} - {#if option} -

{option}

- {/if} +
+
+

{`${end_year}${start_year}`}

diff --git a/frontend/src/lib/components/slideshow.svelte b/frontend/src/lib/components/slideshow.svelte index 41c3818..b06937c 100644 --- a/frontend/src/lib/components/slideshow.svelte +++ b/frontend/src/lib/components/slideshow.svelte @@ -1,37 +1,74 @@ -
+