feat(single): align author bar follow and reward actions with the site flows
- guests get the sign-in trigger instead of a redirect to the login page, for both follow and wallet reward controls - follow requests swap the label for an inline loader and block a second submit; the followed state uses the .actived hook - follower counts sync through data-follow-count on the user homepage (the previous selector matched nothing) and only for the viewed profile - reward button uses the secondary action colour; the reward template is only rendered for signed-in visitors - drop the unused author-hero aria-disabled rule and stale wording in the touched comments Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ad5ef9aff
commit
d40906b4a3
13 files changed
+148
-56
No files matched your search
@@ -61,7 +61,7 @@ require_once JIO_DIR . '/templates/parts/user-shared-helpers.php';
|
||||
?>
|
||||
<button type="button" class="<?php echo esc_attr(trim($tab_class)); ?>" data-tab="<?php echo esc_attr($tab_key); ?>" role="tab">
|
||||
<?php echo esc_html($tab_labels[$tab_key] ?? ucfirst($tab_key)); ?>
|
||||
<span class="dashboard-tabs__count opacity8"><?php echo esc_html((string) $tab_count); ?></span>
|
||||
<span class="dashboard-tabs__count opacity8"<?php echo $tab_key === 'follow' ? ' data-follow-count="followers"' : ''; ?>><?php echo esc_html((string) $tab_count); ?></span>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ $author_id = (int) get_the_author_meta('ID');
|
||||
$author_name = get_the_author();
|
||||
$author_url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($author_id) : get_author_posts_url($author_id);
|
||||
|
||||
// 时间显示:完全按参考主题 zib_get_post_time_tooltip 的分支顺序。
|
||||
// 时间显示分支顺序:
|
||||
// 1) 数据源 date → 发布时间
|
||||
// 2) 非已发布状态 → 更新时间
|
||||
// 3) 更新时间 > 发布时间 → 文案用更新时间+「更新」,tooltip 仍为发布时间+「发布」
|
||||
@@ -43,7 +43,7 @@ if ($time_source === 'date') {
|
||||
$rel_label = __('发布', 'jio');
|
||||
$abs_fmt = $published_title;
|
||||
} elseif (!$is_published) {
|
||||
// 2) 草稿/待审等:参考固定展示更新时间。
|
||||
// 2) 草稿/待审等:固定展示更新时间。
|
||||
$time_mysql = $modified_mysql;
|
||||
$rel_label = __('更新', 'jio');
|
||||
$abs_fmt = $modified_title;
|
||||
@@ -78,7 +78,7 @@ $name_html = jio_get_user_name([
|
||||
]);
|
||||
$follow_html = jio_get_user_follow('px12-sm ml10 follow but c-red', $author_id);
|
||||
$reward_button = get_current_user_id() !== $author_id && function_exists('jio_get_rewards_button')
|
||||
? jio_get_rewards_button($author_id, 'ml6 but c-yellow px12-sm', get_the_ID())
|
||||
? jio_get_rewards_button($author_id, 'ml6 but c-blue px12-sm', get_the_ID())
|
||||
: '';
|
||||
?>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ $total_pages = max(1, (int) ($list['total_pages'] ?? 1));
|
||||
<li>
|
||||
<button type="button" class="uh-follow__subtab<?php echo $follow_sub === 'followers' ? ' is-active focus-color' : ' muted-color'; ?>" data-uh-sub="followers">
|
||||
<?php esc_html_e('粉丝', 'jio'); ?>
|
||||
<span class="uh-follow__subtab-count"><?php echo esc_html((string) $follower_count); ?></span>
|
||||
<span class="uh-follow__subtab-count" data-follow-count="followers"><?php echo esc_html((string) $follower_count); ?></span>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@@ -76,8 +76,8 @@ $show_header_notification = !empty($notification_settings['enabled'])
|
||||
&& in_array('user_home_header', (array) ($notification_settings['icon_show'] ?? []), true);
|
||||
$messages_url = $show_header_notification && function_exists('jio_get_messages_page_url') ? jio_get_messages_page_url() : '';
|
||||
$unread_count = $is_own ? jio_get_user_unread_notification_count($user_id) : 0;
|
||||
// 封面三点菜单末项:管理员 → 禁封/解封(参考主题 author_header_drop_lists 钩子语义,
|
||||
// 禁封权限优先于举报);否则 → 举报用户(保持既有契约)。
|
||||
// 封面三点菜单末项:管理员 → 禁封/解封(禁封权限优先于举报);
|
||||
// 否则 → 举报用户(保持既有契约)。
|
||||
$cover_ban_html = function_exists('jio_get_user_cover_menu_action_html')
|
||||
? jio_get_user_cover_menu_action_html($user_id)
|
||||
: '';
|
||||
@@ -151,8 +151,8 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// 治理状态徽章占据身份行元信息位(参考主题 author_header_identity 钩子:
|
||||
// 红=违规已封号 / 黄=小黑屋禁封中 / 灰=禁言中,字段与颜色统一管理)。
|
||||
// 治理状态徽章占据身份行元信息位:
|
||||
// 红=违规已封号 / 黄=小黑屋禁封中 / 灰=禁言中,字段与颜色统一管理。
|
||||
$ban_badge = function_exists('jio_get_user_ban_identity_badge')
|
||||
? jio_get_user_ban_identity_badge($user_id)
|
||||
: '';
|
||||
@@ -194,7 +194,7 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php if ($show_follow) : ?>
|
||||
<?php echo jio_get_user_follow('btn-outline btn-sm jio-author-hero__follow-btn', (int) $user_id, null, null, __('登录后关注', 'jio')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo jio_get_user_follow('btn-outline btn-sm jio-author-hero__follow-btn', (int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in new issue
Block a user