mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-06 08:10:20 +00:00
Merge pull request #91 from EETagent/frontend_admin_dashboard_fix
(frontend) Candidate Data on Admin Dashboard
This commit is contained in:
commit
fb541bfe56
3 changed files with 38 additions and 22 deletions
|
|
@ -3,7 +3,10 @@
|
||||||
import type { CandidateData } from '$lib/stores/candidate';
|
import type { CandidateData } from '$lib/stores/candidate';
|
||||||
|
|
||||||
export let id: number;
|
export let id: number;
|
||||||
export let candidate: CandidateData;
|
export let candidateData: CandidateData;
|
||||||
|
|
||||||
|
let candidate = candidateData.candidate;
|
||||||
|
let parents = candidateData.parents;
|
||||||
|
|
||||||
async function resetCandidatePassword() {
|
async function resetCandidatePassword() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -63,31 +66,41 @@
|
||||||
<td class="px-2 py-2 font-semibold text-gray-500">Obor</td>
|
<td class="px-2 py-2 font-semibold text-gray-500">Obor</td>
|
||||||
<td class="px-2 py-2">{candidate.study}</td>
|
<td class="px-2 py-2">{candidate.study}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="px-2 py-2 font-semibold text-gray-500">Rodné číslo</td>
|
||||||
|
<td class="px-2 py-2">{candidate.personalIdNumber}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="px-2 py-2 font-semibold text-gray-500">Pohlaví</td>
|
||||||
|
<td class="px-2 py-2">{candidate.sex ?? "NEUVEDENO"}</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="max-w-sm">
|
<div class="max-w-sm">
|
||||||
<div class="rounded-lg bg-white p-10 shadow-xl">
|
{#each parents as parent}
|
||||||
<div class="p-2">
|
<div class="rounded-lg bg-white p-10 shadow-xl">
|
||||||
<h3 class="text-sspsBlue text-center text-2xl font-medium font-semibold leading-8">
|
<div class="p-2">
|
||||||
{candidate.parentName + ' ' + candidate.parentSurname}
|
<h3 class="text-sspsBlue text-center text-2xl font-medium font-semibold leading-8">
|
||||||
</h3>
|
{parent.name + ' ' + parent.surname}
|
||||||
<table class="my-3 text-xs">
|
</h3>
|
||||||
<tbody
|
<table class="my-3 text-xs">
|
||||||
><tr>
|
<tbody
|
||||||
<td class="px-2 py-2 font-semibold text-gray-500">Telefon</td>
|
><tr>
|
||||||
<td class="px-2 py-2">{candidate.parentTelephone}</td>
|
<td class="px-2 py-2 font-semibold text-gray-500">Telefon</td>
|
||||||
</tr>
|
<td class="px-2 py-2">{parent.telephone}</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="px-2 py-2 font-semibold text-gray-500">E-mail</td>
|
<tr>
|
||||||
<td class="px-2 py-2">{candidate.parentEmail}</td>
|
<td class="px-2 py-2 font-semibold text-gray-500">E-mail</td>
|
||||||
</tr>
|
<td class="px-2 py-2">{parent.email}</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/each}
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ export const load: PageServerLoad = async ({ fetch, params }) => {
|
||||||
const { code } = params;
|
const { code } = params;
|
||||||
const codeNumber = Number(code);
|
const codeNumber = Number(code);
|
||||||
|
|
||||||
let candidateData: CandidateData = {};
|
let candidateData: CandidateData = {
|
||||||
|
candidate: {},
|
||||||
|
parents: []
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
candidateData = await apiFetchCandidate(codeNumber, fetch);
|
candidateData = await apiFetchCandidate(codeNumber, fetch);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -15,6 +18,6 @@ export const load: PageServerLoad = async ({ fetch, params }) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: codeNumber,
|
id: codeNumber,
|
||||||
candidate: candidateData
|
candidateData: candidateData
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<CandidateDetails id={data.id} candidate={data.candidate} />
|
<CandidateDetails id={data.id} candidateData={data.candidateData} />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue