Update and clean code
This commit is contained in:
parent
3edde43c25
commit
1c9b5877d6
29 changed files with 1179 additions and 838 deletions
31
cms/src/lib/components/ActivityCalendar.svelte
Normal file
31
cms/src/lib/components/ActivityCalendar.svelte
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<script lang="ts">
|
||||
import FullCalendar from '$lib/components/FullCalendar.svelte';
|
||||
import daygridPlugin from '@fullcalendar/daygrid';
|
||||
// import timegridPlugin from '@fullcalendar/timegrid';
|
||||
// import interactionPlugin from '@fullcalendar/interaction';
|
||||
let calendarRef;
|
||||
export let events
|
||||
export let options = {
|
||||
initialView: 'dayGridMonth',
|
||||
plugins: [daygridPlugin],
|
||||
locale: 'th',
|
||||
headerToolbar: {
|
||||
start: 'prev,next',
|
||||
center: 'title'
|
||||
},
|
||||
contentHeight:"auto",
|
||||
selectable: true,
|
||||
buttonText: {
|
||||
month: 'เดือน',
|
||||
agendaDay: 'วัน',
|
||||
agendaWeek: 'สัปดาห์',
|
||||
today: 'วันนี้'
|
||||
},
|
||||
events,
|
||||
dateClick: clickDate,
|
||||
};
|
||||
function clickDate(info: { dateStr: string; }){
|
||||
alert('a day has been clicked!'+info.dateStr);
|
||||
}
|
||||
</script>
|
||||
<FullCalendar bind:this={calendarRef} {options} />
|
||||
55
cms/src/lib/components/FullCalendar.svelte
Normal file
55
cms/src/lib/components/FullCalendar.svelte
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
import type { CalendarOptions } from '@fullcalendar/core';
|
||||
|
||||
let classes: string | null = null;
|
||||
|
||||
export { classes as class };
|
||||
|
||||
export let style: string | null = null;
|
||||
|
||||
export let options: CalendarOptions;
|
||||
|
||||
export function getAPI() {
|
||||
return calendar;
|
||||
}
|
||||
|
||||
let calendarEl: HTMLElement;
|
||||
let calendar: Calendar;
|
||||
|
||||
onMount(async () => {
|
||||
if (!canBeInitiated) return;
|
||||
|
||||
initCalendar();
|
||||
|
||||
return () => {
|
||||
calendar && calendar.destroy();
|
||||
};
|
||||
});
|
||||
|
||||
$: canBeInitiated =
|
||||
options && options.plugins && options.plugins.length && calendarEl && !calendar;
|
||||
|
||||
$: {
|
||||
if (calendar && options && options.plugins && options.plugins.length) updateCalendarOptions();
|
||||
|
||||
if (canBeInitiated) {
|
||||
initCalendar();
|
||||
}
|
||||
}
|
||||
|
||||
function initCalendar() {
|
||||
calendar = new Calendar(calendarEl, options);
|
||||
calendar.render();
|
||||
}
|
||||
|
||||
function updateCalendarOptions() {
|
||||
calendar.pauseRendering();
|
||||
calendar.resetOptions(options);
|
||||
calendar.resumeRendering();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div bind:this={calendarEl} class={classes} {style} />
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
<li><a href="/about">เกี่ยวกับเรา</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a class="btn btn-ghost normal-case text-xl"
|
||||
<a
|
||||
href="https://webportal.bangkok.go.th/KSB/page/top/1119/%E0%B8%81%E0%B8%AD%E0%B8%87%E0%B8%AA%E0%B8%A3%E0%B8%A3%E0%B8%AB%E0%B8%B2%E0%B8%9A%E0%B8%B8%E0%B8%84%E0%B8%84%E0%B8%A5">
|
||||
กองสรรหา
|
||||
<img src="images/logo.jpg" alt="logo">
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-center hidden lg:flex">
|
||||
|
|
@ -28,6 +28,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<a class="btn" href="/">เข้าสู่ระบบ</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
18
cms/src/lib/data/about.md
Normal file
18
cms/src/lib/data/about.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# กองสรรหาบุคคล
|
||||
## (Recruitment Division)
|
||||
มีหน้าที่รับผิดชอบเกี่ยวกับการสรรหาและเลือกสรร บุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ และข้าราชการครูกรุงเทพมหานครเฉพาะสังกัดสำนักพัฒนาชุมชน การดำเนินการเกี่ยวกับทุน จากแหล่งทุนภายนอกการดำเนินการเกี่ยวกับมาตรฐานคุณสมบัติบุคคและปฎิบัติหน้าที่อื่นที่เกี่ยวข้อง โดยแบ่งงานภายในส่วนราชการดังนี้
|
||||
|
||||
## กลุ่มงานวิชาการการสอบ
|
||||
ศึกษาวิจัย ข้อสอบเทคนิกการวัดผมและประมวลผล สร้างและพัฒนาระบบคังข้อสอบรวมถึงจัดทำฐานข้อมูลด้วยระบบอีเล็กทรอนิก
|
||||
|
||||
## กลุ่มงานดำเนินการสรรหา 1
|
||||
ดำเนินการสอบและสรรหาบุคคลเข้ารับราชการครูและบุคคลากรทางการศึกษา ออกหนังสือรับรองผล จัดทำและปรับปรุงหลักเกณท์วิธีการสอบและการคัดเลือก
|
||||
|
||||
|
||||
## กลุ่มงานดำเนินการสรรหา 2
|
||||
ดำเนินการสอบและสรรหาบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ รวมถึงดำเนินการสอบวัดควสามรู้ความสามารถเฉพาะตำแหน่ง
|
||||
จัดทำ และปรับปรุงหลักเกณท์วิธีการสอบและการคัดเลือก พิจจารณาการให้ทุนจากภัยนอกแก่ข้าราชการกรุงเทพมหานคร
|
||||
|
||||
ฝ่ายบริหารงานทั่วไป
|
||||
งานด้านสารบรรณ ธุรการทั่วไป การจัดประชุม ควบคุมดูแลสถานที่และยานพาหนะ การเงิน บัญชี งบประมาณบัญชี งบประมาณบัญชีและพัสดุ
|
||||
จัดทำรายงาน และประเมินผลแผนปฎิบัติราชการประจำปี
|
||||
4
cms/src/lib/data/activities_events.json
Normal file
4
cms/src/lib/data/activities_events.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
{ "id": "1","title": "ทำความสะอาด", "start": "2023-03-02T13:00:00" },
|
||||
{ "id": "2", "start": "2023-03-08T13:00:00", "end": "2023-03-10T12:00:00", "title": "ค่ายรักการอ่าน" }
|
||||
]
|
||||
7
cms/src/lib/data/competitive-exam.json
Normal file
7
cms/src/lib/data/competitive-exam.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[
|
||||
{"id":20,"date":"2023/03/25","detail":"การสอบแข่งขันเพื่อรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 5/2566","institute":"สำนักอนามัย","time":"๕/๒๕๖๖"},
|
||||
{"id":19,"date":"2023/03/23","detail":"การสอบแข่งขันเพื่อรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 4/2566","institute":"สำนักการแพทย์","time":"๔/๒๕๖๖"},
|
||||
{"id":18,"date":"2023/03/20","detail":"การสอบแข่งขันเพื่อรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 3/2566","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๓/๒๕๖๖"},
|
||||
{"id":17,"date":"2023/03/20","detail":"การสอบแข่งขันเพื่อรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 2/2566","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๒/๒๕๖๖"},
|
||||
{"id":16,"date":"2023/03/20","detail":"การสอบแข่งขันเพื่อรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 1/2565","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๑/๒๕๖๖"}
|
||||
]
|
||||
17
cms/src/lib/data/home.md
Normal file
17
cms/src/lib/data/home.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
มีหน้าที่รับผิดชอบเกี่ยวกับการสรรหาและเลือกสรร บุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ และข้าราชการครูกรุงเทพมหานครเฉพาะสังกัดสำนักพัฒนาชุมชน การดำเนินการเกี่ยวกับทุน จากแหล่งทุนภายนอกการดำเนินการเกี่ยวกับมาตรฐานคุณสมบัติบุคคและปฎิบัติหน้าที่อื่นที่เกี่ยวข้อง โดยแบ่งงานภายในส่วนราชการดังนี้
|
||||
|
||||
## กลุ่มงานวิชาการการสอบ
|
||||
ศึกษาวิจัย ข้อสอบเทคนิกการวัดผมและประมวลผล สร้างและพัฒนาระบบคังข้อสอบรวมถึงจัดทำฐานข้อมูลด้วยระบบอีเล็กทรอนิก
|
||||
|
||||
## กลุ่มงานดำเนินการสรรหา 1
|
||||
ดำเนินการสอบและสรรหาบุคคลเข้ารับราชการครูและบุคคลากรทางการศึกษา ออกหนังสือรับรองผล จัดทำและปรับปรุงหลักเกณท์วิธีการสอบและการคัดเลือก
|
||||
|
||||
## กลุ่มงานดำเนินการสรรหา 2
|
||||
ดำเนินการสอบและสรรหาบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ รวมถึงดำเนินการสอบวัดควสามรู้ความสามารถเฉพาะตำแหน่ง
|
||||
จัดทำ และปรับปรุงหลักเกณท์วิธีการสอบและการคัดเลือก พิจจารณาการให้ทุนจากภัยนอกแก่ข้าราชการกรุงเทพมหานคร
|
||||
|
||||
|
||||
## ฝ่ายบริหารงานทั่วไป
|
||||
งานด้านสารบรรณ ธุรการทั่วไป การจัดประชุม ควบคุมดูแลสถานที่และยานพาหนะ การเงิน บัญชี งบประมาณบัญชี งบประมาณบัญชีและพัสดุ
|
||||
จัดทำรายงาน และประเมินผลแผนปฎิบัติราชการประจำปี
|
||||
|
|
@ -1,4 +1,24 @@
|
|||
import aboutDetail from "$lib/data/about.md?raw"
|
||||
import { marked } from 'marked'
|
||||
import info from "./info.json"
|
||||
export async function getContact(){
|
||||
return info.contact
|
||||
export async function getAbout(){
|
||||
const contact = info.contact
|
||||
const detail = marked.parse(aboutDetail)
|
||||
return {contact,detail}
|
||||
}
|
||||
|
||||
import qualify_exams from "./qualify-exam.json"
|
||||
export async function getQualifyExams(limit=0){
|
||||
if(qualify_exams.length>limit && limit>0)
|
||||
return qualify_exams.slice(0,limit)
|
||||
return qualify_exams
|
||||
}
|
||||
|
||||
|
||||
import competitive_exam from "./competitive-exam.json"
|
||||
export async function getCompetitiveExams(limit=0){
|
||||
if(competitive_exam.length>limit && limit>0)
|
||||
return competitive_exam.slice(0,limit)
|
||||
return competitive_exam
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
[
|
||||
{"id":20,"date":"2023/03/25","detail":"ประกาศรับสมัครสอบและคัดเลือกบุคคลเข้ารับราชการเป็นลูกจ้างชั่วคราว","institute":"สำนักอนามัย","time":"๕/๒๕๖๕"},
|
||||
{"id":19,"date":"2023/03/23","detail":"ประกาศรายชื่อผู้มีสิทธิเข้ารับการสอบคัดเลือกบุคคลภายนอกช่วยปฎิบัติราชการ","institute":"สำนักการแพทย์","time":"๔/๒๕๖๔"},
|
||||
{"id":18,"date":"2023/03/20","detail":"ประกาศกรุงเทพมหานคร เรื่อง ประกาศผู้ชนะการเสนอราคา จ้างเหมาซ่อมแซมป้ายชื่อ","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๔/๒๕๖๓"}
|
||||
{"id":20,"date":"2023/03/25",
|
||||
"title":"ลูกจ้างและผู้ปฎิบัติงานในกรุงเทพมหานคร เป็นข้าราชการกรุงเทพมหานคร",
|
||||
"detail":"ลูกจ้างและผู้ปฎิบัติงานในกรุงเทพมหานคร เป็นข้าราชการกรุงเทพมหานคร",
|
||||
"institute":"สำนักอนามัย",
|
||||
"time":"1/2565",
|
||||
"docurl":"https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%81%E0%B8%B2%E0%B8%A8%E0%B8%84%E0%B8%B1%E0%B8%94%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B8%87.pdf"
|
||||
},
|
||||
{"id":20,"date":"2023/03/25",
|
||||
"title":"ด่วน !! ประกาศวัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"detail":"ประกาศรับสมัครสอบและคัดเลือกบุคคลเข้ารับราชการเป็นลูกจ้างชั่วคราว",
|
||||
"institute":"สำนักอนามัย",
|
||||
"time":"๕/๒๕๖๖",
|
||||
"docUrl":"https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%81%E0%B8%B2%E0%B8%A8%E0%B8%A7%E0%B8%B1%E0%B8%99%20%E0%B9%80%E0%B8%A7%E0%B8%A5%E0%B8%B2%20%E0%B8%AA%E0%B8%96%E0%B8%B2%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%84%E0%B8%B1%E0%B8%94%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%AF.pdf"
|
||||
},
|
||||
{"id":19,"date":"2023/03/23","detail":"ประกาศรายชื่อผู้มีสิทธิเข้ารับการสอบคัดเลือกบุคคลภายนอกช่วยปฎิบัติราชการ","institute":"สำนักการแพทย์","time":"๔/๒๕๖๖"},
|
||||
{"id":18,"date":"2023/03/20","detail":"ประกาศกรุงเทพมหานคร เรื่อง ประกาศผู้ชนะการเสนอราคา จ้างเหมาซ่อมแซมป้ายชื่อ","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๓/๒๕๖๖"},
|
||||
{"id":17,"date":"2023/03/20","detail":"ประกาศกรุงเทพมหานคร เรื่อง ประกาศผู้ชนะการเสนอราคา จ้างเหมาซ่อมแซมป้ายชื่อ","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๒/๒๕๖๖"},
|
||||
{"id":16,"date":"2023/03/20","detail":"ประกาศกรุงเทพมหานคร เรื่อง ประกาศผู้ชนะการเสนอราคา จ้างเหมาซ่อมแซมป้ายชื่อ","institute":"สำนักวัฒนธรรม กีฬาและการท่องเที่ยว","time":"๑/๒๕๖๖"}
|
||||
]
|
||||
|
|
@ -4,8 +4,6 @@
|
|||
</script>
|
||||
|
||||
<Header />
|
||||
<div class="p-5 max-w-4xl place-content-center ">
|
||||
<div>
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<slot />
|
||||
|
||||
|
|
|
|||
11
cms/src/routes/+page.server.ts
Normal file
11
cms/src/routes/+page.server.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import homeContent from "$lib/data/home.md?raw"
|
||||
import { marked } from 'marked'
|
||||
const detail = marked.parse(homeContent) //(await compile(homeContent))?.code;
|
||||
import { getQualifyExams,getCompetitiveExams } from '$lib/data/info';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const qualify_exams = await getQualifyExams(3);
|
||||
const competitive_exams = await getCompetitiveExams(3);
|
||||
return { detail , qualify_exams,competitive_exams };
|
||||
};
|
||||
|
|
@ -1,12 +1,109 @@
|
|||
<h1 class="text-4xl">กองสรรหาบุคคล (Recruitment Division)</h1>
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการคัดเลือกบุคลากรกทม</h2>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการสอบแข่งขัน</h2>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
version 0.2.0
|
||||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
export let data: PageData;
|
||||
//import events from "$lib/data/activities_events.json"
|
||||
const qualify_exams = data.qualify_exams;
|
||||
const competitive_exams = data.competitive_exams;
|
||||
const detail = data.detail;
|
||||
import FullCalendar from '$lib/components/FullCalendar.svelte';
|
||||
import daygridPlugin from '@fullcalendar/daygrid';
|
||||
//import timegridPlugin from '@fullcalendar/timegrid';
|
||||
import interactionPlugin from '@fullcalendar/interaction';
|
||||
import type { EventClickArg } from '@fullcalendar/core';
|
||||
let calendarRef;
|
||||
function clickDate(info: { dateStr: string; }){
|
||||
alert('a day has been clicked!'+info.dateStr);
|
||||
}
|
||||
function clickEvent(info:EventClickArg){
|
||||
alert(
|
||||
'Event: ' + info.event.title +
|
||||
'\nID: ' + info.event.id +
|
||||
'\nCoordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY +
|
||||
'\nView: ' + info.view.type
|
||||
);
|
||||
|
||||
// change the border color just for fun
|
||||
info.el.style.borderColor = 'red';
|
||||
|
||||
}
|
||||
let options = {
|
||||
initialView: 'dayGridMonth',
|
||||
plugins: [daygridPlugin,interactionPlugin],
|
||||
locale: 'th',
|
||||
headerToolbar: {
|
||||
start: 'prev,next',
|
||||
center: 'title'
|
||||
},
|
||||
contentHeight:"auto",
|
||||
selectable: true,
|
||||
buttonText: {
|
||||
month: 'เดือน',
|
||||
agendaDay: 'วัน',
|
||||
agendaWeek: 'สัปดาห์',
|
||||
today: 'วันนี้'
|
||||
},
|
||||
events:[
|
||||
{ "id": "1","title": "ทำความสะอาด", "start": new Date() },
|
||||
{ "id": "2","title": "กิจกรรมบางอย่าง", "start": "2023-03-28" },
|
||||
{ "id": "3", "start": "2023-03-08T13:00:00", "end": "2023-03-10T12:00:00", "title": "ค่ายรักการอ่าน" }
|
||||
],
|
||||
dateClick: clickDate,
|
||||
eventClick: clickEvent,
|
||||
};
|
||||
|
||||
</script>
|
||||
<h1 class="p-5 text-center text-orange-800">กองสรรหาบุคคล</h1>
|
||||
|
||||
<div class="w-full flex flex-col space-y-4 md:flex-row md:space-x-4 md:space-y-0" >
|
||||
<div class="md:w-2/5 lg:w-2/5 px-3">
|
||||
<FullCalendar bind:this={calendarRef} {options} />
|
||||
</div>
|
||||
<di class="md:w-3/5 lg:w-3/5 px-3">
|
||||
{@html detail}
|
||||
</di>
|
||||
</div>
|
||||
<div class="p-5">
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการคัดเลือก</h2>
|
||||
<table class="table table-compact w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>วันที่</th>
|
||||
<th>การสอบ</th>
|
||||
<th>หน่วยงาน</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each qualify_exams as exam}
|
||||
<tr>
|
||||
<th><a href={'/qualify_exams/' + exam.id}>{exam.date}</a></th>
|
||||
<td>{exam.detail}</td>
|
||||
<td>{exam.institute}</td>
|
||||
</tr>{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-5">
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการสอบแข่งขัน</h2>
|
||||
<table class="table table-compact w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>วันที่</th>
|
||||
<th>การสอบ</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each competitive_exams as exam}
|
||||
<tr>
|
||||
<th><a href={'/competitive_exams/' + exam.id}>{exam.date}</a></th>
|
||||
<td>{exam.detail}</td>
|
||||
</tr>{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
้
|
||||
<div class="px-5">
|
||||
<h2>Full Size Calendar</h2>
|
||||
<FullCalendar bind:this={calendarRef} {options} />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
|
||||
import {getContact} from "$lib/data/info"
|
||||
import type { PageServerLoad } from './$types'
|
||||
/*
|
||||
export const load: PageServerLoad = async () => {
|
||||
return getContact()
|
||||
}*/
|
||||
|
||||
export const load = (async () => {
|
||||
return await getContact()
|
||||
}) satisfies PageServerLoad
|
||||
import { getAbout } from '$lib/data/info';
|
||||
import type { PageServerLoad } from './$types';
|
||||
export const load = (async () => {
|
||||
const about = await getAbout();
|
||||
return about;
|
||||
}) satisfies PageServerLoad;
|
||||
|
|
|
|||
|
|
@ -1,54 +1,20 @@
|
|||
<script lang="ts">
|
||||
import 'dayjs/locale/th.js';
|
||||
import 'dayjs/locale/zh-cn.js';
|
||||
import 'dayjs/locale/es.js';
|
||||
import 'dayjs/locale/ar-dz.js';
|
||||
// มันรองรับ พ.ศ. ใน dayjs แต่ใน velte-calendar ไม่ได้เอาไปใช้ ยังหาวิธีแก้หัวปฎิทินไม่ได้ยังเป็น พ.ศ.
|
||||
import buddhistEra from 'dayjs/plugin/buddhistEra'
|
||||
import dayjs from 'dayjs';
|
||||
dayjs.extend(buddhistEra)
|
||||
import { InlineCalendar, Swappable, themes } from 'svelte-calendar';
|
||||
import { onDestroy } from 'svelte';
|
||||
const locales = ['th','en', 'es', 'zh-cn', 'ar-dz'];
|
||||
$: dayjs.locale(locale);
|
||||
onDestroy(() => dayjs.locale('en'));
|
||||
|
||||
import Calendar2 from '$lib/components/Calendar2/Calendar.svelte';
|
||||
import Calendar from '$lib/components/Calendar/Calendar.svelte';
|
||||
const today = new Date
|
||||
const locale = "th"
|
||||
const buddhist = true //buddhist calendar + 543
|
||||
let year = today.getFullYear()
|
||||
let month = today.getMonth()
|
||||
|
||||
import ver from "$lib/ver.json"
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
|
||||
</script>
|
||||
<h1 class="text-4xl">เกี่ยวกับ {data.company_name}</h1>
|
||||
<div>{data.description}</div>
|
||||
<div class="p-5 max-w-4xl place-content-center ">
|
||||
{@html data.detail}
|
||||
</div>
|
||||
|
||||
|
||||
<div>{data.contact.description}</div>
|
||||
<div>{ver.version}</div>
|
||||
<div>{ver.builddate}</div>
|
||||
|
||||
<h2 class="text-2xl">svelte-calendar</h2>
|
||||
<p>3rd svelte-calendar ไม่รองรับ พ.ศ.</p>
|
||||
<!-- note: Locale is not reactive -->
|
||||
<Swappable value={{ locale }} vertical={false} >
|
||||
<InlineCalendar theme={themes.light} />
|
||||
</Swappable>
|
||||
|
||||
<h2 class="text-2xl">Custom Calendar1</h2>
|
||||
<div>
|
||||
Calendar ทำเองยังไม่รองรับการแสดง event ในวัน
|
||||
</div>
|
||||
<Calendar {year} {month} {locale} {buddhist}/>
|
||||
|
||||
<h2 class="text-2xl">Custom Calendar2</h2>
|
||||
<div>
|
||||
ทำเองรองรับการแสดง event และคลิ้กได้ ได้แต่ยังปรับโค้ดไม่เรียบร้อย
|
||||
</div>
|
||||
<Calendar2 {locale} {buddhist} />
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
8
cms/src/routes/competitive/+page.server.ts
Normal file
8
cms/src/routes/competitive/+page.server.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
import {getCompetitiveExams} from "$lib/data/info"
|
||||
import type { PageServerLoad } from './$types'
|
||||
export const load: PageServerLoad = async () => {
|
||||
const exams = await getCompetitiveExams()
|
||||
return {exams}
|
||||
}
|
||||
|
||||
|
|
@ -1,35 +1,28 @@
|
|||
<script lang="ts">
|
||||
import 'dayjs/locale/th.js';
|
||||
import 'dayjs/locale/zh-cn.js';
|
||||
import 'dayjs/locale/es.js';
|
||||
import 'dayjs/locale/ar-dz.js';
|
||||
// มันรองรับ พ.ศ. ใน dayjs แต่ใน velte-calendar ไม่ได้เอาไปใช้ ยังหาวิธีแก้หัวปฎิทินไม่ได้ยังเป็น พ.ศ.
|
||||
import buddhistEra from 'dayjs/plugin/buddhistEra'
|
||||
import dayjs from 'dayjs';
|
||||
dayjs.extend(buddhistEra)
|
||||
import { InlineCalendar, Swappable, themes } from 'svelte-calendar';
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
const locales = ['th','en', 'es', 'zh-cn', 'ar-dz'];
|
||||
let format = 'DD/MM/BBBB'
|
||||
let locale = 'th';
|
||||
|
||||
$: dayjs.locale(locale);
|
||||
|
||||
onDestroy(() => dayjs.locale('en'));
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
const exams = data.exams
|
||||
</script>
|
||||
|
||||
|
||||
<h1 class="text-4xl">การสอบแข่งขัน</h1>
|
||||
<!-- note: Locale is not reactive -->
|
||||
<Swappable value={{ locale }} vertical={false} >
|
||||
<InlineCalendar theme={themes.light} {format} />
|
||||
</Swappable>
|
||||
<h1 class="p-5">การสอบแข่งขัน</h1>
|
||||
|
||||
<div class="button-group">
|
||||
{#each locales as loc}
|
||||
<button on:click={() => (locale = loc)} class:selected={locale === loc}>
|
||||
{loc}
|
||||
</button> |
|
||||
{/each}
|
||||
<div class="p-5">
|
||||
<table class="table table-compact w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>วันที่</th>
|
||||
<th>การสอบ</th>
|
||||
<th>หน่วยงาน</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each exams as exam}
|
||||
<tr>
|
||||
<th><a href={"/exams/"+exam.id}>{exam.date}</a></th>
|
||||
<td>{exam.detail}</td>
|
||||
<td>{exam.institute}</td>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
import {getExams} from "$lib/data/qualify-exam"
|
||||
import {getQualifyExams} from "$lib/data/info"
|
||||
import type { PageServerLoad } from './$types'
|
||||
export const load: PageServerLoad = async () => {
|
||||
const exams = await getExams()
|
||||
const exams = await getQualifyExams()
|
||||
return {exams}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
const exams = data.exams
|
||||
</script>
|
||||
|
||||
<h1 class="text-4xl">การสอบคัดเลือก</h1>
|
||||
<h1 class="p-5">การสอบคัดเลือก</h1>
|
||||
|
||||
้<h1 class="text-2xl">รายการสอบ</h1>
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<div class="p-5">
|
||||
้<h2>รายการสอบ</h2>
|
||||
<table class="table table-compact w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -25,4 +26,4 @@
|
|||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue