Align forum shop and user page shells

This commit is contained in:
kate522 committed 2026-07-06 11:49:31 +08:00
1 parent 4043de2473
commit 1284ebc63e
14 files changed
+348 -44

No files matched your search

+32 -17
View File
@@ -57,13 +57,21 @@ if ($active_tab_type === '') {
}
?>
<main id="main-content" class="site-main container" tabindex="-1">
<main id="main-content" class="site-main content-shell" tabindex="-1">
<header class="aksrt-forum-header">
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
<header class="aksrt-forum-header container">
<div class="aksrt-forum-header__content">
<div class="aksrt-forum-header__eyebrow">
<span class="aksrt-forum-header__eyebrow-pill"><i class="fas fa-comments"></i> <?php echo esc_html($name_forum); ?></span>
<span class="aksrt-forum-header__eyebrow-meta"><?php printf(esc_html__('%1$d 个%2$s · %3$d 条%4$s', 'aksrt'), (int) ($stats['board_count'] ?? 0), esc_html($name_plate), (int) ($stats['topic_count'] ?? 0), esc_html($name_topic)); ?></span>
</div>
<h1 class="aksrt-forum-header__title"><?php echo esc_html(get_the_title() ?: __('社区论坛', 'aksrt')); ?></h1>
<?php if (get_the_excerpt()) : ?>
<p class="aksrt-forum-header__desc"><?php echo esc_html(get_the_excerpt()); ?></p>
<?php else : ?>
<p class="aksrt-forum-header__desc"><?php esc_html_e('围绕站点内容延展讨论、问答与经验分享,保留社区能力但回归主站内容流语义。', 'aksrt'); ?></p>
<?php endif; ?>
<div class="aksrt-forum-header__actions">
<?php if (!empty($permissions['can_compose'])) : ?>
@@ -84,11 +92,7 @@ if ($active_tab_type === '') {
</div>
<div class="aksrt-forum-header__stats">
<div class="aksrt-forum-header__stat">
<span class="aksrt-forum-header__stat-num"><?php echo esc_html(number_format_i18n((int) ($stats['board_count'] ?? 0))); ?></span>
<span class="aksrt-forum-header__stat-label"><?php echo esc_html($name_plate); ?></span>
</div>
<div class="aksrt-forum-header__stat">
<div class="aksrt-forum-header__stat is-active">
<span class="aksrt-forum-header__stat-num"><?php echo esc_html(number_format_i18n((int) ($stats['topic_count'] ?? 0))); ?></span>
<span class="aksrt-forum-header__stat-label"><?php echo esc_html($name_topic); ?></span>
</div>
@@ -97,9 +101,15 @@ if ($active_tab_type === '') {
<span class="aksrt-forum-header__stat-label"><?php echo esc_html($name_reply); ?></span>
</div>
<div class="aksrt-forum-header__stat">
<span class="aksrt-forum-header__stat-num"><?php echo esc_html(number_format_i18n((int) ($stats['moderator_count'] ?? 0))); ?></span>
<span class="aksrt-forum-header__stat-label"><?php esc_html_e('版主', 'aksrt'); ?></span>
<span class="aksrt-forum-header__stat-num"><?php echo esc_html(number_format_i18n((int) ($stats['board_count'] ?? 0))); ?></span>
<span class="aksrt-forum-header__stat-label"><?php echo esc_html($name_plate); ?></span>
</div>
<?php if ((int) ($stats['pending_topic_count'] ?? 0) > 0 && !empty($permissions['can_manage'])) : ?>
<div class="aksrt-forum-header__stat aksrt-forum-header__stat--muted">
<span class="aksrt-forum-header__stat-num"><?php echo esc_html(number_format_i18n((int) ($stats['pending_topic_count'] ?? 0))); ?></span>
<span class="aksrt-forum-header__stat-label"><?php esc_html_e('待审核', 'aksrt'); ?></span>
</div>
<?php endif; ?>
</div>
</header>
@@ -133,7 +143,9 @@ if ($active_tab_type === '') {
$tab_type = sanitize_key($tab['type'] ?? 'synthesis');
$tab_label = esc_html($tab['label'] ?? $tab_type);
$is_active = $tab_type === $active_tab_type;
if ($tab_type === 'pending' && empty($permissions['can_manage'])) continue;
if ($tab_type === 'pending' || ($tab_type === 'plate' && !empty($boards))) {
continue;
}
?>
<button type="button"
class="aksrt-forum-home-tabs__btn<?php echo $is_active ? ' is-active' : ''; ?>"
@@ -141,16 +153,19 @@ if ($active_tab_type === '') {
<?php echo $tab_label; ?>
</button>
<?php endforeach; ?>
<?php if (!empty($permissions['can_manage'])) : ?>
<?php if (!empty($boards)) : ?>
<button type="button"
class="aksrt-forum-home-tabs__btn<?php echo $active_tab_type === 'pending' ? ' is-active' : ''; ?>"
data-tab-type="pending">
<?php esc_html_e('待审核', 'aksrt'); ?>
<?php if ((int) ($stats['pending_topic_count'] ?? 0) > 0) : ?>
<span class="aksrt-forum-home-tabs__badge"><?php echo esc_html((string) ($stats['pending_topic_count'] ?? 0)); ?></span>
<?php endif; ?>
class="aksrt-forum-home-tabs__btn<?php echo $active_tab_type === 'plate' ? ' is-active' : ''; ?>"
data-tab-type="plate">
<?php echo esc_html($name_plate); ?>
</button>
<?php endif; ?>
<?php if (!empty($permissions['can_manage']) && (int) ($stats['pending_topic_count'] ?? 0) > 0) : ?>
<a class="aksrt-forum-home-tabs__btn aksrt-forum-home-tabs__btn--secondary" href="<?php echo esc_url($admin_forum_url); ?>">
<?php esc_html_e('审核入口', 'aksrt'); ?>
<span class="aksrt-forum-home-tabs__badge"><?php echo esc_html((string) ($stats['pending_topic_count'] ?? 0)); ?></span>
</a>
<?php endif; ?>
</nav>
<?php endif; ?>