Merge pull request #121 from EETagent/more_prod_fixes

(frontend) more prod fixes
This commit is contained in:
Vojtěch Jungmann 2023-01-03 15:53:14 +01:00 committed by GitHub
commit 1367ffcf7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 370 additions and 306 deletions

View file

@ -10,4 +10,5 @@ COPY --from=builder /portfolio/target/release/portfolio /usr/local/bin/portfolio
VOLUME ["/portfolio"] VOLUME ["/portfolio"]
WORKDIR /portfolio WORKDIR /portfolio
EXPOSE 8000
ENTRYPOINT ["portfolio"] ENTRYPOINT ["portfolio"]

View file

@ -1,6 +1,6 @@
declare type FileDropEvent = import("filedrop-svelte/event").FileDropEvent; declare type FileDropEvent = import('filedrop-svelte/event').FileDropEvent;
declare type FileDropSelectEvent = import("filedrop-svelte/event").FileDropSelectEvent; declare type FileDropSelectEvent = import('filedrop-svelte/event').FileDropSelectEvent;
declare type FileDropDragEvent = import("filedrop-svelte/event").FileDropDragEvent; declare type FileDropDragEvent = import('filedrop-svelte/event').FileDropDragEvent;
declare namespace svelte.JSX { declare namespace svelte.JSX {
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface HTMLAttributes<T> { interface HTMLAttributes<T> {
@ -11,8 +11,14 @@ declare namespace svelte.JSX {
onfiledialogcancel?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void; onfiledialogcancel?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void;
onfiledialogclose?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void; onfiledialogclose?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void;
onfiledialogopen?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void; onfiledialogopen?: (event: CustomEvent<FileDropEvent> & { target: EventTarget & T }) => void;
onwindowfiledragenter?: (event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }) => void; onwindowfiledragenter?: (
onwindowfiledragleave?: (event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }) => void; event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }
onwindowfiledragover?: (event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }) => void; ) => void;
onwindowfiledragleave?: (
event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }
) => void;
onwindowfiledragover?: (
event: CustomEvent<FileDropDragEvent> & { target: EventTarget & T }
) => void;
} }
} }

View file

@ -123,9 +123,7 @@ export const apiFetchCandidate = async (id: number, fetchSsr?: Fetch): Promise<C
// SSR compatible // SSR compatible
// List all candidates /admin/list/candidates // List all candidates /admin/list/candidates
export const apiListCandidatesCSV = async ( export const apiListCandidatesCSV = async (fetchSsr?: Fetch): Promise<Blob> => {
fetchSsr?: Fetch,
): Promise<Blob> => {
const apiFetch = fetchSsr || fetch; const apiFetch = fetchSsr || fetch;
try { try {
const res = await apiFetch(API_URL + '/admin/list/candidates_csv', { const res = await apiFetch(API_URL + '/admin/list/candidates_csv', {

View file

@ -26,6 +26,7 @@
try { try {
login = await apiCreateCandidate(data); login = await apiCreateCandidate(data);
dispatch('created'); dispatch('created');
error = '';
} catch (e: unknown) { } catch (e: unknown) {
console.error(e); console.error(e);
error = (e as ApiError).msg; error = (e as ApiError).msg;
@ -47,7 +48,10 @@
{:else} {:else}
<h1 class="text-sspsBlue text-3xl font-semibold">Registrace nového uchazeče</h1> <h1 class="text-sspsBlue text-3xl font-semibold">Registrace nového uchazeče</h1>
{#if error} {#if error}
<div class="my-2 bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert"> <div
class="relative my-2 rounded border border-red-400 bg-red-100 px-4 py-3 text-red-700"
role="alert"
>
<span class="block sm:inline">{error}</span> <span class="block sm:inline">{error}</span>
</div> </div>
{/if} {/if}

View file

@ -1,13 +1,18 @@
<script lang="ts"> <script lang="ts">
import debounce from 'just-debounce-it'; import debounce from 'just-debounce-it';
import { apiDeltePortfolio, apiGetPortfolio, apiLogout, apiSubmitPortfolio } from '$lib/@api/candidate'; import {
apiDeltePortfolio,
apiGetPortfolio,
apiLogout,
apiSubmitPortfolio
} from '$lib/@api/candidate';
import Circles from '$lib/components/icons/Circles.svelte'; import Circles from '$lib/components/icons/Circles.svelte';
import { fetchSubmProgress, type Status } from '$lib/stores/portfolio'; import { fetchSubmProgress, type Status } from '$lib/stores/portfolio';
import StatusNotificationBig from './StatusNotificationBig.svelte'; import StatusNotificationBig from './StatusNotificationBig.svelte';
import InfoButton from './InfoButton.svelte'; import InfoButton from './InfoButton.svelte';
import { baseCandidateData, candidateData } from '$lib/stores/candidate'; import { baseCandidateData, candidateData } from '$lib/stores/candidate';
import tippy, {sticky} from 'tippy.js'; import tippy, { sticky } from 'tippy.js';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
export let title: string; export let title: string;
@ -61,19 +66,19 @@
}; };
const editDetails = async () => { const editDetails = async () => {
goto('/register?edit=true') goto('/register?edit=true');
} };
const logout = async () => { const logout = async () => {
await apiLogout(); await apiLogout();
goto("/auth/login"); goto('/auth/login');
} };
</script> </script>
<div class="card flex flex-col"> <div class="card flex flex-col">
<div class="infoBar <2xl:flex-col flex flex-row-reverse"> <div class="infoBar <2xl:flex-col flex flex-row-reverse">
<StatusNotificationBig {loading} {status} on:click={debounce(handleNotificationClick, 150)} /> <StatusNotificationBig {loading} {status} on:click={debounce(handleNotificationClick, 150)} />
<div class="mr-4 <2xl:mr-1"> <div class="<2xl:mr-1 mr-4">
<div on:click on:keydown class="flex flex-col"> <div on:click on:keydown class="flex flex-col">
<div class="<2xl:ml-auto <2xl:flex-row <2xl:my-2 flex flex-col"> <div class="<2xl:ml-auto <2xl:flex-row <2xl:my-2 flex flex-col">
<InfoButton <InfoButton
@ -101,15 +106,28 @@
sticky: true, sticky: true,
plugins: [sticky] plugins: [sticky]
}} }}
class="<2xl:hidden hover:cursor-pointer"> class="<2xl:hidden hover:cursor-pointer"
<svg class="w-10 h-10 stroke-sspsBlueDark" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg> >
<svg
class="stroke-sspsBlueDark h-10 w-10"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
/></svg
>
</span> </span>
</div> </div>
<slot /> <slot />
</div> </div>
</div> </div>
{#if showDetails} {#if showDetails}
<div class="overflow-scroll flex justify-between"> <div class="flex justify-between overflow-scroll">
<div> <div>
<div <div
use:tippy={{ use:tippy={{
@ -121,7 +139,10 @@
}} }}
class="mt-4 flex flex-col justify-between leading-10" class="mt-4 flex flex-col justify-between leading-10"
> >
<span>Ev. č. přihlášky: <span class="font-bold">{$baseCandidateData.applicationId}</span></span> <span
>Ev. č. přihlášky: <span class="font-bold">{$baseCandidateData.applicationId}</span
></span
>
<span>Obor: <span class="font-bold">{$candidateData.candidate.study}</span></span> <span>Obor: <span class="font-bold">{$candidateData.candidate.study}</span></span>
<span>Adresa: <span class="font-bold">{$candidateData.candidate.address}</span></span> <span>Adresa: <span class="font-bold">{$candidateData.candidate.address}</span></span>
<span <span
@ -133,10 +154,12 @@
></span ></span
> >
<span <span
>Rodné číslo: <span class="font-bold">{$candidateData.candidate.personalIdNumber}</span >Rodné číslo: <span class="font-bold"
>{$candidateData.candidate.personalIdNumber}</span
></span ></span
> >
<span>Telefon: <span class="font-bold">{$candidateData.candidate.telephone}</span></span> <span>Telefon: <span class="font-bold">{$candidateData.candidate.telephone}</span></span
>
</div> </div>
<div <div
use:tippy={{ use:tippy={{
@ -167,8 +190,23 @@
sticky: true, sticky: true,
plugins: [sticky] plugins: [sticky]
}} }}
on:click={(_) => editDetails()} on:keydown={(_) => editDetails()} class="mt-4 hover:cursor-pointer"> on:click={(_) => editDetails()}
<svg class="w-10 h-10 stroke-sspsBlue" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg> on:keydown={(_) => editDetails()}
class="mt-4 hover:cursor-pointer"
>
<svg
class="stroke-sspsBlue h-10 w-10"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
/></svg
>
</span> </span>
</div> </div>
{/if} {/if}
@ -182,7 +220,7 @@
@apply bg-[#f8fbfc]; @apply bg-[#f8fbfc];
@apply rounded-3xl; @apply rounded-3xl;
@apply px-7 py-10 <2xl:px-5 <2xl:py-5; @apply <2xl:px-5 <2xl:py-5 px-7 py-10;
@apply transition-all duration-300; @apply transition-all duration-300;
} }

View file

@ -68,7 +68,6 @@
clearInterval(dashAnimationInterval); clearInterval(dashAnimationInterval);
}; };
const onFileDrop = (dropped: Files) => { const onFileDrop = (dropped: Files) => {
console.log(dropped); console.log(dropped);
if (dropped.accepted.length > 0) { if (dropped.accepted.length > 0) {

View file

@ -88,8 +88,21 @@
}} }}
on:click={(_) => logout()} on:click={(_) => logout()}
on:keydown={(_) => logout()} on:keydown={(_) => logout()}
class="icon logoutIcon ml-1 hover:cursor-pointer"> class="icon logoutIcon ml-1 hover:cursor-pointer"
<svg class="w-10 h-10 icon logoutIcon" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg> >
<svg
class="icon logoutIcon h-10 w-10"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
/></svg
>
</span> </span>
<style lang="postcss"> <style lang="postcss">

View file

@ -49,8 +49,7 @@
} }
.view { .view {
@apply z-10 overflow-scroll; @apply z-10 overflow-scroll;
@apply rounded-3xl md:rounded-none; @apply absolute top-0 right-0 bottom-0 left-0 m-auto md:top-auto md:bottom-auto md:left-auto md:m-0;
@apply absolute top-0 right-0 bottom-0 left-0 m-auto h-[90vh] w-[90vw] md:top-auto md:bottom-auto md:left-auto md:m-0;
@apply md:h-screen md:w-[50vw]; @apply md:h-screen md:w-[50vw];
@apply md:my-auto; @apply md:my-auto;
@apply bg-white; @apply bg-white;

View file

@ -43,7 +43,7 @@ export interface CreateCandidateLogin extends CreateCandidate {
password: string; password: string;
} }
export const baseCandidateData= writable<CreateCandidate>({ export const baseCandidateData = writable<CreateCandidate>({
applicationId: 0, applicationId: 0,
personalIdNumber: '' personalIdNumber: ''
}); });

View file

@ -8,7 +8,7 @@
import type { PageServerData } from './$types'; import type { PageServerData } from './$types';
import Table from '$lib/components/admin/table/Table.svelte'; import Table from '$lib/components/admin/table/Table.svelte';
import bacgkround from "$lib/assets/background.jpg"; import bacgkround from '$lib/assets/background.jpg';
export let data: PageServerData; export let data: PageServerData;
@ -87,7 +87,7 @@
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
} };
</script> </script>
{#if createCandidateModal} {#if createCandidateModal}
@ -98,8 +98,8 @@
{/if} {/if}
<div> <div>
<header class="w-full h-14"> <header class="h-14 w-full">
<img class="h-12 w-full object-cover filter blur-sm" src={bacgkround} alt="Background"> <img class="h-12 w-full object-cover blur-sm filter" src={bacgkround} alt="Background" />
</header> </header>
<div class="flex flex-row"> <div class="flex flex-row">
<div class="list fixed"> <div class="list fixed">
@ -116,12 +116,12 @@
<TextField on:keyup={search} bind:value={searchValue} placeholder="Hledat" /> <TextField on:keyup={search} bind:value={searchValue} placeholder="Hledat" />
<button <button
on:click={openCreateCandidateModal} on:click={openCreateCandidateModal}
class="bg-gray-500 hover:bg-gray-600 ml-3 w-2/5 rounded-lg p-3 py-4 text-xl font-semibold text-white transition-colors duration-300" class="ml-3 w-2/5 rounded-lg bg-gray-500 p-3 py-4 text-xl font-semibold text-white transition-colors duration-300 hover:bg-gray-600"
>Nový uchazeč</button >Nový uchazeč</button
> >
<button <button
on:click={downloadCSV} on:click={downloadCSV}
class="bg-gray-500 hover:bg-gray-600 ml-3 w-2/5 rounded-lg p-3 py-4 text-xl font-semibold text-white transition-colors duration-300" class="ml-3 w-2/5 rounded-lg bg-gray-500 p-3 py-4 text-xl font-semibold text-white transition-colors duration-300 hover:bg-gray-600"
>CSV</button >CSV</button
> >
</div> </div>

View file

@ -34,7 +34,7 @@
<p class="text-sspsGray mt-8 text-center font-light"> <p class="text-sspsGray mt-8 text-center font-light">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br /> Fusce suscipit libero eget elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br /> Fusce suscipit libero eget elit.
</p> </p>
<div class="mt-8 flex w-3/5 flex-col"> <div class="mt-8 flex w-4/5 flex-col lg:w-3/5">
<span> <span>
<TextField bind:value={adminIdValue} placeholder="Admin id" type="number" /> <TextField bind:value={adminIdValue} placeholder="Admin id" type="number" />
</span> </span>
@ -42,7 +42,7 @@
<PasswordField bind:value={adminPasswordValue} placeholder="Heslo" /> <PasswordField bind:value={adminPasswordValue} placeholder="Heslo" />
</span> </span>
</div> </div>
<div class="mt-8 w-3/5"> <div class="mt-8 w-4/5 lg:w-3/5">
<Submit value="Odeslat" on:click={login} /> <Submit value="Odeslat" on:click={login} />
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@ export const load: LayoutServerLoad = async ({ cookies, fetch }) => {
}); });
return { return {
whoami: whoami whoami: whoami
} };
} else { } else {
throw redirect(302, '/auth/logout'); throw redirect(302, '/auth/logout');
} }

View file

@ -82,7 +82,7 @@
{/each} {/each}
</div> </div>
<div class="dashboard dashboardMobile"> <div class="dashboard dashboardMobile">
<div class="name md:my-10 mx-auto w-[90%]"> <div class="name mx-auto w-[90%] md:my-10">
<DashboardInfoCard <DashboardInfoCard
status={getUploadStatus($submissionProgress.status)} status={getUploadStatus($submissionProgress.status)}
title={$candidateData.candidate.name + ' ' + $candidateData.candidate.surname ?? ''} title={$candidateData.candidate.name + ' ' + $candidateData.candidate.surname ?? ''}

View file

@ -9,6 +9,6 @@ export const load: PageServerLoad = async ({ fetch }) => {
}); });
return { return {
candidate: details, candidate: details
}; };
}; };

View file

@ -35,7 +35,6 @@
export let data: PageData; export let data: PageData;
let details = data.candidate; let details = data.candidate;
const formInitialValues = { const formInitialValues = {
gdpr: false, gdpr: false,
candidate: { candidate: {
@ -140,11 +139,10 @@
// TODO: validate on admin dashboard, move somewhere // TODO: validate on admin dashboard, move somewhere
// TODO: nefunguje pro lidi nar. pred 1.1.1954 :D // TODO: nefunguje pro lidi nar. pred 1.1.1954 :D
const isPersonalIdNumberValid = (personalIdNumber: string): boolean => { const isPersonalIdNumberValid = (personalIdNumber: string): boolean => {
const idFmt = personalIdNumber const idFmt = personalIdNumber.split('/').join('');
.split('/')
.join('');
const lastDigitCheck = Number(idFmt.slice(0, 9)) % 11 === Number(idFmt.at(-1)) || const lastDigitCheck =
Number(idFmt.slice(0, 9)) % 11 === Number(idFmt.at(-1)) ||
Number(idFmt.slice(0, 9)) % 11 === 10; // an edge case that could occur Number(idFmt.slice(0, 9)) % 11 === 10; // an edge case that could occur
const divisibleBy11 = Number(idFmt) % 11 === 0; const divisibleBy11 = Number(idFmt) % 11 === 0;
@ -153,25 +151,29 @@
} else { } else {
return false; return false;
} }
} };
const isPersonalIdNumberWithBirthdateValid = (personalIdNumber: string, birthdate: string): boolean => { const isPersonalIdNumberWithBirthdateValid = (
personalIdNumber: string,
birthdate: string
): boolean => {
const dateFmt = birthdate const dateFmt = birthdate
.split('.') .split('.')
.map((x) => x.padStart(2, '0')) .map((x) => x.padStart(2, '0'))
.reverse() .reverse()
.join('') .join('')
.slice(2); .slice(2);
const idFmt = personalIdNumber const idFmt = personalIdNumber.split('/').join('');
.split('/')
.join('');
const divisionValid = isPersonalIdNumberValid(personalIdNumber); const divisionValid = isPersonalIdNumberValid(personalIdNumber);
const idMonth = Number(idFmt.slice(2, 4)); const idMonth = Number(idFmt.slice(2, 4));
const dateMonth = Number(dateFmt.slice(2, 4)); const dateMonth = Number(dateFmt.slice(2, 4));
const monthValid = idMonth === dateMonth || idMonth === dateMonth + 50 || const monthValid =
idMonth === dateMonth + 20 || idMonth === dateMonth + 70; idMonth === dateMonth ||
idMonth === dateMonth + 50 ||
idMonth === dateMonth + 20 ||
idMonth === dateMonth + 70;
if ( if (
idFmt.slice(0, 2) === dateFmt.slice(0, 2) && idFmt.slice(0, 2) === dateFmt.slice(0, 2) &&
@ -183,7 +185,6 @@
} else { } else {
return false; return false;
} }
}; };
const onSubmit = async (values: CandidateData) => { const onSubmit = async (values: CandidateData) => {
@ -192,7 +193,12 @@
let oldValues = JSON.parse(JSON.stringify(values)); let oldValues = JSON.parse(JSON.stringify(values));
try { try {
if (values.candidate.citizenship === 'Česká republika') { if (values.candidate.citizenship === 'Česká republika') {
if (!isPersonalIdNumberWithBirthdateValid(values.candidate.personalIdNumber, values.candidate.birthdate)) { if (
!isPersonalIdNumberWithBirthdateValid(
values.candidate.personalIdNumber,
values.candidate.birthdate
)
) {
alert('Rodné číslo neodpovídá oficiální specifikaci či datumu narození'); // TODO: alerts alert('Rodné číslo neodpovídá oficiální specifikaci či datumu narození'); // TODO: alerts
throw new Error('Rodné číslo neodpovídá datumu narození'); throw new Error('Rodné číslo neodpovídá datumu narození');
} }
@ -212,7 +218,6 @@
(x) => x.name !== '' && x.surname !== '' && x.email !== '' && x.telephone !== '' (x) => x.name !== '' && x.surname !== '' && x.email !== '' && x.telephone !== ''
); );
await apiFillDetails(values); await apiFillDetails(values);
goto('/dashboard'); goto('/dashboard');
} catch (e) { } catch (e) {
@ -220,7 +225,7 @@
console.error('error while submitting data: ' + e); console.error('error while submitting data: ' + e);
} }
} }
} };
const { form, errors, handleSubmit, handleChange } = createForm({ const { form, errors, handleSubmit, handleChange } = createForm({
initialValues: formInitialValues, initialValues: formInitialValues,
@ -292,19 +297,16 @@
}; };
const formatTelephone = (telephone: string) => { const formatTelephone = (telephone: string) => {
return '+' + telephone return '+' + telephone.match(/[0-9]{1,3}/g)!.join(' ');
.match(/[0-9]{1,3}/g)! };
.join(' ');
}
if (details !== undefined) { if (details !== undefined) {
details.candidate.birthdate = details.candidate.birthdate details.candidate.birthdate = details.candidate.birthdate.split('-').reverse().join('.');
.split('-')
.reverse()
.join('.');
details.candidate.telephone = formatTelephone(details.candidate.telephone); details.candidate.telephone = formatTelephone(details.candidate.telephone);
details.parents.map((x) => x.telephone = x.telephone != '' ? formatTelephone(x.telephone) : ''); details.parents.map(
(x) => (x.telephone = x.telephone != '' ? formatTelephone(x.telephone) : '')
);
form.set({ form.set({
gdpr: true, gdpr: true,
candidate: { candidate: {
@ -315,34 +317,34 @@
...details.parents[0] ...details.parents[0]
}, },
{ {
...details.parents[1] ?? { ...(details.parents[1] ?? {
name: '', name: '',
surname: '', surname: '',
email: '', email: '',
telephone: '' telephone: ''
} })
} }
] ]
}); });
pageIndex = 1; // skip gdpr page pageIndex = 1; // skip gdpr page
pageTexts[1] = 'Úprava osobních údajů' pageTexts[1] = 'Úprava osobních údajů';
} }
</script> </script>
<SplitLayout> <SplitLayout>
<div class="form relative"> <div class="form relative">
<div class="overflow-scroll h-[65%] md:h-auto absolute bottom-3/12 flex flex-col w-full"> <div class="bottom-3/12 absolute flex w-full flex-col overflow-scroll md:h-auto">
<div class="h-32 w-32 <md:hidden self-center mb-4"> <div class="<md:h-24 <md:w-24 mb-4 h-32 w-32 self-center">
<SchoolBadge /> <SchoolBadge />
</div> </div>
<form on:submit={handleSubmit} id="triggerForm" class="invisible hidden"></form> <form on:submit={handleSubmit} id="triggerForm" class="invisible hidden" />
{#if pageIndex === 0} {#if pageIndex === 0}
<form on:submit={handleSubmit}> <form on:submit={handleSubmit}>
<h1 class="title mt-8">{pageTexts[0]}</h1> <h1 class="title mt-8">{pageTexts[0]}</h1>
<p class="description mt-8 block text-center"> <p class="description mt-8 block text-center">
V rámci portálu pro přijímací řízení zpracováváme mnoho osobních údajů. Proto je nutný Váš V rámci portálu pro přijímací řízení zpracováváme mnoho osobních údajů. Proto je nutný
souhlas s jejich zpracováním. O bezpečnosti zpracování Vašich osobních údajů si můžete přečíst Váš souhlas s jejich zpracováním. O bezpečnosti zpracování Vašich osobních údajů si
můžete přečíst
<a href="/bezpecnost" class="text-sspsBlue underline"> zde</a>. <a href="/bezpecnost" class="text-sspsBlue underline"> zde</a>.
</p> </p>
<div class="field"> <div class="field">
@ -508,7 +510,8 @@
{:else if pageIndex === 5} {:else if pageIndex === 5}
<h1 class="title mt-8">{pageTexts[5]}</h1> <h1 class="title mt-8">{pageTexts[5]}</h1>
<p class="description mt-8 block text-center"> <p class="description mt-8 block text-center">
Zadejte prosím své občanství, rodné číslo, či jeho alternativu Vaší země a obor na který se hlásíte. Zadejte prosím své občanství, rodné číslo, či jeho alternativu Vaší země a obor na který
se hlásíte.
</p> </p>
<div class="flex w-full flex-row md:flex-col"> <div class="flex w-full flex-row md:flex-col">
<span class="field"> <span class="field">
@ -521,7 +524,11 @@
/> />
</span> </span>
<span class="field ml-2 md:ml-0"> <span class="field 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> </span>
</div> </div>
<div class="field flex items-center justify-center"> <div class="field flex items-center justify-center">
@ -552,7 +559,7 @@
</div> </div>
{/if} {/if}
</div> </div>
<div class="controls w-full absolute bottom-1/12"> <div class="controls bottom-1/12 absolute w-full">
<div class="field"> <div class="field">
<Submit <Submit
on:click={async (e) => { on:click={async (e) => {
@ -570,7 +577,7 @@
/> />
</div> </div>
<div class="mt-4 md:mt-8 flex flex-row justify-center"> <div class="mt-4 flex flex-row justify-center md:mt-8">
{#each Array(pageCount + 1) as _, i} {#each Array(pageCount + 1) as _, i}
<button <button
class:dotActive={i === pageIndex} class:dotActive={i === pageIndex}
@ -594,7 +601,7 @@
<style lang="postcss"> <style lang="postcss">
.field { .field {
@apply mt-4 md:mt-8 w-full; @apply mt-4 w-full md:mt-8 lg:mx-auto lg:w-4/5;
} }
.form { .form {
@apply flex flex-col; @apply flex flex-col;
@ -618,6 +625,6 @@
@apply text-gray-500; @apply text-gray-500;
} }
.title { .title {
@apply text-sspsBlue text-4xl font-semibold text-center; @apply text-sspsBlue text-center text-4xl font-semibold;
} }
</style> </style>

View file

@ -21,12 +21,13 @@
<SchoolBadge /> <SchoolBadge />
<h1 class="text-sspsBlue mt-8 text-4xl font-semibold">Přihlášení</h1> <h1 class="text-sspsBlue mt-8 text-4xl font-semibold">Přihlášení</h1>
<p class="text-sspsGray my-8 text-center font-light"> <p class="text-sspsGray my-8 text-center font-light">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br /> Fusce suscipit libero eget elit. Evidenční číslo je jedinečné číslo přidělené uchazeči, které slouží k jeho identifikaci<br /> a
přihlášení se do systému.
</p> </p>
<div class="w-3/5"> <div class="w-4/5 lg:w-3/5">
<TextField bind:value={applicationValue} placeholder="Ev. číslo" type="number" /> <TextField bind:value={applicationValue} placeholder="Ev. číslo" type="number" />
</div> </div>
<div class="mt-8 w-3/5"> <div class="mt-8 w-4/5 lg:w-3/5">
<Submit on:click={redirectToCode} value="Odeslat" /> <Submit on:click={redirectToCode} value="Odeslat" />
</div> </div>
</div> </div>

View file

@ -123,14 +123,14 @@
.modal { .modal {
@apply flex flex-col items-center justify-center; @apply flex flex-col items-center justify-center;
@apply mx-auto my-auto; @apply mx-auto my-auto;
@apply h-[90vh] w-[90vw] md:h-4/5 md:w-4/5; @apply h-full w-full md:h-4/5 md:w-4/5;
@apply rounded-3xl; @apply md:rounded-3xl;
@apply bg-white; @apply bg-white;
} }
input { input {
@apply text-sspsBlue text-center font-semibold; @apply text-sspsBlue text-center font-semibold;
@apply transition-colors duration-300; @apply transition-colors duration-300;
@apply focus:border-sspsBlue hover:border-sspsBlue rounded-xl border border-2 bg-[#f8fafb] p-3 md:caret-transparent shadow-lg outline-none; @apply focus:border-sspsBlue hover:border-sspsBlue rounded-xl border border-2 bg-[#f8fafb] p-3 shadow-lg outline-none md:caret-transparent;
} }
.separater { .separater {
@apply bg-sspsBlue mr-2 hidden h-2 w-8 md:block; @apply bg-sspsBlue mr-2 hidden h-2 w-8 md:block;

View file

@ -1,2 +0,0 @@
<h1 class="text-6xl">Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>