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