Align forum shop and user page shells
This commit is contained in:
1 parent
4043de2473
commit
1284ebc63e
14 files changed
+348
-44
No files matched your search
@@ -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; ?>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ $author = $author_id > 0 ? get_userdata($author_id) : null;
|
||||
>
|
||||
<div class="aksrt-product-page__layout">
|
||||
<!-- Gallery -->
|
||||
<section class="aksrt-product-page__gallery">
|
||||
<section class="aksrt-product-page__gallery aksrt-product-page__panel">
|
||||
<?php if (!empty($product['image'])) : ?>
|
||||
<div class="aksrt-product-page__primary-image" data-aksrt-main-image>
|
||||
<img src="<?php echo esc_url((string) $product['image']); ?>" alt="<?php echo esc_attr((string) ($product['title'] ?? '')); ?>" id="product-main-img">
|
||||
@@ -81,7 +81,7 @@ $author = $author_id > 0 ? get_userdata($author_id) : null;
|
||||
</section>
|
||||
|
||||
<!-- Summary -->
|
||||
<section class="aksrt-product-page__summary">
|
||||
<section class="aksrt-product-page__summary aksrt-product-page__panel">
|
||||
<div class="aksrt-product-page__badges">
|
||||
<?php if ($pay_modo === 'points') : ?>
|
||||
<span class="aksrt-product-page__badge aksrt-product-page__badge--points"><?php esc_html_e('积分商品', 'aksrt'); ?></span>
|
||||
@@ -119,6 +119,11 @@ $author = $author_id > 0 ? get_userdata($author_id) : null;
|
||||
<p class="aksrt-product-page__excerpt"><?php echo esc_html((string) $product['excerpt']); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-product-page__service-strip">
|
||||
<span><i class="fas fa-shield-alt"></i> <?php esc_html_e('主站统一交易保障', 'aksrt'); ?></span>
|
||||
<span><i class="fas fa-box-open"></i> <?php esc_html_e('与内容主线共用卡片与购买节奏', 'aksrt'); ?></span>
|
||||
</div>
|
||||
|
||||
<!-- Product options selector -->
|
||||
<?php if ($has_options) : ?>
|
||||
<div class="aksrt-product-page__options" data-aksrt-options-selector>
|
||||
|
||||
@@ -334,6 +334,12 @@ $svg_empty_favorite = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 2
|
||||
</div>
|
||||
</div>
|
||||
<div class="uc-header__actions">
|
||||
<a href="<?php echo esc_url( $messages_url ); ?>" class="btn-ghost btn-sm">
|
||||
<i class="fas fa-bell" aria-hidden="true"></i> <?php esc_html_e( '消息通知', 'aksrt' ); ?>
|
||||
<?php if ( $notification_unread_count > 0 ) : ?>
|
||||
<span class="uc-header__action-badge"><?php echo esc_html( (string) $notification_unread_count ); ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php if ( $show_avatar_edit ) : ?>
|
||||
<a href="<?php echo esc_url( $avatar_settings_url ); ?>" class="btn-ghost btn-sm">
|
||||
<i class="fas fa-camera" aria-hidden="true"></i> <?php esc_html_e( '更换头像', 'aksrt' ); ?>
|
||||
@@ -402,7 +408,7 @@ $svg_empty_favorite = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 2
|
||||
?>
|
||||
<?php if ($orders_url || $show_vip || $show_credit_tabs) : ?>
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('交易服务', 'aksrt'); ?></div>
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('权益与消费', 'aksrt'); ?></div>
|
||||
<div class="uc-sidebar__buttons">
|
||||
<?php if ($orders_url) : ?>
|
||||
<a href="<?php echo esc_url($orders_url); ?>" class="uc-sidebar__btn">
|
||||
|
||||
@@ -298,6 +298,13 @@ $home_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url
|
||||
|
||||
<?php if (in_array('forum', $enabled_tabs, true)) : ?>
|
||||
<div id="panel-forum" class="dashboard-panel<?php echo $active_tab === 'forum' ? ' is-active' : ''; ?>" role="tabpanel"<?php echo $active_tab !== 'forum' ? ' hidden' : ''; ?>>
|
||||
<div class="uh-forum__section-head">
|
||||
<div>
|
||||
<h2 class="uh-forum__section-title-main"><?php esc_html_e('论坛内容', 'aksrt'); ?></h2>
|
||||
<p class="uh-forum__section-desc"><?php esc_html_e('在用户主页中保留论坛维度,但仍以内容流和身份展示为主。', 'aksrt'); ?></p>
|
||||
</div>
|
||||
<a class="uh-forum__section-link" href="<?php echo esc_url(home_url('/forums/')); ?>"><?php esc_html_e('进入社区', 'aksrt'); ?></a>
|
||||
</div>
|
||||
<?php
|
||||
$forum_page = max(1, isset($_GET['forum_page']) ? (int) $_GET['forum_page'] : 1);
|
||||
$forum_sub = isset($_GET['forum_sub']) ? sanitize_key(wp_unslash($_GET['forum_sub'])) : 'topics';
|
||||
|
||||
Reference in new issue
Block a user