From 073d7c9d50d769c5a5ab5c33c648d1d6705b056f Mon Sep 17 00:00:00 2001 From: EETagent Date: Fri, 23 Dec 2022 18:42:27 +0100 Subject: [PATCH 1/9] fix: details hidden by default --- frontend/src/lib/components/dashboard/DashboardInfoCard.svelte | 2 +- .../routes/(candidate)/(authenticated)/dashboard/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte index 1f780c6..0c66427 100644 --- a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte +++ b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte @@ -12,7 +12,7 @@ export let title: string; export let status: Status; - export let showDetails = true; + export let showDetails = false; let loading = false; const submitPortfolio = async () => { diff --git a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte index b4c9064..23123ee 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte @@ -15,7 +15,7 @@ export let data: PageData; // TODO: transition - let showDetails = true; + let showDetails = false; // @ts-ignore $: candidateData.set(data.candidate); From 36278e091b3118a2e8a03f7e97f035e79e1bfa82 Mon Sep 17 00:00:00 2001 From: EETagent Date: Fri, 23 Dec 2022 19:37:39 +0100 Subject: [PATCH 2/9] feat: styling & formatting --- .../dashboard/DashboardInfoCard.svelte | 127 +++++++++++------- .../components/dashboard/InfoButton.svelte | 109 ++++++++++----- .../(authenticated)/dashboard/+page.svelte | 36 +++-- 3 files changed, 176 insertions(+), 96 deletions(-) diff --git a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte index 0c66427..09b2455 100644 --- a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte +++ b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte @@ -43,80 +43,107 @@ const url = window.URL.createObjectURL(new Blob([portfolioBlob])); const link = document.createElement('a'); link.href = url; - link.setAttribute('download', 'PORTFOLIO' + '_' + $candidateData.candidate.name + '_' + $candidateData.candidate.surname + '.zip'); + link.setAttribute( + 'download', + 'PORTFOLIO' + + '_' + + $candidateData.candidate.name + + '_' + + $candidateData.candidate.surname + + '.zip' + ); document.body.appendChild(link); link.click(); } catch (e) { console.log(e); } - } + }; - - +
-
+
-
- showDetails = !showDetails}> +
+ (showDetails = !showDetails)} + />
-
+
-
+

{title}

