feat(front-submit): 1:1 写文章/投稿页对齐 zibll newposts
Register AKSRT 写文章/投稿 page template, wire header publish entry to front submit URL, rewrite page-submit as dual-column TinyMCE compose with featured cover, multi-category/topics/filters, pay box, drafts, and capability-gated FrontSubmit AJAX (pay/featured traits).
This commit is contained in:
1 parent
cd4b1a73dc
commit
518e825bdd
25 files changed
+3029
-982
No files matched your search
@@ -490,7 +490,7 @@ function applyAddPreset(key) {
|
||||
}
|
||||
|
||||
const presetFactories = {
|
||||
post: () => ({ label: '写文章', icon: 'fas fa-pen-nib', url: `${adminUrl || siteUrl}/post-new.php` }),
|
||||
post: () => ({ label: '写文章', icon: 'fas fa-pen-nib', url: `${siteUrl}/submit/` }),
|
||||
submit: () => ({ label: '投稿页', icon: 'fas fa-paper-plane', url: `${siteUrl}/submit/` }),
|
||||
profile: () => ({ label: '创作中心', icon: 'fas fa-user-edit', url: `${siteUrl}/user/` }),
|
||||
}
|
||||
@@ -518,7 +518,7 @@ function isAddPresetExists(key) {
|
||||
|
||||
function getAddPresetValue(key) {
|
||||
const presetFactories = {
|
||||
post: () => ({ label: '写文章', icon: 'fas fa-pen-nib', url: `${adminUrl || siteUrl}/post-new.php` }),
|
||||
post: () => ({ label: '写文章', icon: 'fas fa-pen-nib', url: `${siteUrl}/submit/` }),
|
||||
submit: () => ({ label: '投稿页', icon: 'fas fa-paper-plane', url: `${siteUrl}/submit/` }),
|
||||
profile: () => ({ label: '创作中心', icon: 'fas fa-user-edit', url: `${siteUrl}/user/` }),
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ function getItemSummary(item) {
|
||||
}
|
||||
|
||||
const addPresets = [
|
||||
{ label: '写文章', icon: 'fas fa-pen-fancy', url: '/post-new' },
|
||||
{ label: '写文章', icon: 'fas fa-pen-fancy', url: '/submit' },
|
||||
{ label: '投稿页', icon: 'fas fa-file-alt', url: '/submit' },
|
||||
{ label: '发布资源', icon: 'fas fa-cloud-upload-alt', url: '/resource-new' },
|
||||
{ label: '创作中心', icon: 'fas fa-palette', url: '/creator' },
|
||||
|
||||
@@ -22,6 +22,8 @@ export const submitSchema = {
|
||||
front_submit_editor_mode: 'rich',
|
||||
front_submit_draft_save: true,
|
||||
front_submit_leave_warning: true,
|
||||
front_submit_guest_enabled: false,
|
||||
front_submit_captcha: false,
|
||||
post_article_btn_txte: '发布文章',
|
||||
post_article_title_strlen_limit_min: 5,
|
||||
post_article_title_strlen_limit_max: 30,
|
||||
@@ -59,7 +61,9 @@ export const submitSchema = {
|
||||
{ key: 'front_submit_cover', label: '封面图', type: 'switch', default: true, dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'front_submit_category', label: '分类选择', type: 'switch', default: true, dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'post_article_cat', label: '允许投稿分类', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], help: '为空则允许全部分类', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'post_article_user', label: '免登录归属用户', type: 'user_select', default: 0, help: '免登录投稿时文章归属的用户,搜索选择', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'front_submit_guest_enabled', label: '允许免登录投稿', type: 'switch', default: false, help: '开启后访客可投稿;文章归属到下方用户', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'post_article_user', label: '免登录归属用户', type: 'user_select', default: 0, help: '免登录投稿时文章归属的用户,搜索选择', dependsOn: { key: 'front_submit_guest_enabled', value: true } },
|
||||
{ key: 'front_submit_captcha', label: '提交人机验证', type: 'switch', default: false, help: '提交正式投稿时校验人机验证(需在安全扩展启用 captcha)', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'front_submit_tags', label: '标签输入', type: 'switch', default: true, dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'post_article_topics_s', label: '专题选择', type: 'switch', default: false, help: '投稿时可选择专题分类', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
{ key: 'post_article_custom_filter_s', label: '高级筛选选择', type: 'switch', default: true, help: '投稿时可选择自定义筛选维度值', dependsOn: { key: 'front_submit_enabled', value: true } },
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
@import url("pages/topic-rows.css");
|
||||
@import url("pages/sidebar.css");
|
||||
@import url("pages/empty-state.css");
|
||||
@import url("pages/submit.css");
|
||||
@@ -0,0 +1,487 @@
|
||||
/* Article compose / front submit page */
|
||||
|
||||
.aksrt-article-compose {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 48px;
|
||||
}
|
||||
|
||||
.aksrt-article-compose__layout {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 320px;
|
||||
gap: 20px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.aksrt-submit-main {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.aksrt-submit-sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.aksrt-submit-panel {
|
||||
background: var(--surface-1, #fff);
|
||||
border-radius: var(--main-radius, 8px);
|
||||
box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.06));
|
||||
}
|
||||
|
||||
.aksrt-submit-panel--editor {
|
||||
padding: 16px 18px 14px;
|
||||
min-height: 60vh;
|
||||
}
|
||||
|
||||
.aksrt-submit-panel__title {
|
||||
margin: 0;
|
||||
padding: 12px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid var(--color-line, #eceff4);
|
||||
}
|
||||
|
||||
.aksrt-submit-panel__body {
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
.aksrt-submit-title-wrap {
|
||||
margin: 8px 0 12px;
|
||||
}
|
||||
|
||||
.aksrt-submit-title {
|
||||
width: 100%;
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--color-line, #e5e7eb);
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
resize: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
color: var(--color-ink, #1f2329);
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.aksrt-submit-title:focus {
|
||||
border-bottom-color: var(--color-primary, #3b82f6);
|
||||
}
|
||||
|
||||
.aksrt-submit-editor-wrap .wp-editor-container {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.aksrt-submit-editor-wrap .mce-toolbar-grp {
|
||||
background: var(--surface-1, #fff);
|
||||
border-bottom: 1px solid var(--color-line, #eceff4);
|
||||
}
|
||||
|
||||
.aksrt-submit-shortcode-tools {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.aksrt-submit-status-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-submit-nocan {
|
||||
min-height: 40vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.aksrt-submit-featured {
|
||||
margin-bottom: 16px;
|
||||
border: 1px dashed var(--color-line, #d9dee7);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: var(--surface-2, #f7f8fa);
|
||||
}
|
||||
|
||||
.aksrt-submit-featured__preview {
|
||||
position: relative;
|
||||
aspect-ratio: 2 / 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--surface-2, #f3f4f6);
|
||||
}
|
||||
|
||||
.aksrt-submit-featured__preview img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.aksrt-submit-featured__empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-submit-featured__badge {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: #fff;
|
||||
border-radius: 999px;
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-submit-featured__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
border-top: 1px solid var(--color-line, #eceff4);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.aksrt-submit-drop {
|
||||
border: 1px solid var(--color-line, #eceff4);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aksrt-submit-drop > summary {
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-submit-drop > summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.aksrt-submit-drop[open] > summary {
|
||||
border-bottom: 1px solid var(--color-line, #eceff4);
|
||||
background: var(--surface-2, #fafbfc);
|
||||
}
|
||||
|
||||
.aksrt-submit-drop__body {
|
||||
padding: 10px 12px;
|
||||
max-height: 220px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.aksrt-submit-check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 4px 0;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.aksrt-submit-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.aksrt-submit-tag {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.aksrt-submit-tag input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.aksrt-submit-tag span {
|
||||
display: inline-block;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface-2, #f3f4f6);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-submit-tag.is-active span,
|
||||
.aksrt-submit-tag:has(input:checked) span {
|
||||
background: #dbeafe;
|
||||
color: #2563eb;
|
||||
}
|
||||
|
||||
.aksrt-submit-field {
|
||||
display: block;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.aksrt-submit-field__label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.aksrt-submit-hint {
|
||||
margin: 0 0 8px;
|
||||
font-size: 12px;
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
}
|
||||
|
||||
.aksrt-form-input {
|
||||
width: 100%;
|
||||
border: 1px solid var(--color-line, #e5e7eb);
|
||||
border-radius: 6px;
|
||||
padding: 8px 10px;
|
||||
font-size: 13px;
|
||||
background: #fff;
|
||||
color: inherit;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.aksrt-form-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-primary, #3b82f6);
|
||||
}
|
||||
|
||||
.aksrt-submit-pay__row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.aksrt-switch {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.aksrt-switch input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.aksrt-switch__ui {
|
||||
width: 40px;
|
||||
height: 22px;
|
||||
border-radius: 999px;
|
||||
background: #d1d5db;
|
||||
position: relative;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-switch__ui::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-switch input:checked + .aksrt-switch__ui {
|
||||
background: var(--color-primary, #3b82f6);
|
||||
}
|
||||
|
||||
.aksrt-switch input:checked + .aksrt-switch__ui::after {
|
||||
transform: translateX(18px);
|
||||
}
|
||||
|
||||
.aksrt-submit-segmented {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.aksrt-submit-segmented .but.active {
|
||||
background: var(--color-primary, #3b82f6);
|
||||
color: #fff;
|
||||
border-color: var(--color-primary, #3b82f6);
|
||||
}
|
||||
|
||||
.aksrt-submit-pay-downloads__item {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px dashed var(--color-line, #eceff4);
|
||||
}
|
||||
|
||||
.aksrt-submit-actions {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.aksrt-submit-ready {
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
letter-spacing: 0.08em;
|
||||
font-size: 12px;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.aksrt-submit-actions__btns {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.aksrt-submit-actions__btns .but {
|
||||
flex: 1 1 120px;
|
||||
min-height: 40px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
border-radius: 6px;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.aksrt-submit-actions__btns .jb-green {
|
||||
background: linear-gradient(135deg, #34d399, #10b981);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-submit-actions__btns .jb-blue {
|
||||
background: linear-gradient(135deg, #60a5fa, #3b82f6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-submit-actions__btns .but:disabled {
|
||||
opacity: 0.65;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
.aksrt-submit-drafts__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--color-line, #f0f1f3);
|
||||
}
|
||||
|
||||
.aksrt-submit-drafts__link {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.aksrt-submit-drafts__name {
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.aksrt-submit-drafts__link time {
|
||||
font-size: 11px;
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
}
|
||||
|
||||
.aksrt-submit-drafts__delete {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #ef4444;
|
||||
cursor: pointer;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 6px 12px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--color-line, #e5e7eb);
|
||||
background: #fff;
|
||||
color: var(--color-ink-2, #444);
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but.hollow {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but.c-blue {
|
||||
color: #2563eb;
|
||||
border-color: #bfdbfe;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but.c-yellow {
|
||||
color: #b45309;
|
||||
border-color: #fde68a;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but.c-red {
|
||||
color: #dc2626;
|
||||
border-color: #fecaca;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .but.cir {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.aksrt-article-compose .badg {
|
||||
display: inline-block;
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
background: var(--surface-2, #f3f4f6);
|
||||
color: var(--color-ink-3, #8a909c);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
body.aksrt-hide-float #float-right-btns,
|
||||
body.aksrt-hide-tabbar #footer-tabbar,
|
||||
body.aksrt-hide-tabbar .footer-tabbar-placeholder {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.aksrt-article-compose__layout {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.aksrt-submit-sidebar {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.aksrt-submit-main {
|
||||
order: 1;
|
||||
}
|
||||
}
|
||||
+530
-383
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user