minhnt-dev: fix page template

This commit is contained in:
MoreStrive
2024-07-12 19:13:34 +07:00
parent 212e6d357c
commit dffbe39fa6
19 changed files with 413 additions and 265 deletions
+5 -2
View File
@@ -35,11 +35,13 @@ export {
pageTypes,
pageComponentTypes,
pageSectionTypes,
pageTaxonomy,
pageDataQuery,
pageDataType,
pageLayouts,
/* PAGE SETTINGS */
pageTaxonomy,
pageTemplates,
pageLayouts,
/* SECTION SETTINGS */
pageSectionTaxonomy,
@@ -50,6 +52,7 @@ export {
pageComponentTaxonomy,
pageComponentTemplates,
pageComponentLayouts,
} from "./page.type";
export { placementType } from "./placement.type";
export { pollType, pollParticipantType, pollOptionType, pollResultPublication } from "./poll.type";
+36 -52
View File
@@ -1,4 +1,4 @@
import { enumPageComponentLayouts, enumPageSectionLayouts, templates, enumPageComponentKey, enumPageComponentTemplate, enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
import { enumPageKey, enumPageTemplate, enumPageLayouts, enumPageComponentLayouts, enumPageSectionLayouts, enumPageComponentKey, enumPageComponentTemplate, enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
export const pageTypes = [
{ title: "None", value: 0 }, // Không xác định
@@ -24,49 +24,6 @@ export const pageTypes = [
];
// LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4
export const pageLayouts = (key: string) => {
if (key === templates.ARTICLE) {
return [
{ title: "None", key: 0, value: "ARTICLE_NONE" },
{ title: "Normal", key: 1, value: "ARTICLE_NORMAL" },
{ title: "Short", key: 2, value: "ARTICLE_SHORT" },
{ title: "Long", key: 3, value: "ARTICLE_LONG" },
{ title: "Page", key: 4, value: "ARTICLE_PAGE" },
];
} else {
return [
{ title: "None", value: 0 },
{ title: "Cơ bản", value: "Default" },
{ title: "Full Page", value: "Full_Page" }, // full with 100%
{ title: "Center Page", value: "Center_Page" }, // ở giữa
{ title: "Backgroud Page", value: "Backgroud_Page" }, // Phân trang
];
}
};
export const pageTemplates = [
{ title: "None", value: "None" }, // Không xác định
{ title: "Home", value: "Home" }, // Trang chủ
{ title: "Section", value: "Section" }, // Chuyên trang
{ title: "Category", value: "Category" }, // Trang danh mục
{ title: "Topic", value: "Topic" }, // Trang chủ đề
{ title: "Event", value: "Event" }, // Trang sự kiện
{ title: "Collection", value: "Collection" }, // Trang sưu tập
{ title: "Article", value: "Article" }, // Trang bài viết
{ title: "Tag", value: "Tag" }, // Trang từ khóa
{ title: "Author", value: "Author" }, // Trang tác giả
{ title: "Search", value: "Search" }, // Trang tìm kiếm
{ title: "Contact", value: "Contact" }, // Trang liên hệ
{ title: "About", value: "About" }, // Trang giới thiệu
{ title: "Service", value: "Service" }, // Trang dịch vụ
{ title: "Policy", value: "Policy" }, // Trang chính sách
{ title: "Terms", value: "Terms" }, // Trang điều khoản
{ title: "Privacy", value: "Privacy" }, // Trang bảo mật
{ title: "Error", value: "Error" }, // Trang lỗi
{ title: "Maintenance", value: "Maintenance" }, // Trang bảo trì
{ title: "Custom", value: "Custom" }, // Trang tùy chỉnh
];
export const pageComponentTypes = [
{ title: "None", value: 0 }, // Không xác định
{ title: "Individual", value: 1 }, // Đơn lẻ
@@ -103,6 +60,7 @@ export const pageDataQuery = [
{ title: "REQUEST", value: "REQUEST" },
];
/* PAGE SETTINGS */
export const pageTaxonomy = [
{ title: "Home", value: "Home" }, // Trang khác
{ title: "Section", value: "Section" }, // Chuyên trang
@@ -121,6 +79,31 @@ export const pageTaxonomy = [
{ title: "Navigation", value: "Navigation" }, // Navigation
];
export const pageTemplates = {
[enumPageKey.HOME]: [
{ title: "Trang chủ - Báo Tiền Phong", value: enumPageTemplate[enumPageKey.HOME]['DEFAULT'] },
{ title: "Trang chủ - Báo Kinh tế đô thị", value: enumPageTemplate[enumPageKey.HOME]['DEFAULT'] },
],
[enumPageKey.ARTICLE]: [
{ title: "Chi tiết bài viết", value: enumPageTemplate[enumPageKey.ARTICLE]['DETAIL'] },
],
};
export const pageLayouts = {
[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]: [
{ title: "Giới hạn chiều rộng", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['DEFAULT'] },
{ title: "Không giới hạn chiều rộng", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['FULL'] },
{ title: "Giới hạn chiều rộng có Quảng cáo", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['BACKGROUND_PAGE'] },
],
[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]: [
{ title: "Không có", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_NONE'] },
{ title: "Bài viết thường", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_NORMAL'] },
{ title: "Bài viết ngắn", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_SHORT'] },
{ title: "Bài viết dài", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_LONG'] },
{ title: "Bài viết toàn trang", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_PAGE'] },
],
};
/* SECTION SETTINGS */
export const pageSectionTaxonomy = [
{ title: "None", value: "None" }, // Phân vùng của Chuyên trang
@@ -244,13 +227,13 @@ export const pageComponentLayouts = {
{ title: "Thẻ bài viết Video Hightlight", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_CARD']}`]['CARD_VIDEO_HIGHLIGHT'] },
{ title: "Thẻ bài viết Hoa hậu Hightlight", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_CARD']}`]['CARD_MISS_HIGHLIGHT'] },
],
[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]: [
{ title: "Chi tiết bài viết", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_GENERAL'] },
{ title: "Chi tiết bài Podcast", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_PODCAST'] },
{ title: "Chi tiết bài Video", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_VIDEO'] },
{ title: "Chi tiết bài Image", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_IMAGE'] },
{ title: "Chi tiết bài eMagazine", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_EMAGAZINE'] },
{ title: "Chi tiết bài Inforgraphic", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']}`]['DETAIL_INFOGRAPHIC'] },
[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]: [
{ title: "Chi tiết bài viết", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_GENERAL'] },
{ title: "Chi tiết bài Podcast", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_PODCAST'] },
{ title: "Chi tiết bài Video", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_VIDEO'] },
{ title: "Chi tiết bài Image", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_IMAGE'] },
{ title: "Chi tiết bài eMagazine", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_EMAGAZINE'] },
{ title: "Chi tiết bài Inforgraphic", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_INFOGRAPHIC'] },
],
/* NAVIGATION */
[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]: [
@@ -267,6 +250,7 @@ export const pageComponentLayouts = {
[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['ARTICLE']}`]: [
{ title: "Thẻ bài viết cơ bản", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['ARTICLE']}`]['ARTICLE_COLLECTION_DEFAULT'] },
{ title: "Thẻ bài viết Audio", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['ARTICLE']}`]['ARTICLE_COLLECTION_AUDIO'] },
{ title: "Thẻ bài viết Video", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['ARTICLE']}`]['ARTICLE_COLLECTION_VIDEO'] },
],
[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['CATEGORY']}`]: [
{ title: "Hoa hậu - Cơ bản", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['CATEGORY']}`]['MISSES_COLLECTION_DEFAULT'] },
@@ -295,6 +279,6 @@ export const pageComponentLayouts = {
],
[`${enumPageComponentTemplate[enumPageComponentKey.OTHER]['STOCK']}`]: [
{ title: "Chứng khoán", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.OTHER]['STOCK']}`]['STOCK_DEFAULT'] },
{ title: "Chứng khoán Full Size", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.OTHER]['STOCK']}`]['STOCK_FULLSIZE'] }
{ title: "Chứng khoán Full Size", value: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.OTHER]['STOCK']}`]['STOCK_FULLSIZE'] }
],
};