{#if showDetails} - -
Vámi vyplněné osobní údaje", - allowHTML: true, - placement: 'top', - showOnCreate: false, - delay: 0 - }} - class="flex flex-col justify-around mt-10"> - Adresa: {$candidateData.candidate.address} - Datum narození: {$candidateData.candidate.birthdate} - Místo narození: {$candidateData.candidate.birthplace} - Rodné číslo: {$candidateData.candidate.personalIdNumber} - Telefon: {$candidateData.candidate.telephone} -
-
Vámi vyplněné osobní údaje", - allowHTML: true, - placement: 'top', - showOnCreate: false, - delay: 0 - }} - class="ml-10 - {#each $candidateData.parents as parent} -
- {parent.name + " " + parent.surname} - Email: {parent.email} - Telefon: {parent.telephone} + +
Vámi vyplněné osobní údaje', + allowHTML: true, + placement: 'top', + showOnCreate: false, + delay: 0 + }} + class="flex flex-col justify-around <2xl:text-xs" + > + Adresa: {$candidateData.candidate.address} + Datum narození: {$candidateData.candidate.birthdate} + Místo narození: {$candidateData.candidate.birthplace} + Rodné číslo: {$candidateData.candidate.personalIdNumber} + Telefon: {$candidateData.candidate.telephone} +
+
Vámi vyplněné osobní údaje', + allowHTML: true, + placement: 'top', + showOnCreate: false, + delay: 0 + }} + class="md:ml-4 flex flex-col <2xl:text-xs" + > + {#each $candidateData.parents as parent} +
+ {parent.name + ' ' + parent.surname} + Email: {parent.email} + Telefon: {parent.telephone} +
+ {/each}
- {/each} -
{/if}
diff --git a/frontend/src/lib/components/dashboard/InfoButton.svelte b/frontend/src/lib/components/dashboard/InfoButton.svelte index 15402d6..6a2431e 100644 --- a/frontend/src/lib/components/dashboard/InfoButton.svelte +++ b/frontend/src/lib/components/dashboard/InfoButton.svelte @@ -10,53 +10,94 @@ const showInfo = () => { dispatch('showInfo'); - } + }; const download = () => { dispatch('download'); - } + }; -
- -
- showInfo()} on:keydown={(_) => showInfo()} - use:tippy={{ - content: (showDetails ? "Skrýt" : "Zobrazit") + " osobní údaje", - placement: 'top', - showOnCreate: false, - delay: 0 - }}> - - + + showInfo()} + on:keydown={(_) => showInfo()} + use:tippy={{ + content: (showDetails ? 'Skrýt' : 'Zobrazit') + ' osobní údaje', + placement: 'top', + showOnCreate: false, + delay: 0 + }} +> + + - {#if $submissionProgress.status === UploadStatus.Submitted} - download()} on:keydown={(_) => download()} use:tippy={{ - content: "Stáhnout portfolio", - placement: 'top', - showOnCreate: false, - delay: 0 - }}> - - - {:else} - download()} + on:keydown={(_) => download()} + use:tippy={{ + content: 'Stáhnout portfolio', placement: 'top', showOnCreate: false, delay: 0 - }}> - - - {/if} -
-
+ }} + > + + +{:else} + + + +{/if} diff --git a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte index 23123ee..2886496 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte @@ -9,7 +9,12 @@ import PortfolioLetterUploadCard from '$lib/components/dashboard/PortfolioLetterUploadCard.svelte'; import PortfolioZipUploadCard from '$lib/components/dashboard/PortfolioZipUploadCard.svelte'; import type { PageData } from './$types'; - import { fetchSubmProgress, submissionProgress, UploadStatus, type Status } from '$lib/stores/portfolio'; + import { + fetchSubmProgress, + submissionProgress, + UploadStatus, + type Status + } from '$lib/stores/portfolio'; import { candidateData } from '$lib/stores/candidate'; export let data: PageData; @@ -21,7 +26,7 @@ $: candidateData.set(data.candidate); // @ts-ignore $: submissionProgress.set(data.submission); - + const getUploadStatus = (progressStatus: UploadStatus | undefined): Status => { switch (progressStatus) { case 3: @@ -31,30 +36,37 @@ default: return 'missing'; } - } + };
-
- +
+ {$candidateData.candidate.email} Uchazeč na SSPŠ
-
+
-
+
-
+
- + {$candidateData.candidate.email} Uchazeč na SSPŠ @@ -81,14 +93,14 @@ diff --git a/frontend/src/lib/components/icons/Document.svelte b/frontend/src/lib/components/icons/Document.svelte new file mode 100644 index 0000000..e3d9082 --- /dev/null +++ b/frontend/src/lib/components/icons/Document.svelte @@ -0,0 +1,16 @@ + + + diff --git a/frontend/src/lib/components/icons/Download.svelte b/frontend/src/lib/components/icons/Download.svelte new file mode 100644 index 0000000..1ad629b --- /dev/null +++ b/frontend/src/lib/components/icons/Download.svelte @@ -0,0 +1,16 @@ + + + From ad284b3435c37e145209aadd19151fd3bf1d9e4d Mon Sep 17 00:00:00 2001 From: EETagent Date: Fri, 23 Dec 2022 22:14:29 +0100 Subject: [PATCH 8/9] feat: animation --- .../(authenticated)/dashboard/+page.svelte | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte index 227446e..60906c9 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+page.svelte @@ -1,4 +1,5 @@
@@ -13,27 +14,30 @@ > - {#if progress === 1} - - {:else} - - {/if} + + >
+ +