Add new exam event, Add support positions
This commit is contained in:
parent
c1711883fc
commit
27b595206f
5 changed files with 48 additions and 15 deletions
|
|
@ -13,23 +13,33 @@ export const load: PageServerLoad = async ({fetch}) => {
|
|||
const events:CalendarEvent[]=[]
|
||||
|
||||
exams.forEach((ex)=>{
|
||||
const {id,title,start,end,category} = ex
|
||||
if(!category)
|
||||
return
|
||||
const backgroundColor = getBgColorDict(category,catColor)
|
||||
|
||||
const {id,category,start} = ex
|
||||
const backgroundColor = category? getBgColorDict(category,catColor):"n/a"
|
||||
const url = "/qualifying/"+id
|
||||
if(start){
|
||||
ex.date = dayjs(start).format("DD MMM BBBB")
|
||||
events.push({id,title,start,end,url,backgroundColor})
|
||||
}
|
||||
if(!ex.announcementExam)
|
||||
return
|
||||
if(ex.exam_date){
|
||||
events.push({id,"title":"วันสอบคัดเลือก","start":ex.exam_date,url,backgroundColor})
|
||||
const start = ex.exam_date
|
||||
events.push({id,"title":"วันสอบคัดเลือก",start,url,backgroundColor})
|
||||
}
|
||||
if(ex.announcement_date){
|
||||
events.push({id,"title":"ผลสอบคัดเลือก","start":ex.announcement_date,url,backgroundColor})
|
||||
const start = ex.announcement_date
|
||||
const end = ex.announcement_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
if(ex.register_startDate){
|
||||
const start = ex.register_startDate
|
||||
const end = ex.register_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
if(ex.payment_startDate){
|
||||
const start = ex.payment_startDate
|
||||
const end = ex.payment_endDate
|
||||
events.push({id,"title":"ผลสอบคัดเลือก",start,end,url,backgroundColor})
|
||||
}
|
||||
|
||||
})
|
||||
return {exams,events}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
import { env } from '$env/dynamic/public'
|
||||
const positions_base_url = env.PUBLIC_URL_REGISTER_QUALIFY_EXAM+"/exam/"
|
||||
</script>
|
||||
<section>
|
||||
<div class="p-one parallax-inner">
|
||||
|
|
@ -39,19 +41,19 @@
|
|||
<div><img src={i.url} alt={i.title}></div>
|
||||
{/each}
|
||||
{/if}
|
||||
{#if data.regi}
|
||||
<div class="{data.regi.length == 0 ? 'display-none': 'w-12/12 text-lg font-medium'}">สมัครสอบ</div>
|
||||
{#each data.regi as regi}
|
||||
{#if data.positions}
|
||||
<div class="w-12/12 text-lg font-medium">สมัครสอบ</div>
|
||||
{#each data.positions as p}
|
||||
<hr class="border-blueGray-200 my-2" />
|
||||
|
||||
<div class="text-lg py-1">
|
||||
<div class="flex flex-wrap items-center">
|
||||
<a class="btn btn-sm btn-outline btn-info cursor-pointe" href={regi.url} target="_blank">
|
||||
<a class="btn btn-sm btn-outline btn-info cursor-pointe" href={positions_base_url+p.path} target="_blank">
|
||||
<i class="fa-solid fa-pen-to-square text-sm pr-2"></i>
|
||||
สมัครสอบ
|
||||
</a>
|
||||
<div class="pl-4">
|
||||
<span>{regi.title}</span>
|
||||
<span>{p.title}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue