feat(nav): close P0/P1 parity gaps (nav style, history, plate, admin build)

Wire header_nav_style transparent/blur, login history sync, plate publish
type, clean dead search CSS, rebuild admin SPA locally (build gitignored).
This commit is contained in:
2026-07-22 17:38:48 +08:00
parent 1d1fef50af
commit 0d9db942f8
13 changed files with 181 additions and 85 deletions
+23
View File
@@ -26,6 +26,7 @@ if (!function_exists('aksrt_get_header_newposts_config')) :
$shop = \AKSRT\Settings\Settings::get_shop_settings();
if (!empty($forum['enabled'])) {
$types[] = 'topic';
$types[] = 'plate';
}
if (!empty($shop['enabled'])) {
$types[] = 'product';
@@ -87,6 +88,28 @@ if (!function_exists('aksrt_get_new_add_actions')) :
'label' => __('发布商品', 'aksrt'),
'icon' => 'fas fa-shopping-bag',
];
} elseif ($type === 'plate') {
// zibll bbs_plate → AKSRT forum plate CPT (admin create for entitled users).
$can = current_user_can('manage_options');
if (!$can && class_exists('\AKSRT\Forum\Forum')) {
try {
$forum = \AKSRT\Forum\Forum::get_instance();
if (method_exists($forum, 'forum_user_can')) {
$can = (bool) $forum->forum_user_can(get_current_user_id(), 'plate_create');
}
} catch (\Throwable $e) {
$can = false;
}
}
if (!$can || !post_type_exists('aksrt_forum_plate')) {
continue;
}
$out[] = [
'type' => 'plate',
'url' => admin_url('post-new.php?post_type=aksrt_forum_plate'),
'label' => __('创建版块', 'aksrt'),
'icon' => 'fas fa-th-large',
];
}
}
return $out;
+13 -8
View File
@@ -148,12 +148,17 @@ if (!function_exists('aksrt_header')) :
}
$nav_class = [
'navbar',
'navbar-top',
$ctx['mobile_layout'],
];
'navbar',
'navbar-top',
$ctx['mobile_layout'],
];
$style_key = sanitize_key((string) ($ctx['settings']['nav_style'] ?? 'default'));
if (in_array($style_key, ['transparent', 'blur'], true)) {
$header_class[] = 'nav-style-' . $style_key;
$nav_class[] = 'nav-style-' . $style_key;
}
$nav_style = '';
$nav_style = '';
if ((int) $ctx['max_width'] > 0) {
$nav_style = ' style="--nav-max-width:' . (int) $ctx['max_width'] . 'px"';
}
@@ -180,10 +185,10 @@ if (!function_exists('aksrt_header')) :
echo '</div></div></nav></header>';
if (!empty($ctx['mobile_drawer'])) {
aksrt_nav_mobile_shell($ctx);
}
aksrt_nav_mobile_shell($ctx);
}
// Layout 1/3 search slide (zibll .navbar-search). Layout-2 uses inline menu_search.
// Layout 1/3 search slide (zibll .navbar-search). Layout-2 uses inline menu_search.
if (!empty($ctx['search_enabled'])) {
$navbar_search = locate_template('templates/parts/navbar-search.php');
if ($navbar_search) {