fix(identity): align vip icons and sidebar cards
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bac6b04839
commit
ae2588c292
6 files changed
+49
-41
No files matched your search
@@ -210,6 +210,13 @@ main.container,
|
|||||||
gap: 4px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aksrt-author-hero__name-inner {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ========== 通用空状态 ========== */
|
/* ========== 通用空状态 ========== */
|
||||||
.no-results {
|
.no-results {
|
||||||
padding: 48px 20px;
|
padding: 48px 20px;
|
||||||
|
|||||||
@@ -633,6 +633,32 @@ body.aksrt-user-center .uc-content,
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uc-sidebar__section--stats,
|
||||||
|
.uc-sidebar__pair--assets .uc-summary-card,
|
||||||
|
.uc-sidebar__pair--centers .uc-center-card {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uc-sidebar__pair--assets .uc-summary-card__head,
|
||||||
|
.uc-sidebar__pair--assets .uc-summary-card__body {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uc-sidebar__pair--centers .uc-center-card {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
justify-items: center;
|
||||||
|
gap: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uc-sidebar__pair--centers .uc-center-card > span {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uc-sidebar__pair--centers .uc-center-card > i {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.uc-summary-card,
|
.uc-summary-card,
|
||||||
.uc-center-card {
|
.uc-center-card {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ if (!function_exists('aksrt_render_user_identity_chips')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$signals = aksrt_get_user_identity_signals($user_id);
|
$signals = aksrt_get_user_identity_signals($user_id);
|
||||||
|
// Keep the public identity order stable: certification, worn badge, level.
|
||||||
|
usort($signals, static function (array $left, array $right): int {
|
||||||
|
$priority = ['verify' => 0, 'badge' => 1, 'level' => 2];
|
||||||
|
return ($priority[(string) ($left['type'] ?? '')] ?? 3) <=> ($priority[(string) ($right['type'] ?? '')] ?? 3);
|
||||||
|
});
|
||||||
// Comments stay compact; author/card can show more.
|
// Comments stay compact; author/card can show more.
|
||||||
$limit = $context === 'comment' ? 3 : 6;
|
$limit = $context === 'comment' ? 3 : 6;
|
||||||
$n = 0;
|
$n = 0;
|
||||||
@@ -116,7 +121,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
|||||||
'id' => 0,
|
'id' => 0,
|
||||||
'class' => 'flex ac flex1',
|
'class' => 'flex ac flex1',
|
||||||
'name_class' => '',
|
'name_class' => '',
|
||||||
'vip' => false,
|
'vip' => true,
|
||||||
'medal' => true,
|
'medal' => true,
|
||||||
'auth' => true,
|
'auth' => true,
|
||||||
'level' => true,
|
'level' => true,
|
||||||
@@ -148,7 +153,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
|||||||
$vip_html = (string) aksrt_render_vip_badge($user_id, 'sm');
|
$vip_html = (string) aksrt_render_vip_badge($user_id, 'sm');
|
||||||
}
|
}
|
||||||
$name_class = trim('display-name text-ellipsis ' . (string) $args['name_class']);
|
$name_class = trim('display-name text-ellipsis ' . (string) $args['name_class']);
|
||||||
$name_link = '<a class="' . esc_attr($name_class) . '" href="' . esc_url($home) . '">' . $vip_html . esc_html($display) . '</a>';
|
$name_link = '<a class="' . esc_attr($name_class) . '" href="' . esc_url($home) . '">' . esc_html($display) . '</a>';
|
||||||
|
|
||||||
$auth_html = '';
|
$auth_html = '';
|
||||||
$medal_html = '';
|
$medal_html = '';
|
||||||
@@ -217,7 +222,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Order: name → auth → wear medal → level → follow (Zibll).
|
// Order: name → auth → wear medal → level → follow (Zibll).
|
||||||
$html = '<name class="' . esc_attr((string) $args['class']) . '">' . $name_link . $auth_html . $medal_html . $level_html . $follow_html . '</name>';
|
$html = '<name class="' . esc_attr((string) $args['class']) . '">' . $name_link . $vip_html . $auth_html . $medal_html . $level_html . $follow_html . '</name>';
|
||||||
/**
|
/**
|
||||||
* Filter rendered user name chrome.
|
* Filter rendered user name chrome.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
|||||||
$con .= $avatar;
|
$con .= $avatar;
|
||||||
$con .= '<div class="user-right flex flex1 ac jsb ml10">';
|
$con .= '<div class="user-right flex flex1 ac jsb ml10">';
|
||||||
$con .= '<div class="flex1" style="max-width: calc(100% - 40px);"><b>'
|
$con .= '<div class="flex1" style="max-width: calc(100% - 40px);"><b>'
|
||||||
. '<span class="display-name text-ellipsis">' . esc_html($display_name) . '</span>' . $vip_badge . $level_badge . $certification_badge
|
. '<span class="display-name text-ellipsis">' . esc_html($display_name) . '</span>' . $vip_badge . $certification_badge . $level_badge
|
||||||
. '</b><div class="px12 muted-2-color text-ellipsis">' . esc_html($desc) . '</div></div>';
|
. '</b><div class="px12 muted-2-color text-ellipsis">' . esc_html($desc) . '</div></div>';
|
||||||
$con .= '</div>';
|
$con .= '</div>';
|
||||||
$con .= $msg_icon;
|
$con .= $msg_icon;
|
||||||
|
|||||||
@@ -36,31 +36,9 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
|||||||
<div class="uc-header__info">
|
<div class="uc-header__info">
|
||||||
<h1 class="uc-header__name">
|
<h1 class="uc-header__name">
|
||||||
<?php echo esc_html($target_user->display_name); ?>
|
<?php echo esc_html($target_user->display_name); ?>
|
||||||
<?php
|
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
|
||||||
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : '';
|
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||||
if ($vip_badge) {
|
<?php endif; ?>
|
||||||
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
||||||
}
|
|
||||||
// Worn medal icon inline to the right of the name (zibll parity).
|
|
||||||
if (function_exists('aksrt_get_worn_medal_icon')) {
|
|
||||||
echo aksrt_get_worn_medal_icon((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
||||||
}
|
|
||||||
// Level icon inline to the right of the name (zibll parity).
|
|
||||||
if (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html')) {
|
|
||||||
echo \AKSRT\User\Level::get_badge_html((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
foreach ($profile_signals as $signal) {
|
|
||||||
if ((string) ($signal['type'] ?? '') !== 'verify') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
|
|
||||||
if ($icon_url !== '') {
|
|
||||||
echo '<img class="aksrt-identity-certification-icon img-icon ml3" src="' . $icon_url . '" alt="" title="' . esc_attr((string) ($signal['title'] ?? $signal['label'] ?? '')) . '" loading="lazy" decoding="async" />';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</h1>
|
</h1>
|
||||||
<div class="uc-header__meta desc user-identity flex ac hh">
|
<div class="uc-header__meta desc user-identity flex ac hh">
|
||||||
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
|
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
|
||||||
|
|||||||
@@ -92,19 +92,11 @@ $pm_url = ($pm_enabled && $messages_url !== '')
|
|||||||
<div class="aksrt-author-hero__info">
|
<div class="aksrt-author-hero__info">
|
||||||
<?php if ($show_name) : ?>
|
<?php if ($show_name) : ?>
|
||||||
<h1 class="aksrt-author-hero__name">
|
<h1 class="aksrt-author-hero__name">
|
||||||
|
<?php if (function_exists('aksrt_get_user_name')) : ?>
|
||||||
|
<?php echo aksrt_get_user_name(['id' => $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => true, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||||
|
<?php else : ?>
|
||||||
<?php echo esc_html($user->display_name); ?>
|
<?php echo esc_html($user->display_name); ?>
|
||||||
<?php
|
<?php endif; ?>
|
||||||
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : '';
|
|
||||||
if ($vip_badge) {
|
|
||||||
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
||||||
}
|
|
||||||
if (function_exists('aksrt_render_user_identity_chips')) {
|
|
||||||
echo aksrt_render_user_identity_chips($user_id, 'author', [
|
|
||||||
'include_vip' => false,
|
|
||||||
'skip_level' => false,
|
|
||||||
]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</h1>
|
</h1>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user