clean code, organization -> title and add subtitle
This commit is contained in:
parent
3ef4e0c6eb
commit
16917a088f
11 changed files with 35 additions and 47 deletions
|
|
@ -5,7 +5,7 @@
|
|||
let calendarRef;
|
||||
export let events:CalendarEvent[]
|
||||
let options = {
|
||||
themeSystem: 'bootstrap5',
|
||||
// themeSystem: 'bootstrap5',
|
||||
initialView: 'dayGridMonth',
|
||||
plugins: [daygridPlugin],
|
||||
locale: 'th',
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
// make dynamic date to be added to footer
|
||||
let date = new Date().getFullYear();
|
||||
export let logo_url:string = "/images/logo.png"
|
||||
export let address:string ="173 ถนนดินสอ แขวงเสาชิงช้า เขตพระนคร กรุงเทพมหานคร 10200"
|
||||
export let organization:string = "กองสรรหาบุคคล yyy"
|
||||
export let address:string ="ใส่ที่อยู่ที่นี้"
|
||||
export let title:string = "ใส่องค์กรที่นี้"
|
||||
export let divisions:{title:string,url:string}[] =[]
|
||||
export let institutes:{title:string,url:string}[] =[]
|
||||
</script>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<img src="{logo_url}" alt="logo">
|
||||
</div>
|
||||
</div>
|
||||
<h5 class="text-2xl font-semibold">{organization}</h5>
|
||||
<h5 class="text-2xl font-semibold">{title}</h5>
|
||||
<h6 class="text-md mt-1 mb-2 text-blueGray-600">
|
||||
{address}
|
||||
</h6>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
export let logo_url:string = "/images/logo.png"
|
||||
export let organization:string = "กองสรรหาบุคคล yyy"
|
||||
export let supervised:string = "สำนักงาน ก.ก.xx"
|
||||
export let title:string = "ใส่ชื่อองค์กรที่นี้"
|
||||
export let supervised:string = "ใส่สังกัดที่นี้"
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="content-center grid pl-4">
|
||||
{organization}
|
||||
{title}
|
||||
<div class="textline2">{supervised}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -45,10 +45,6 @@
|
|||
<a href="/competitive" class="tab">การสอบแข่งขัน</a>
|
||||
<a href="/about" class="tab">เกี่ยวกับเรา</a>
|
||||
</div>
|
||||
<!-- <button class="btn btn-primary btn-outline">
|
||||
<i class="fa-solid fa-arrow-right-to-bracket"></i>
|
||||
<span class="pl-3">เข้าสู่ระบบ</span>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ export interface Exam {
|
|||
image?:string;
|
||||
images?:{title:string,url:string}[];
|
||||
files?:{title:string,url:string}[];
|
||||
|
||||
}
|
||||
export interface CalendarEvent {
|
||||
id:string;
|
||||
|
|
@ -24,9 +23,10 @@ export interface CalendarEvent {
|
|||
}
|
||||
export interface CMSInfo{
|
||||
logo_url:string;
|
||||
organization:string;
|
||||
supervised:Date|string;
|
||||
address:Date|string;
|
||||
title:string;
|
||||
subtitle:string;
|
||||
supervised:string;
|
||||
address:string;
|
||||
divisions:{title:string,url:string}[];
|
||||
institutes:{title:string,url:string}[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"logo_url":"/images/logo.png",
|
||||
"organization": "กองสรรหาบุคคล",
|
||||
"title": "กองสรรหาบุคคล",
|
||||
"subtitle": "Recruitment Division",
|
||||
"supervised":"สำนักงาน ก.ก.",
|
||||
"address": "173 ถนนดินสอ แขวงเสาชิงช้า เขตพระนคร กรุงเทพมหานคร 10200",
|
||||
"divisions": [
|
||||
|
|
|
|||
|
|
@ -3,12 +3,9 @@ import { error } from '@sveltejs/kit';
|
|||
import type { PageServerLoad } from './$types'
|
||||
export const load: PageServerLoad = async ({fetch}) => {
|
||||
const res = await fetch("/api/info")
|
||||
if(res.ok){
|
||||
const info = await res.json()
|
||||
return info
|
||||
}else{
|
||||
throw error(500, 'ไม่สามารถอ่านข้อมูลตั้งต้นของเวปได้');
|
||||
}
|
||||
|
||||
|
||||
if(!res.ok)
|
||||
throw error(500, 'ไม่สามารถอ่านข้อมูลตั้งต้นของเวปได้');
|
||||
|
||||
const info = await res.json()
|
||||
return info
|
||||
}
|
||||
|
|
@ -9,12 +9,12 @@
|
|||
dayjs.extend(buddhistEra)
|
||||
import type { LayoutData } from './$types';
|
||||
export let data: LayoutData;
|
||||
let {logo_url,supervised,divisions,institutes,address,organization} = data
|
||||
let {logo_url,supervised,divisions,institutes,address,title,subtitle} = data
|
||||
|
||||
</script>
|
||||
|
||||
<Header {logo_url} {organization} {supervised} />
|
||||
<Header {logo_url} {title} {supervised} />
|
||||
<div class="justify-center place-content-center" style="padding-top:50px">
|
||||
<slot />
|
||||
<slot/>
|
||||
</div>
|
||||
<Footer {logo_url} {organization} {address} {divisions} {institutes} />
|
||||
<Footer {logo_url} {title} {address} {divisions} {institutes} />
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
//import content from "$lib/data/content/home.html?raw"
|
||||
//import { getQualifyExams,getCompetitiveExams } from '$lib/data/info';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
import type {Exam} from '$lib/data/CMSDataType'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
|
||||
export const load: PageServerLoad = async ({fetch}) => {
|
||||
let qualify_exams: Exam[] = []
|
||||
let competitive_exams: Exam[] = []
|
||||
let content = ""
|
||||
let image = undefined
|
||||
let res = await fetch("/api/content?page=home")
|
||||
let res = await fetch("/api/info")
|
||||
if(!res.ok)
|
||||
throw error(500, 'ไม่สามารถอ่านข้อมูลตั้งต้นของหน้าหลักได้');
|
||||
const {title,subtitle} = await res.json()
|
||||
res = await fetch("/api/content?page=home")
|
||||
if(res.ok){
|
||||
const r = await res.json()
|
||||
content = r.content
|
||||
|
|
@ -31,5 +36,5 @@ export const load: PageServerLoad = async ({fetch}) => {
|
|||
e.date = e.start? dayjs(e.start).format("DD MMM BBBB"):""
|
||||
})
|
||||
}
|
||||
return { content,image, qualify_exams,competitive_exams };
|
||||
return {title,subtitle,content,image, qualify_exams,competitive_exams };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
export let data: PageData;
|
||||
const {qualify_exams,competitive_exams,image} = data
|
||||
const {qualify_exams,competitive_exams,image,title,subtitle} = data
|
||||
|
||||
</script>
|
||||
<section class="reative flex bg-gradient pt-10 pb-44 md:pb-38">
|
||||
<div class="container mx-auto items-start flex flex-wrap">
|
||||
<div class="w-full md:w-6/12 lg:w-6/12 xl:w-6/12 px-6">
|
||||
<div class="pt-16 sm:pt-18">
|
||||
<h2 class="font-semibold text-3xl text-blueGray-600">
|
||||
กองสรรหาบุคคล
|
||||
{title}
|
||||
</h2>
|
||||
<h2 class="pt-1 text-2xl text-red-400">
|
||||
Recruitment Division
|
||||
{subtitle}
|
||||
</h2>
|
||||
<p class="mt-4 text-lg leading-relaxed text-blueGray-500">
|
||||
{@html data.content}
|
||||
|
|
|
|||
|
|
@ -34,12 +34,6 @@
|
|||
<div class="">
|
||||
{@html data.detail}
|
||||
</div>
|
||||
{#if data.docUrl}
|
||||
<hr class="border-blueGray-200 mb-4 mt-7" />
|
||||
<div class="text-lg py-1">
|
||||
<i class="fa-solid fa-bookmark mr-3 text-xs text-blue-400"></i><a href={data.docUrl} class="text-blue-400 hover:text-blue-600" target="_blank">คลิกที่นี่เพื่ออ่าน </a><span class="font-medium">เอกสารประกอบ</span>
|
||||
</div>
|
||||
{/if}
|
||||
{#if data.files}
|
||||
{#each data.files as file}
|
||||
<hr class="border-blueGray-200 mb-4 mt-4" />
|
||||
|
|
|
|||
|
|
@ -34,12 +34,6 @@
|
|||
<div class="">
|
||||
{@html data.detail}
|
||||
</div>
|
||||
{#if data.docUrl}
|
||||
<hr class="border-blueGray-200 my-4" />
|
||||
<div class="text-lg py-1">
|
||||
<i class="fa-solid fa-bookmark mr-3 text-xs text-blue-400"></i><a href={data.docUrl} class="text-blue-400 hover:text-blue-600" target="_blank">คลิกที่นี่เพื่ออ่าน </a><span class="font-medium">เอกสารประกอบ</span>
|
||||
</div>
|
||||
{/if}
|
||||
{#if data.files}
|
||||
{#each data.files as file}
|
||||
<hr class="border-blueGray-200 mb-4 mt-4" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue