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
+152 -57
View File
@@ -1,33 +1,3 @@
export const templates = {
NONE: "None", // Không xác định
HOME: "Home", // Trang chủ
SECTION: "Section", // Chuyên trang
CATEGORY: "Category", // Trang danh mục
TOPIC: "Topic", // Trang chủ đề
EVENT: "Event", // Trang sự kiện
COLLECTION: "Collection", // Trang sưu tập
ARTICLE: "Article", // Trang bài viết
TAG: "Tag", // Trang từ khóa
AUTHOR: "Author", // Trang tác giả
SEARCH: "Search", // Trang tìm kiếm
CONTACT: "Contact", // Trang liên hệ
ABOUT: "About", // Trang giới thiệu
SERVICE: "Service", // Trang dịch vụ
POLICY: "Policy", // Trang chính sách
TERMS: "Terms", // Trang điều khoản
PRIVACY: "Privacy", // Trang bảo mật
ERROR: "Error", // Trang lỗi
MAINTENANCE: "Maintenance", // Trang bảo trì
CUSTOM: "Custom", // Trang tùy chỉnh
};
export const layouts = {
NONE: "None", // Không xác định
FULL_PAGE: "Full_Page", // full width 100%
CENTER_PAGE: "Center_Page", // ở giữa
BACKGROUND_PAGE: "Background_Page", // Phân trang
};
export const dataTypes = {
SECTION: "Section",
CATEGORY: "Category",
@@ -86,34 +56,26 @@ export const enumPageType = {
CUSTOM: 99, // Trang tùy chỉnh
};
export const enumPageComponentTemplates = { // KHÔNG ĐƯỢC XÓA KEY - BIẾN này
NONE: "None", // Không xác định
SECTION: "Section", // Chuyên trang
CATEGORY: "Category", // Trang danh mục
TOPIC: "Topic", // Trang chủ đề
EVENT: "Event", // Trang sự kiện
COLLECTION: "Collection", // Trang sưu tập
ARTICLE: "Article", // Trang bài viết
TAG: "Tag", // Trang từ khóa
AUTHOR: "Author", // Trang tác giả
POLL: "Poll", // Trang poll
QUIZ: "Quiz", // Trang quiz
SURVEY: "Survey", // Trang survey
ADVERTISING: "Advertising", // Trang quảng cáo
OTHER: "Other", // Trang khác
NAVIGATION: "Navigation", // Navigation
LOCATION: 'Location', // Location
FIGURE: 'Figure', // Figure
export const dataTypeKeyInSort = [
{ title: "Thời gian tạo", value: "CreatedOn" },
{ title: "Lượt xem", value: "Views" },
{ title: "Lượt chia sẻ", value: "Shares" },
];
export const dataTypeSort = {
Views: [
{ title: "Tăng dần", value: "-" },
{ title: "Giảm dần", value: "+" },
],
Shares: [
{ title: "Tăng dần", value: "-" },
{ title: "Giảm dần", value: "+" },
],
CreatedOn: [
{ title: "Mới nhất", value: "-" },
]
};
export const dataTypeSort = [
{ title: "Tăng dần", value: "+" },
{ title: "Giảm dần", value: "-" },
];
export const dataTypeKeyInSort = [
{ title: "Views", value: "Views" },
{ title: "Shares", value: "Shares" },
];
export const dataTypeKeyInWith = [
{ title: "Ids", value: "Ids" },
{ title: "Sites", value: "Sites" },
@@ -192,6 +154,56 @@ export const enumPageComponentStaticChild = {
DEFAULT: "Default", // Chuyên trang
};
/* PAGE SETTINGS */
// KHÔNG ĐƯỢC XÓA KEY - BIẾN này
export const enumPageKey = {
NONE: "None", // Không xác định
HOME: "Home", // Trang chủ
SECTION: "Section", // Chuyên trang
CATEGORY: "Category", // Trang danh mục
TOPIC: "Topic", // Trang chủ đề
EVENT: "Event", // Trang sự kiện
COLLECTION: "Collection", // Trang sưu tập
ARTICLE: "Article", // Trang bài viết
TAG: "Tag", // Trang từ khóa
AUTHOR: "Author", // Trang tác giả
SEARCH: "Search", // Trang tìm kiếm
CONTACT: "Contact", // Trang liên hệ
ABOUT: "About", // Trang giới thiệu
SERVICE: "Service", // Trang dịch vụ
POLICY: "Policy", // Trang chính sách
TERMS: "Terms", // Trang điều khoản
PRIVACY: "Privacy", // Trang bảo mật
ERROR: "Error", // Trang lỗi
MAINTENANCE: "Maintenance", // Trang bảo trì
CUSTOM: "Custom", // Trang tùy chỉnh
};
export const enumPageTemplate = {
[enumPageKey.HOME]: {
'DEFAULT': "TYPE:Default",
},
[enumPageKey.ARTICLE]: {
'DETAIL': "TYPE:Article_Detail",
},
};
export const enumPageLayouts = {
/* Home */
[`${enumPageTemplate[enumPageKey.HOME]['DEFAULT']}`]: {
'DEFAULT': 'TYPE:Center_Page',
'FULL': 'TYPE:Full_Page',
// 'CENTER_PAGE': 'TYPE:Center_Page',
'BACKGROUND_PAGE': 'TYPE:Background_Page'
},
[`${enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']}`]: {
'ARTICLE_NONE': 'TYPE:ARTICLE_NONE',
'ARTICLE_NORMAL': 'TYPE:ARTICLE_NORMAL',
'ARTICLE_SHORT': 'TYPE:ARTICLE_SHORT',
'ARTICLE_LONG': 'TYPE:ARTICLE_LONG',
'ARTICLE_PAGE': 'TYPE:ARTICLE_PAGE',
},
};
/* SECTION SETTINGS */
// KHÔNG ĐƯỢC XÓA KEY - BIẾN này
@@ -293,6 +305,26 @@ export const enumPageComponentKey = {
FIGURE: 'Figure', // Figure
};
export const enumPageComponentTemplates = { // KHÔNG ĐƯỢC XÓA KEY - BIẾN này
NONE: "None", // Không xác định
SECTION: "Section", // Chuyên trang
CATEGORY: "Category", // Trang danh mục
TOPIC: "Topic", // Trang chủ đề
EVENT: "Event", // Trang sự kiện
COLLECTION: "Collection", // Trang sưu tập
ARTICLE: "Article", // Trang bài viết
TAG: "Tag", // Trang từ khóa
AUTHOR: "Author", // Trang tác giả
POLL: "Poll", // Trang poll
QUIZ: "Quiz", // Trang quiz
SURVEY: "Survey", // Trang survey
ADVERTISING: "Advertising", // Trang quảng cáo
OTHER: "Other", // Trang khác
NAVIGATION: "Navigation", // Navigation
LOCATION: 'Location', // Location
FIGURE: 'Figure', // Figure
};
export const enumPageComponentTemplate = {
[enumPageComponentKey.ARTICLE]: {
'ARTICLE_CARD': "TYPE:Card",
@@ -354,6 +386,7 @@ export const enumPageComponentLayouts = {
[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['ARTICLE']}`]: {
'ARTICLE_COLLECTION_DEFAULT': "TYPE:Article_Collection_Default",
'ARTICLE_COLLECTION_AUDIO': "TYPE:Article_Collection_Audio",
'ARTICLE_COLLECTION_VIDEO': "TYPE:Article_Collection_Video",
},
[`${enumPageComponentTemplate[enumPageComponentKey.COLLECTION]['CATEGORY']}`]: {
'MISSES_COLLECTION_DEFAULT': "TYPE:Category_Collection_MISS_Default",
@@ -386,6 +419,7 @@ export const enumPageComponentLayouts = {
},
};
const defaultArticle = {
WidthImg: 40,
layout: "column",
@@ -418,6 +452,9 @@ export const enumPageComponentDefaultSetting = {
"TYPE:Card_Audio": defaultArticleAudio,
"TYPE:Card_Video": defaultArticleVideo,
"TYPE:Card_VideoHightLight": defaultArticleVideoHightLight,
"TYPE:Card_MissHightLight": {
background: "rgba(255, 93, 2, 0.7)"
}
},
[enumPageComponentKey.COLLECTION]: {
"TYPE:Article_Collection_Default": {
@@ -436,7 +473,11 @@ export const enumPageComponentDefaultSetting = {
defaultFontSizeTitle: 16,
defaultFontWeightTitle: 600,
...defaultArticleAudio
}
},
"TYPE:Category_Collection_MISS_Default": {
background: "rgba(255, 93, 2, 0.7)"
},
"TYPE:Article_Collection_Video": { column: 4 }
},
[enumPageComponentKey.SECTION]: {
"TYPE:Article_Section_Default": {
@@ -465,4 +506,58 @@ export const enumPageComponentDefaultSetting = {
defaultFontWeightTitle: 500,
},
}
}
export const enumPageComponentDefaultStyle = {
[enumPageComponentKey.ARTICLE]: {
"TYPE:Card_Default": `#cpn_[] {}
#cpn_[] .article-title {}
#cpn_[] .article-time {}
#cpn_[] .article-intro {}
#cpn_[] .article-thumbnail {}`,
"TYPE:Card_Audio": `#cpn_[] {}
#cpn_[] .article-title {}`,
"TYPE:Card_Video": ``,
"TYPE:Card_VideoHightLight": `#cpn_[] {}
#cpn_[] .article-title {}
#cpn_[] .article-intro {}
#cpn_[] .article-thumbnail {}`,
"TYPE:Card_MissHightLight": `#cpn_[] {}
#cpn_[] article{}
#cpn_[] .article-thumbnail{}
#cpn_[] .article-title{}`
},
[enumPageComponentKey.COLLECTION]: {
"TYPE:Article_Collection_Default": `#cpn_[] {}
#cpn_[] article{}
#cpn_[] .article-thumbnail img{}
#cpn_[] .article-title{}
#cpn_[] .article-intro{}`,
"TYPE:Article_Collection_Audio": `#cpn_[] {}
#cpn_[] article{}
#cpn_[] .article-title {}`,
"TYPE:Category_Collection_MISS_Default": `#cpn_[] {}
#cpn_[] article{}
#cpn_[] .article-thumbnail{}
#cpn_[] .article-title{}`,
"TYPE:Article_Collection_Video": ""
},
[enumPageComponentKey.SECTION]: {
"TYPE:Article_Section_Default": `#cpn_[] {}
#cpn_[] article{}
#cpn_[] .article-thumbnail img{}
#cpn_[] .article-title{}
#cpn_[] .article-intro{}`
},
[enumPageComponentKey.CATEGORY]: {
"TYPE:Category_Vertical": `#cpn_[] {}
#cpn_[] .category h3{}`,
"TYPE:Default": `#cpn_[] {}
#cpn_[] .category h3{}`,
}
}