mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-17 13:31:12 +00:00
fix: formatting
This commit is contained in:
parent
5f431fb92a
commit
23fab618db
23 changed files with 280 additions and 279 deletions
|
|
@ -1,21 +1,18 @@
|
|||
import { API_URL } from '$lib/@api';
|
||||
import type { HandleFetch } from '@sveltejs/kit';
|
||||
import type { HandleFetch } from '@sveltejs/kit';
|
||||
|
||||
export const handleFetch: HandleFetch = async ({ request, fetch, event,}) => {
|
||||
export const handleFetch: HandleFetch = async ({ request, fetch, event }) => {
|
||||
console.log(`SSR: handleFetch() BEFORE: ${request.method} ${request.url}`);
|
||||
|
||||
const cookie = event.request.headers.get('cookie') || '';
|
||||
const cookie = event.request.headers.get('cookie') || '';
|
||||
|
||||
console.log(`SSR: handleFetch() cookie: ${cookie}`);
|
||||
|
||||
request.headers.set('cookie', cookie);
|
||||
console.log(`SSR: handleFetch() cookie: ${cookie}`);
|
||||
|
||||
request = new Request(
|
||||
request.url.replace(API_URL, 'http://127.0.0.1:8000'),
|
||||
request
|
||||
);
|
||||
request.headers.set('cookie', cookie);
|
||||
|
||||
console.log(`SSR: handleFetch() AFTER: ${request.method} ${request.url}`);
|
||||
request = new Request(request.url.replace(API_URL, 'http://127.0.0.1:8000'), request);
|
||||
|
||||
console.log(`SSR: handleFetch() AFTER: ${request.method} ${request.url}`);
|
||||
|
||||
return fetch(request);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { AxiosError } from "axios";
|
||||
import type { AxiosError } from 'axios';
|
||||
|
||||
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
||||
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
||||
|
||||
export const API_URL = "http://localhost:8000";
|
||||
export const API_URL = 'http://localhost:8000';
|
||||
|
||||
export interface ApiError {
|
||||
error: AxiosError,
|
||||
msg: string,
|
||||
error: AxiosError;
|
||||
msg: string;
|
||||
}
|
||||
|
||||
export function errorHandler(error: AxiosError, msg: string): ApiError {
|
||||
return {error, msg}
|
||||
}
|
||||
return { error, msg };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@
|
|||
</svg>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
@apply w-12 h-12;
|
||||
}
|
||||
svg {
|
||||
@apply w-12 h-12;
|
||||
}
|
||||
.blue {
|
||||
@apply stroke-sspsBlue fill-sspsBlue;
|
||||
@apply transition-colors duration-300 hover:fill-sspsBlueDark hover:stroke-sspsBlueDark;
|
||||
@apply transition-colors duration-300 hover:fill-sspsBlueDark hover:stroke-sspsBlueDark;
|
||||
}
|
||||
.white {
|
||||
@apply stroke-white fill-white;
|
||||
}
|
||||
@apply stroke-white fill-white;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,20 @@
|
|||
<script lang="ts">
|
||||
import { fetchSubmProgress } from "$lib/stores/portfolio";
|
||||
import { apiUploadCoverLetter } from "$lib/@api/candidate";
|
||||
import DashboardUploadCard from "./DashboardUploadCard.svelte";
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadCoverLetter(file, callback);
|
||||
await fetchSubmProgress();
|
||||
}
|
||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||
import { apiUploadCoverLetter } from '$lib/@api/candidate';
|
||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadCoverLetter(file, callback);
|
||||
await fetchSubmProgress();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<DashboardUploadCard
|
||||
on:filedrop={e => onFileDrop(e.detail)}
|
||||
title="Motivační dopis"
|
||||
filetype="PDF"
|
||||
filesize={10}
|
||||
fileType={1}
|
||||
>
|
||||
</DashboardUploadCard>
|
||||
<DashboardUploadCard
|
||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||
title="Motivační dopis"
|
||||
filetype="PDF"
|
||||
filesize={10}
|
||||
fileType={1}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
@apply bg-white rounded-xl shadow-md;
|
||||
|
||||
@apply hover:bg-sspsBlue;
|
||||
@apply hover:cursor-pointer;
|
||||
@apply hover:cursor-pointer;
|
||||
}
|
||||
|
||||
div,
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
<script lang="ts">
|
||||
import { fetchSubmProgress } from "$lib/stores/portfolio";
|
||||
import { apiUploadPortfolioLetter } from "../../@api/candidate";
|
||||
import DashboardUploadCard from "./DashboardUploadCard.svelte";
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadPortfolioLetter(file, callback);
|
||||
await fetchSubmProgress();
|
||||
}
|
||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||
import { apiUploadPortfolioLetter } from '../../@api/candidate';
|
||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadPortfolioLetter(file, callback);
|
||||
await fetchSubmProgress();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<DashboardUploadCard
|
||||
on:filedrop={e => onFileDrop(e.detail)}
|
||||
title="Portfolio"
|
||||
filetype="PDF"
|
||||
filesize={10}
|
||||
fileType={2}>
|
||||
</DashboardUploadCard>
|
||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||
title="Portfolio"
|
||||
filetype="PDF"
|
||||
filesize={10}
|
||||
fileType={2}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
<script lang="ts">
|
||||
import { fetchSubmProgress } from "$lib/stores/portfolio";
|
||||
import { apiUploadPortfolioZip } from "$lib/@api/candidate";
|
||||
import DashboardUploadCard from "./DashboardUploadCard.svelte";
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadPortfolioZip(file, callback);
|
||||
await fetchSubmProgress();
|
||||
}
|
||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||
import { apiUploadPortfolioZip } from '$lib/@api/candidate';
|
||||
import DashboardUploadCard from './DashboardUploadCard.svelte';
|
||||
|
||||
const onFileDrop = async (detail: any) => {
|
||||
const file = detail.file;
|
||||
const callback = detail.callback;
|
||||
await apiUploadPortfolioZip(file, callback);
|
||||
await fetchSubmProgress();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<DashboardUploadCard
|
||||
on:filedrop={e => onFileDrop(e.detail)}
|
||||
title="Další data"
|
||||
filetype="ZIP"
|
||||
filesize={100}
|
||||
fileType={3}>
|
||||
</DashboardUploadCard>
|
||||
on:filedrop={(e) => onFileDrop(e.detail)}
|
||||
title="Další data"
|
||||
filetype="ZIP"
|
||||
filesize={100}
|
||||
fileType={3}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,39 @@
|
|||
<script lang="ts">
|
||||
export let progress: number;
|
||||
export let progress: number;
|
||||
</script>
|
||||
|
||||
<div class="progress-bar">
|
||||
<svg class="animated animate-ease-linear"
|
||||
width="40mm"
|
||||
height="8mm"
|
||||
viewBox="0 0 50 6"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
class="animated animate-ease-linear"
|
||||
width="40mm"
|
||||
height="8mm"
|
||||
viewBox="0 0 50 6"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<line x1="5" y1="3" x2="45" y2="3" stroke="#e6e6e6" stroke-width="6" stroke-linecap="round" />
|
||||
|
||||
<line x1="5" y1="3" x2="45" y2="3" stroke="#e6e6e6" stroke-width="6" stroke-linecap="round" />
|
||||
|
||||
{#if progress === 1}
|
||||
<line x1="5" y1="3" x2={progress * 45} y2="3" stroke="#35e000ff" stroke-width="3" stroke-linecap="round" />
|
||||
{:else}
|
||||
<line x1="5" y1="3" x2={progress * 45} y2="3" stroke="#75bff8ff" stroke-width="3" stroke-linecap="round" />
|
||||
{/if}
|
||||
>
|
||||
</svg>
|
||||
</div>
|
||||
{#if progress === 1}
|
||||
<line
|
||||
x1="5"
|
||||
y1="3"
|
||||
x2={progress * 45}
|
||||
y2="3"
|
||||
stroke="#35e000ff"
|
||||
stroke-width="3"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
{:else}
|
||||
<line
|
||||
x1="5"
|
||||
y1="3"
|
||||
x2={progress * 45}
|
||||
y2="3"
|
||||
stroke="#75bff8ff"
|
||||
stroke-width="3"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
{/if}
|
||||
>
|
||||
</svg>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,42 +1,41 @@
|
|||
<script lang="ts">
|
||||
import type { Status } from "$lib/stores/portfolio";
|
||||
import StatusNotificationDot from "./StatusNotificationDot.svelte";
|
||||
import type { Status } from '$lib/stores/portfolio';
|
||||
import StatusNotificationDot from './StatusNotificationDot.svelte';
|
||||
|
||||
export let status: Status;
|
||||
|
||||
let title: string;
|
||||
switch (status) {
|
||||
case "submitted":
|
||||
title = "Soubory odeslány!";
|
||||
break;
|
||||
case "uploaded":
|
||||
title = "Soubory nahrány!";
|
||||
break;
|
||||
case "missing":
|
||||
title = "Chybí soubory!";
|
||||
break;
|
||||
}
|
||||
export let status: Status;
|
||||
|
||||
let title: string;
|
||||
switch (status) {
|
||||
case 'submitted':
|
||||
title = 'Soubory odeslány!';
|
||||
break;
|
||||
case 'uploaded':
|
||||
title = 'Soubory nahrány!';
|
||||
break;
|
||||
case 'missing':
|
||||
title = 'Chybí soubory!';
|
||||
break;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="bg-white rounded-full flex mb-8">
|
||||
<div class="mt-3 mb-3 ml-3 flex flex-row">
|
||||
<h2 class="ml-2 text-2xl text-sspsBlueDark font-bold">{title}</h2>
|
||||
<span class="ml-32 w-8 h-8 rounded-full self-center {status}" />
|
||||
<!-- <StatusNotificationDot {status} /> -->
|
||||
</div>
|
||||
<div class="mt-3 mb-3 ml-3 flex flex-row">
|
||||
<h2 class="ml-2 text-2xl text-sspsBlueDark font-bold">{title}</h2>
|
||||
<span class="ml-32 w-8 h-8 rounded-full self-center {status}" />
|
||||
<!-- <StatusNotificationDot {status} /> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.submitted {
|
||||
@apply bg-[#35e000ff];
|
||||
}
|
||||
.submitted {
|
||||
@apply bg-[#35e000ff];
|
||||
}
|
||||
|
||||
.uploaded {
|
||||
@apply bg-[#ff8530ff];
|
||||
}
|
||||
.uploaded {
|
||||
@apply bg-[#ff8530ff];
|
||||
}
|
||||
|
||||
.missing {
|
||||
@apply bg-[#ff3030ff];
|
||||
}
|
||||
.missing {
|
||||
@apply bg-[#ff3030ff];
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,50 +1,47 @@
|
|||
<script lang="ts">
|
||||
import type { Status } from "$lib/stores/portfolio";
|
||||
import type { Status } from '$lib/stores/portfolio';
|
||||
|
||||
export let status: Status;
|
||||
let title: string;
|
||||
|
||||
export let status: Status;
|
||||
let title: string;
|
||||
|
||||
$: switch (status) {
|
||||
case "submitted":
|
||||
title = "Odeslané";
|
||||
break;
|
||||
case "uploaded":
|
||||
title = "Nahráno";
|
||||
break;
|
||||
case "missing":
|
||||
title = "Chybí";
|
||||
break;
|
||||
};
|
||||
$: switch (status) {
|
||||
case 'submitted':
|
||||
title = 'Odeslané';
|
||||
break;
|
||||
case 'uploaded':
|
||||
title = 'Nahráno';
|
||||
break;
|
||||
case 'missing':
|
||||
title = 'Chybí';
|
||||
break;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- make red dot -->
|
||||
<div class="flex flex-row justify-between animate-pulse div-{status}">
|
||||
<span class="mt-1 w-6 h-6 rounded-full {status}" />
|
||||
<!-- <h3 class="ml-8 font-bold text-xl">{title}</h3> -->
|
||||
<span class="mt-1 w-6 h-6 rounded-full {status}" />
|
||||
<!-- <h3 class="ml-8 font-bold text-xl">{title}</h3> -->
|
||||
</div>
|
||||
|
||||
<style>
|
||||
span {
|
||||
span {
|
||||
@apply rounded-full p-1;
|
||||
}
|
||||
|
||||
.div-submitted {
|
||||
@apply animate-none;
|
||||
}
|
||||
.div-submitted {
|
||||
@apply animate-none;
|
||||
}
|
||||
|
||||
.submitted {
|
||||
@apply bg-[#35e000ff];
|
||||
}
|
||||
.submitted {
|
||||
@apply bg-[#35e000ff];
|
||||
}
|
||||
|
||||
.uploaded {
|
||||
@apply bg-[#ff8530ff];
|
||||
@apply animate-none;
|
||||
.uploaded {
|
||||
@apply bg-[#ff8530ff];
|
||||
@apply animate-none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.missing {
|
||||
@apply bg-red-700;
|
||||
}
|
||||
|
||||
</style>
|
||||
.missing {
|
||||
@apply bg-red-700;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
@apply text-center text-2xl text-sspsBlue;
|
||||
@apply pb-1;
|
||||
|
||||
@apply select-none;
|
||||
@apply select-none;
|
||||
}
|
||||
span:hover {
|
||||
@apply cursor-pointer;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
<svg height="24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
d="M4.586 20.414l-.707.707zm14.828 0l-.707-.707zM19 10v7h2v-7zm-3 10H8v2h8zM5 17v-7H3v7zm3 3c-.971 0-1.599-.002-2.061-.064-.434-.059-.57-.153-.646-.229l-1.414 1.414c.51.51 1.138.709 1.793.797C6.3 22.002 7.085 22 8 22zm-5-3c0 .915-.002 1.701.082 2.328.088.655.287 1.284.797 1.793l1.414-1.414c-.076-.076-.17-.212-.229-.646C5.002 18.6 5 17.971 5 17zm16 0c0 .971-.002 1.599-.064 2.061-.059.434-.153.57-.229.646l1.414 1.414c.51-.51.709-1.138.797-1.793C21.002 18.7 21 17.915 21 17zm-3 5c.915 0 1.701.002 2.328-.082.655-.088 1.284-.287 1.793-.797l-1.414-1.414c-.076.076-.212.17-.646.229-.462.062-1.09.064-2.061.064z"
|
||||
/><path
|
||||
d="M3 11l6.172-6.172c1.333-1.333 2-2 2.828-2s1.495.667 2.828 2L21 11"
|
||||
stroke-linecap="round"
|
||||
stroke-width="2"
|
||||
/><path
|
||||
d="M9 17c0-.932 0-1.398.152-1.765a2 2 0 0 1 1.083-1.083C10.602 14 11.068 14 12 14s1.398 0 1.765.152a2 2 0 0 1 1.083 1.083C15 15.602 15 16.068 15 17v4H9zm7-12.5c0-.466 0-.699.076-.883a1 1 0 0 1 .541-.54C16.801 3 17.034 3 17.5 3s.699 0 .883.076a1 1 0 0 1 .54.541c.077.184.077.417.077.883V10l-3-3.5z"
|
||||
/></svg
|
||||
><path
|
||||
d="M4.586 20.414l-.707.707zm14.828 0l-.707-.707zM19 10v7h2v-7zm-3 10H8v2h8zM5 17v-7H3v7zm3 3c-.971 0-1.599-.002-2.061-.064-.434-.059-.57-.153-.646-.229l-1.414 1.414c.51.51 1.138.709 1.793.797C6.3 22.002 7.085 22 8 22zm-5-3c0 .915-.002 1.701.082 2.328.088.655.287 1.284.797 1.793l1.414-1.414c-.076-.076-.17-.212-.229-.646C5.002 18.6 5 17.971 5 17zm16 0c0 .971-.002 1.599-.064 2.061-.059.434-.153.57-.229.646l1.414 1.414c.51-.51.709-1.138.797-1.793C21.002 18.7 21 17.915 21 17zm-3 5c.915 0 1.701.002 2.328-.082.655-.088 1.284-.287 1.793-.797l-1.414-1.414c-.076.076-.212.17-.646.229-.462.062-1.09.064-2.061.064z"
|
||||
/><path
|
||||
d="M3 11l6.172-6.172c1.333-1.333 2-2 2.828-2s1.495.667 2.828 2L21 11"
|
||||
stroke-linecap="round"
|
||||
stroke-width="2"
|
||||
/><path
|
||||
d="M9 17c0-.932 0-1.398.152-1.765a2 2 0 0 1 1.083-1.083C10.602 14 11.068 14 12 14s1.398 0 1.765.152a2 2 0 0 1 1.083 1.083C15 15.602 15 16.068 15 17v4H9zm7-12.5c0-.466 0-.699.076-.883a1 1 0 0 1 .541-.54C16.801 3 17.034 3 17.5 3s.699 0 .883.076a1 1 0 0 1 .54.541c.077.184.077.417.077.883V10l-3-3.5z"
|
||||
/></svg
|
||||
>
|
||||
|
||||
<style>
|
||||
path {
|
||||
@apply fill-sspsBlue;
|
||||
}
|
||||
path:nth-child(2) {
|
||||
@apply stroke-sspsBlue;
|
||||
}
|
||||
</style>
|
||||
path {
|
||||
@apply fill-sspsBlue;
|
||||
}
|
||||
path:nth-child(2) {
|
||||
@apply stroke-sspsBlue;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
|
@ -1,5 +1,5 @@
|
|||
<svg height="24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
><g
|
||||
<svg height="24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
><g
|
||||
><path
|
||||
d="M19.414 20.414l.707.707zm-14.828 0l-.707.707zm14.828-9.828l.707-.707zM8 11h8V9H8zm-3 6v-3H3v3zm11 3H8v2h8zm3-6v3h2v-3zm-3 8c.915 0 1.701.002 2.328-.082.655-.088 1.284-.287 1.793-.797l-1.414-1.414c-.076.076-.212.17-.646.229-.462.062-1.09.064-2.061.064zm3-5c0 .971-.002 1.599-.064 2.061-.059.434-.153.57-.229.646l1.414 1.414c.51-.51.709-1.138.797-1.793C21.002 18.7 21 17.915 21 17zM3 17c0 .915-.002 1.701.082 2.328.088.655.287 1.284.797 1.793l1.414-1.414c-.076-.076-.17-.212-.229-.646C5.002 18.6 5 17.971 5 17zm5 3c-.971 0-1.599-.002-2.061-.064-.434-.059-.57-.153-.646-.229l-1.414 1.414c.51.51 1.138.709 1.793.797C6.3 22.002 7.085 22 8 22zm8-9c.971 0 1.599.002 2.061.064.434.059.57.153.646.229l1.414-1.414c-.51-.51-1.138-.709-1.793-.797C17.7 8.998 16.915 9 16 9zm5 3c0-.915.002-1.701-.082-2.328-.088-.655-.287-1.284-.797-1.793l-1.414 1.414c.076.076.17.212.229.646.062.462.064 1.09.064 2.061zM8 9c-.915 0-1.701-.002-2.328.082-.655.088-1.284.287-1.793.797l1.414 1.414c.076-.076.212-.17.646-.229C6.4 11.002 7.029 11 8 11zm-3 5c0-.971.002-1.599.064-2.061.059-.434.153-.57.229-.646L3.879 9.879c-.51.51-.709 1.138-.797 1.793C2.998 12.3 3 13.085 3 14z"
|
||||
/><path
|
||||
|
|
@ -9,10 +9,11 @@
|
|||
>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
@apply stroke-sspsBlue fill-sspsBlue;
|
||||
}
|
||||
g, path {
|
||||
@apply fill-sspsBlue stroke-sspsBlue;
|
||||
}
|
||||
</style>
|
||||
svg {
|
||||
@apply stroke-sspsBlue fill-sspsBlue;
|
||||
}
|
||||
g,
|
||||
path {
|
||||
@apply fill-sspsBlue stroke-sspsBlue;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,4 +1,4 @@
|
|||
<svg height="24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
<svg height="24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
d="M19 21v-1.45c0-.977 0-1.465-.113-1.864a3 3 0 0 0-2.073-2.073c-.399-.113-.887-.113-1.864-.113h-6.9c-.977 0-1.465 0-1.864.113a3 3 0 0 0-2.073 2.073C4 18.085 4 18.573 4 19.55V21M16.2 7.06c0 2.245-1.88 4.065-4.2 4.065S7.8 9.305 7.8 7.06 9.68 2.996 12 2.996s4.2 1.82 4.2 4.064z"
|
||||
stroke="currentColor"
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 524 B |
|
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import lion from '$lib/assets/logo/lion.png';
|
||||
</script>
|
||||
import lion from '$lib/assets/logo/lion.png';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="py-3 px-6 md:py-4 md:px-8 rounded-[999px] shadow-2xl flex items-center justify-center transition-all duration-700 hover:shadow-md"
|
||||
>
|
||||
|
|
@ -8,5 +9,4 @@
|
|||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<div class="bg">
|
||||
<div class="bgOverlay">
|
||||
<img class="logo" src={logo} alt="SSPŠ logo" />
|
||||
<img class="logo" src={logo} alt="SSPŠ logo" />
|
||||
<div class="darkModeToggle">
|
||||
<DarkModeToggle backgroundColor="dark" />
|
||||
</div>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<style>
|
||||
.logo {
|
||||
@apply w-[200px] h-[200px]
|
||||
@apply w-[200px] h-[200px];
|
||||
}
|
||||
.bgImage {
|
||||
@apply -z-20;
|
||||
|
|
|
|||
|
|
@ -4,19 +4,22 @@
|
|||
import DarkModeToggle from '../DarkModeToggle.svelte';
|
||||
|
||||
export let backgroundImage: string = defaultBg;
|
||||
export let backgroundPosition: string = "55%";
|
||||
export let backgroundPosition: string = '55%';
|
||||
</script>
|
||||
|
||||
<div class="bg">
|
||||
<div class="bgOverlay">
|
||||
<img class="logo" src={logo} alt="SSPŠ logo" />
|
||||
</div>
|
||||
<div style={`background-image: url(${backgroundImage}); background-position: ${backgroundPosition}`} class="bgImage" />
|
||||
<div
|
||||
style={`background-image: url(${backgroundImage}); background-position: ${backgroundPosition}`}
|
||||
class="bgImage"
|
||||
/>
|
||||
</div>
|
||||
<div class="view">
|
||||
<div class="darkModeToggle">
|
||||
<DarkModeToggle/>
|
||||
</div>
|
||||
<div class="darkModeToggle">
|
||||
<DarkModeToggle />
|
||||
</div>
|
||||
<div class="content">
|
||||
<slot />
|
||||
</div>
|
||||
|
|
@ -52,7 +55,7 @@
|
|||
@apply md:my-auto;
|
||||
@apply bg-white;
|
||||
}
|
||||
.content {
|
||||
@apply w-full h-full;
|
||||
}
|
||||
.content {
|
||||
@apply w-full h-full;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -6,29 +6,22 @@
|
|||
export let value: string = '';
|
||||
export let error: string = '';
|
||||
|
||||
// Phone Number formatting
|
||||
// Phone Number formatting
|
||||
$: {
|
||||
let x = value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,3})/)!;
|
||||
value =
|
||||
(x[1] ? '+' + x[1] : '') + (x[2] ? ' ' + x[2] : '') + (x[3] ? ' ' + x[3] : '') + (x[4] ? ' ' + x[4] : '');
|
||||
(x[1] ? '+' + x[1] : '') +
|
||||
(x[2] ? ' ' + x[2] : '') +
|
||||
(x[3] ? ' ' + x[3] : '') +
|
||||
(x[4] ? ' ' + x[4] : '');
|
||||
}
|
||||
</script>
|
||||
|
||||
<TextField
|
||||
bind:error
|
||||
bind:value
|
||||
on:keydown
|
||||
on:keyup
|
||||
on:change
|
||||
type="tel"
|
||||
{placeholder}
|
||||
icon
|
||||
>
|
||||
<TextField bind:error bind:value on:keydown on:keyup on:change type="tel" {placeholder} icon>
|
||||
<div slot="icon" class="flex items-center justify-center">
|
||||
<Telephone />
|
||||
</div>
|
||||
</TextField>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
import { writable } from "svelte/store";
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export interface CandidateData {
|
||||
name?: string;
|
||||
surname?: string;
|
||||
birthplace?: string;
|
||||
birthdate?: string;
|
||||
address?: string;
|
||||
telephone?: string;
|
||||
citizenship?: string;
|
||||
email?: string;
|
||||
sex?: string;
|
||||
study?: string;
|
||||
personalIdNumber?: string;
|
||||
parentName?: string;
|
||||
parentSurname?: string;
|
||||
parentTelephone?: string;
|
||||
parentEmail?: string;
|
||||
name?: string;
|
||||
surname?: string;
|
||||
birthplace?: string;
|
||||
birthdate?: string;
|
||||
address?: string;
|
||||
telephone?: string;
|
||||
citizenship?: string;
|
||||
email?: string;
|
||||
sex?: string;
|
||||
study?: string;
|
||||
personalIdNumber?: string;
|
||||
parentName?: string;
|
||||
parentSurname?: string;
|
||||
parentTelephone?: string;
|
||||
parentEmail?: string;
|
||||
}
|
||||
|
||||
export interface CandidateLogin {
|
||||
applicationId: number;
|
||||
password: string;
|
||||
applicationId: number;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export const candidateData = writable<CandidateData>({});
|
||||
export const candidateData = writable<CandidateData>({});
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
import { apiFetchSubmissionProgress } from "../@api/candidate";
|
||||
import { writable } from "svelte/store";
|
||||
import { apiFetchSubmissionProgress } from '../@api/candidate';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export type Status = 'submitted' | 'uploaded' | 'missing';
|
||||
|
||||
export enum UploadStatus {
|
||||
None = 1,
|
||||
Some = 2,
|
||||
All = 3,
|
||||
Submitted = 4,
|
||||
None = 1,
|
||||
Some = 2,
|
||||
All = 3,
|
||||
Submitted = 4
|
||||
}
|
||||
|
||||
export interface SubmissionProgress {
|
||||
status?: UploadStatus;
|
||||
files?: [number];
|
||||
status?: UploadStatus;
|
||||
files?: [number];
|
||||
}
|
||||
export const submissionProgress = writable<SubmissionProgress>({});
|
||||
|
||||
export async function fetchSubmProgress() {
|
||||
try {
|
||||
const prog = await apiFetchSubmissionProgress();
|
||||
submissionProgress.set(prog);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
const prog = await apiFetchSubmissionProgress();
|
||||
submissionProgress.set(prog);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,10 @@
|
|||
name: yup.string().required(),
|
||||
surname: yup.string(),
|
||||
email: yup.string().email().required(),
|
||||
telephone: yup.string().required().matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/),
|
||||
telephone: yup
|
||||
.string()
|
||||
.required()
|
||||
.matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/),
|
||||
birthplace: yup.string().required(),
|
||||
birthdate: yup.string().required(),
|
||||
sex: yup.string(),
|
||||
|
|
@ -53,24 +56,27 @@
|
|||
study: yup.string().required(),
|
||||
parentName: yup.string(),
|
||||
parentSurname: yup.string(),
|
||||
parentTelephone: yup.string().required().matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/),
|
||||
parentTelephone: yup
|
||||
.string()
|
||||
.required()
|
||||
.matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/),
|
||||
parentEmail: yup.string().email().required()
|
||||
}),
|
||||
|
||||
onSubmit: async (values) => {
|
||||
if (pageIndex === pageCount) {
|
||||
try {
|
||||
console.log("submit")
|
||||
console.log('submit');
|
||||
// @ts-ignore // love javascript
|
||||
delete values.undefined;
|
||||
values.birthdate = '2000-01-01' // TODO: reformat user typed date
|
||||
values.birthdate = '2000-01-01'; // TODO: reformat user typed date
|
||||
await apiFillDetails(values);
|
||||
goto("/dashboard");
|
||||
goto('/dashboard');
|
||||
} catch (e) {
|
||||
console.error("error while submitting data: " + e);
|
||||
console.error('error while submitting data: ' + e);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$: console.log($errors);
|
||||
|
|
@ -84,7 +90,10 @@
|
|||
break;
|
||||
|
||||
case 1:
|
||||
if (/* $errors.birthdurname || */ $errors.birthplace || $errors.birthdate /* || $errors.sex */) {
|
||||
if (
|
||||
/* $errors.birthdurname || */ $errors.birthplace ||
|
||||
$errors.birthdate /* || $errors.sex */
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
|
@ -158,11 +167,7 @@
|
|||
</p>
|
||||
<div class="flex flex-row md:flex-col w-full">
|
||||
<span class="w-full mt-8">
|
||||
<TextField
|
||||
type="text"
|
||||
placeholder="Rodné příjmení"
|
||||
on:change={handleChange}
|
||||
/>
|
||||
<TextField type="text" placeholder="Rodné příjmení" on:change={handleChange} />
|
||||
</span>
|
||||
<span class="w-full mt-8 ml-2 md:ml-0">
|
||||
<TextField
|
||||
|
|
@ -250,11 +255,7 @@
|
|||
/>
|
||||
</span>
|
||||
<span class="w-full mt-8 ml-2 md:ml-0">
|
||||
<TextField
|
||||
on:change={handleChange}
|
||||
type="text"
|
||||
placeholder="Evidenční číslo přihlášky"
|
||||
/>
|
||||
<TextField on:change={handleChange} type="text" placeholder="Evidenční číslo přihlášky" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-8 flex items-center justify-center w-full">
|
||||
|
|
@ -278,7 +279,7 @@
|
|||
<input
|
||||
on:click={async (e) => {
|
||||
await handleSubmit(e);
|
||||
console.log("clicked " + isPageInvalid());
|
||||
console.log('clicked ' + isPageInvalid());
|
||||
if (isPageInvalid()) return;
|
||||
if (pageIndex === pageCount) {
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import { apiLogout } from '$lib/@api/candidate';
|
|||
export const load: PageServerLoad = async ({ fetch, cookies }) => {
|
||||
await apiLogout(fetch);
|
||||
|
||||
cookies.delete('id', { path: '/' });
|
||||
cookies.delete('key', { path: '/' });
|
||||
cookies.delete('id', { path: '/' });
|
||||
cookies.delete('key', { path: '/' });
|
||||
|
||||
throw redirect(302, '/auth/login');
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { defineConfig } from 'windicss/helpers';
|
||||
|
||||
export default defineConfig({
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
"sspsBlue": '#406280',
|
||||
"sspsBlueDark": '#243a55',
|
||||
"sspsGray": "#e6e6e6",
|
||||
}
|
||||
}
|
||||
}
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
sspsBlue: '#406280',
|
||||
sspsBlueDark: '#243a55',
|
||||
sspsGray: '#e6e6e6'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue