Merge pull request 'Worktree bg admin ia task' (#7) from worktree-bg-admin-ia-task into main

Reviewed-on: CYL/wordpress-theme-aksrt#7
This commit is contained in:
kate522 committed 2026-07-06 12:02:25 +08:00
commit 4a88ec4ae5
16 files changed
+406 -56

No files matched your search

+50 -5
View File
@@ -47,9 +47,12 @@ $name_sticky = __('置顶', 'aksrt');
$name_featured = __('精华', 'aksrt');
?>
<main id="main-content" class="site-main container" tabindex="-1">
<main id="main-content" class="site-main content-shell" tabindex="-1">
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
<div class="aksrt-forum-board container">
<div class="aksrt-forum-board__hero">
<div class="aksrt-forum-board__header">
<div class="aksrt-forum-board__info">
<h1 class="aksrt-forum-board__title"><?php echo esc_html((string) ($board_data['name'] ?? '')); ?></h1>
@@ -84,8 +87,26 @@ $name_featured = __('精华', 'aksrt');
</div>
</div>
<section class="aksrt-forum-board__governance">
<div class="aksrt-forum-board__governance-card">
<div class="aksrt-forum-board__summary">
<div class="aksrt-forum-board__summary-item">
<span class="aksrt-forum-board__summary-label"><?php echo esc_html($name_topic); ?></span>
<strong><?php echo esc_html(number_format_i18n((int) ($board_data['topic_count'] ?? 0))); ?></strong>
</div>
<div class="aksrt-forum-board__summary-item">
<span class="aksrt-forum-board__summary-label"><?php echo esc_html($name_reply); ?></span>
<strong><?php echo esc_html(number_format_i18n((int) ($board_data['reply_count'] ?? 0))); ?></strong>
</div>
<div class="aksrt-forum-board__summary-item">
<span class="aksrt-forum-board__summary-label"><?php esc_html_e('版主', 'aksrt'); ?></span>
<strong><?php echo esc_html(number_format_i18n(count($moderators))); ?></strong>
</div>
</div>
</div>
<div class="content-layout<?php echo empty($moderators) && empty($application) && empty($permissions['can_moderate']) ? ' content-layout--no-sidebar' : ''; ?> aksrt-forum-board__layout">
<div class="content-layout__primary">
<section class="aksrt-forum-board__governance aksrt-forum-board__governance--inline">
<div class="aksrt-forum-board__governance-card">
<h2 class="aksrt-forum-board__section-title"><?php esc_html_e('权限反馈', 'aksrt'); ?></h2>
<?php if (!is_user_logged_in()) : ?>
<p><?php esc_html_e('登录后可以发帖、申请版主,并在有权限时执行治理动作。', 'aksrt'); ?></p>
@@ -138,8 +159,8 @@ $name_featured = __('精华', 'aksrt');
</form>
<?php endif; ?>
</div>
<?php endif; ?>
</section>
<?php endif; ?>
</section>
<?php if (!empty($sticky_topics)) : ?>
<div class="aksrt-forum-board__sticky">
@@ -290,6 +311,30 @@ $name_featured = __('精华', 'aksrt');
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<aside class="content-layout__sidebar aksrt-forum-board__sidebar">
<div class="aksrt-forum-board__governance-card aksrt-forum-board__governance-card--sidebar">
<h2 class="aksrt-forum-board__section-title"><?php esc_html_e('版块说明', 'aksrt'); ?></h2>
<p><?php echo esc_html((string) ($board_data['description'] ?? __('这里展示版块简介、讨论方向与基础规则。', 'aksrt'))); ?></p>
</div>
<?php if (!empty($moderators)) : ?>
<div class="aksrt-forum-board__governance-card aksrt-forum-board__governance-card--sidebar">
<h2 class="aksrt-forum-board__section-title"><?php esc_html_e('版主团队', 'aksrt'); ?></h2>
<div class="aksrt-forum-board__moderators aksrt-forum-board__moderators--stacked">
<?php foreach ($moderators as $moderator) : ?>
<div class="aksrt-forum-board__moderator">
<?php if (!empty($moderator['avatar_url'])) : ?>
<img src="<?php echo esc_url((string) $moderator['avatar_url']); ?>" alt="" width="36" height="36">
<?php endif; ?>
<span><?php echo esc_html((string) ($moderator['display_name'] ?? '')); ?></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</aside>
</div>
</div>
</main>
+39 -1
View File
@@ -109,7 +109,9 @@ $is_locked = !empty($topic['locked']);
$comments_enabled = !empty($permissions['can_reply']);
?>
<main id="main-content" class="site-main container" tabindex="-1">
<main id="main-content" class="site-main content-shell" tabindex="-1">
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
<div class="aksrt-forum-topic container">
<?php if ($show_breadcrumbs) : ?>
@@ -126,6 +128,7 @@ $comments_enabled = !empty($permissions['can_reply']);
</div>
<?php endif; ?>
<div class="aksrt-forum-topic__shell">
<header class="aksrt-forum-topic__header">
<div class="aksrt-forum-topic__header-top">
<h1 class="aksrt-forum-topic__title">
@@ -152,6 +155,10 @@ $comments_enabled = !empty($permissions['can_reply']);
</h1>
<div class="aksrt-forum-topic__meta">
<span class="aksrt-forum-topic__board-link-wrap">
<i class="fas fa-layer-group"></i>
<a class="aksrt-forum-topic__board-link" href="<?php echo esc_url((string) ($board['url'] ?? home_url('/forums/'))); ?>"><?php echo esc_html((string) ($board['name'] ?? $bc_forum_name)); ?></a>
</span>
<span class="aksrt-forum-topic__author">
<?php if (!empty($topic['author']['avatar_url'])) : ?>
<img src="<?php echo esc_url((string) $topic['author']['avatar_url']); ?>" alt="" width="24" height="24">
@@ -173,6 +180,10 @@ $comments_enabled = !empty($permissions['can_reply']);
</div>
<div class="aksrt-forum-topic__quick-actions">
<a class="aksrt-forum-topic__quick-action aksrt-forum-topic__quick-action--primary" href="#aksrt-forum-replies">
<i class="fas fa-reply"></i>
<?php esc_html_e('参与讨论', 'aksrt'); ?>
</a>
<?php if (is_user_logged_in()) : ?>
<button type="button" class="aksrt-forum-topic__quick-action js-aksrt-report-trigger"
data-target-type="post"
@@ -208,6 +219,33 @@ $comments_enabled = !empty($permissions['can_reply']);
</div>
</header>
<aside class="aksrt-forum-topic__sidebar">
<?php if ($board) : ?>
<section class="aksrt-forum-topic__sidebar-card aksrt-forum-topic__sidebar-card--board">
<h2><?php esc_html_e('所属版块', 'aksrt'); ?></h2>
<a class="aksrt-forum-topic__sidebar-link" href="<?php echo esc_url((string) ($board['url'] ?? '#')); ?>">
<strong><?php echo esc_html((string) ($board['name'] ?? '')); ?></strong>
<?php if (!empty($board['description'])) : ?>
<span><?php echo esc_html((string) $board['description']); ?></span>
<?php endif; ?>
</a>
</section>
<?php endif; ?>
<section class="aksrt-forum-topic__sidebar-card aksrt-forum-topic__sidebar-card--author">
<h2><?php esc_html_e('作者信息', 'aksrt'); ?></h2>
<div class="aksrt-forum-topic__sidebar-author">
<?php if (!empty($topic['author']['avatar_url'])) : ?>
<img src="<?php echo esc_url((string) $topic['author']['avatar_url']); ?>" alt="" width="48" height="48">
<?php endif; ?>
<div>
<strong><?php echo esc_html((string) ($topic['author']['display_name'] ?? '')); ?></strong>
<span><?php echo esc_html((string) ($topic['date'] ?? '')); ?></span>
</div>
</div>
</section>
</aside>
<div class="aksrt-forum-report-modal" id="aksrt-report-modal" hidden>
<div class="aksrt-forum-report-modal__backdrop js-aksrt-report-close"></div>
<div class="aksrt-forum-report-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="aksrt-report-title">
+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; ?>
+7 -2
View File
@@ -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>
+7 -1
View File
@@ -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">
+7
View File
@@ -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';
+1
View File
@@ -30,6 +30,7 @@ $term_desc = $term->description ?? '';
<div class="aksrt-product-archive container">
<header class="aksrt-product-archive__header">
<div class="aksrt-product-archive__eyebrow"><?php esc_html_e('商城商品', 'aksrt'); ?></div>
<h1 class="aksrt-product-archive__title"><?php echo esc_html($term_name); ?></h1>
<?php if ($term_desc) : ?>
<p class="aksrt-product-archive__desc"><?php echo esc_html($term_desc); ?></p>
+1
View File
@@ -29,6 +29,7 @@ $term_name = $term->name ?? '';
<div class="aksrt-product-archive container">
<header class="aksrt-product-archive__header">
<div class="aksrt-product-archive__eyebrow"><?php esc_html_e('商品标签', 'aksrt'); ?></div>
<h1 class="aksrt-product-archive__title">
<i class="fas fa-tag"></i>
<?php echo esc_html($term_name); ?>