feat(user-center): deepen zibll parity and profile media
This commit is contained in:
1 parent
c13f686cdc
commit
e47ee1b029
16 files changed
+479
-65
No files matched your search
@@ -24,7 +24,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
</div>
|
||||
<div class="uc-header__content">
|
||||
<div class="uc-header__avatar">
|
||||
<?php echo get_avatar($user_id, 120, '', $target_user->display_name); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo aksrt_get_avatar_html($user_id, 120, ['id' => 'aksrt-user-avatar-image', 'alt' => $target_user->display_name, 'loading' => 'eager']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<div class="uc-header__info">
|
||||
<h1 class="uc-header__name">
|
||||
@@ -82,16 +82,19 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($messages_url)) : ?>
|
||||
<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 endif; ?>
|
||||
<?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'); ?>
|
||||
</a>
|
||||
<button type="button" id="aksrt-upload-avatar-btn" class="btn-ghost btn-sm">
|
||||
<i class="fas fa-camera" aria-hidden="true"></i> <span><?php esc_html_e('更换头像', 'aksrt'); ?></span>
|
||||
</button>
|
||||
<input type="file" id="aksrt-avatar-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url(aksrt_get_user_home_url()); ?>" class="btn-ghost btn-sm">
|
||||
<i class="fas fa-map-marker-alt" aria-hidden="true"></i> <?php esc_html_e('我的主页', 'aksrt'); ?>
|
||||
|
||||
@@ -12,6 +12,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
|
||||
require __DIR__ . '/sidebar-stats.php';
|
||||
require __DIR__ . '/sidebar-nav.php';
|
||||
require __DIR__ . '/sidebar-creator.php';
|
||||
require __DIR__ . '/sidebar-commerce.php';
|
||||
?>
|
||||
<button type="button" class="uc-sidebar__drawer-trigger" id="uc-drawer-trigger" aria-label="<?php esc_attr_e('打开导航', 'aksrt'); ?>">
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* User center sidebar: creator and community shortcuts.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$creator_links = array_filter([
|
||||
[
|
||||
'url' => (string) ($new_post_url ?? ''),
|
||||
'icon' => 'pen',
|
||||
'label' => __('发布文章', 'aksrt'),
|
||||
],
|
||||
[
|
||||
'url' => (string) ($new_product_url ?? ''),
|
||||
'icon' => 'store',
|
||||
'label' => __('发布商品', 'aksrt'),
|
||||
],
|
||||
[
|
||||
'url' => (string) ($forum_compose_url ?? ''),
|
||||
'icon' => 'comments',
|
||||
'label' => __('论坛发帖', 'aksrt'),
|
||||
],
|
||||
[
|
||||
'url' => (string) ($revenue_url ?? ''),
|
||||
'icon' => 'chart-line',
|
||||
'label' => __('创作收益', 'aksrt'),
|
||||
],
|
||||
], static fn(array $item): bool => $item['url'] !== '');
|
||||
|
||||
if (!$creator_links) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('创作服务', 'aksrt'); ?></div>
|
||||
<div class="uc-sidebar__buttons">
|
||||
<?php foreach ($creator_links as $item) : ?>
|
||||
<a class="uc-sidebar__btn" href="<?php echo esc_url($item['url']); ?>">
|
||||
<i class="fas fa-<?php echo esc_attr($item['icon']); ?>" aria-hidden="true"></i>
|
||||
<span><?php echo esc_html($item['label']); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,6 +23,7 @@ defined('ABSPATH') || exit;
|
||||
<span><?php echo esc_html($tab['label']); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!empty($messages_url)) : ?>
|
||||
<a href="<?php echo esc_url($messages_url); ?>" class="uc-sidebar__btn">
|
||||
<i class="fas fa-bell" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('消息通知', 'aksrt'); ?></span>
|
||||
@@ -30,5 +31,6 @@ defined('ABSPATH') || exit;
|
||||
<span class="uc-sidebar__badge"><?php echo esc_html((string) $notification_unread_count); ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,9 +24,11 @@ defined('ABSPATH') || exit;
|
||||
<span class="uc-stats__label"><?php echo esc_html($dashboard_tabs[$stat_tab]['label']); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!empty($messages_url)) : ?>
|
||||
<a class="uc-stats__item" href="<?php echo esc_url($messages_url); ?>">
|
||||
<span class="uc-stats__value"><?php echo esc_html((string) $notification_unread_count); ?></span>
|
||||
<span class="uc-stats__label"><?php esc_html_e('通知', 'aksrt'); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user