DEV: css nickname

См. https://libarea.ru/post/1564/dev-dobavil-globalno-nickname
This commit is contained in:
Evg 2023-10-23 18:56:00 +03:00
parent 8bf20137e0
commit c79816deb6
12 changed files with 29 additions and 16 deletions

View file

@ -122,7 +122,8 @@ class CommentModel extends \Hleb\Scheme\App\Models\MainModel
votes_comment_user_id,
id,
login,
avatar
avatar,
created_at
FROM comments
JOIN users ON id = comment_user_id
JOIN posts ON comment_post_id = post_id AND post_tl <= :tl

View file

@ -262,6 +262,7 @@ class FacetModel extends \Hleb\Scheme\App\Models\MainModel
id,
login,
avatar,
created_at,
is_deleted,
about
FROM users

View file

@ -8,7 +8,7 @@ $login = $user['login'] ?? false;
<?= Img::avatar(UserData::getUserAvatar(), UserData::getUserLogin(), 'img-base mt5 mr5', 'small'); ?>
<?php if ($login) : ?>
<div>
<a class="gray" href="/@<?= $login; ?>"><?= $login; ?></a>
<a class="gray nickname" href="/@<?= $login; ?>"><?= $login; ?></a>
<div class="text-xs gray-600"><?= $user['email']; ?></div>
</div>
<?php endif; ?>

View file

@ -6,7 +6,7 @@ foreach ($comments as $comment) :
<?php if (!empty($comment['answer_id'])) : ?>
<?php if ($comment['answer_published'] == 0 && $comment['answer_user_id'] != UserData::getUserId() && !UserData::checkAdmin()) continue; ?>
<div class="content-body">
<div class="flex justify-between gap">
<div class="flex justify-between gap-min">
<div class="flex gap">
<a class="gray-600 flex gap-min" href="<?= url('profile', ['login' => $comment['login']]); ?>">
<?= Img::avatar($comment['avatar'], $comment['login'], 'img-sm', 'small'); ?>
@ -25,10 +25,12 @@ foreach ($comments as $comment) :
<?php if ($comment['comment_published'] == 0 && $comment['comment_user_id'] != UserData::getUserId() && !UserData::checkAdmin()) continue; ?>
<div class="content-body">
<div class="flex justify-between gap">
<div class="flex gap">
<div class="flex gap-min">
<a class="gray-600 flex gap-min" href="<?= url('profile', ['login' => $comment['login']]); ?>">
<?= Img::avatar($comment['avatar'], $comment['login'], 'img-sm', 'small'); ?>
<?= $comment['login']; ?>
<span class="nickname<?php if (Html::loginColor($comment['created_at'] ?? false)) : ?> green<?php endif; ?>">
<?= $comment['login']; ?>
</span>
</a>
<span class="gray-600 lowercase"><?= Html::langDate($comment['comment_date']); ?></span>
</div>

View file

@ -30,7 +30,10 @@
<li class="mb10">
<a class="gray-600" href="<?= url('profile', ['login' => $row['login']]); ?>">
<?= Img::avatar($row['avatar'], $row['login'], 'img-sm', 'max'); ?>
<?= $row['login']; ?> (<?= Html::formatToHuman($row['hits_count']); ?>)
<span class="nickname<?php if (Html::loginColor($row['created_at'] ?? false)) : ?> green<?php endif; ?>">
<?= $row['login']; ?>
</span>
(<?= Html::formatToHuman($row['hits_count']); ?>)
</a>
</li>
<?php endforeach; ?>

View file

@ -19,7 +19,9 @@
<a class="flex items-center hidden gray-600" href="<?= url('profile', ['login' => $row['login']]); ?>">
<?= Img::avatar($row['avatar'], $row['login'], 'img-base', 'max'); ?>
<div class="ml5">
<div class="gray-600"><?= $row['login']; ?></div>
<div class="gray-600<?php if (Html::loginColor($row['created_at'] ?? false)) : ?> green<?php endif; ?>">
<span class="nickname"><?= $row['login']; ?></span>
</div>
<?php if ($row['about']) : ?>
<div class="gray-600 mb-none text-sm">
<?= fragment($row['about'], 80); ?>

View file

@ -19,7 +19,7 @@
<svg class="icons <?= $n['css']; ?>">
<use xlink:href="/assets/svg/icons.svg#<?= $n['icon']; ?>"></use>
</svg>
<a class="black ml5" href="<?= $profile; ?>"><?= $notif['login']; ?></a>
<a class="black ml5 nickname" href="<?= $profile; ?>"><?= $notif['login']; ?></a>
<span class="lowercase gray-600">
<?= __('app.' . $n['lang'], ['url' => '<a href="' . $url . '">', 'a' => '</a>']); ?>
<?= Html::langDate($notif['time']); ?>

View file

@ -30,7 +30,7 @@
<div class="flex text-sm gap">
<a class="gray-600" href="<?= url('profile', ['login' => $answer['login']]); ?>">
<?= Img::avatar($answer['avatar'], $answer['login'], 'img-sm mr5', 'small'); ?>
<span <?php if (Html::loginColor($answer['created_at'])) : ?> class="green" <?php endif; ?>>
<span class="nickname<?php if (Html::loginColor($answer['created_at'])) : ?> green<?php endif; ?>">
<?= $answer['login']; ?>
</span>
</a>
@ -87,7 +87,7 @@
<div class="text-sm flex gap">
<a class="gray-600" href="<?= url('profile', ['login' => $comment['login']]); ?>">
<?= Img::avatar($comment['avatar'], $comment['login'], 'img-sm', 'small'); ?>
<span class="<?php if (Html::loginColor($comment['created_at'])) : ?> green<?php endif; ?>">
<span class="nickname<?php if (Html::loginColor($comment['created_at'])) : ?> green<?php endif; ?>">
<?= $comment['login']; ?>
</span>
</a>

View file

@ -39,7 +39,9 @@
</div>
<div class="text-sm gray-600 flex gap lowercase mb10">
<a class="brown" href="<?= url('profile', ['login' => $answer['login']]); ?>"><?= $answer['login']; ?></a>
<a class="gray-600<?php if (Html::loginColor($answer['created_at'] ?? false)) : ?> green<?php endif; ?>" href="<?= url('profile', ['login' => $answer['login']]); ?>">
<span class="nickname"><?= $answer['login']; ?></span>
</a>
<span class="mb-none"><?= Html::langDate($answer['answer_date']); ?>
<?php if (empty($answer['edit'])) : ?>
(<?= __('app.ed'); ?>.)
@ -66,8 +68,10 @@
<?= fragment($comment['comment_content'], 1500); ?>
<span class="gray-600"> </span>
<a class="brown" href="<?= url('profile', ['login' => $comment['login']]); ?>"><?= $comment['login']; ?></a>
<a class="gray-600<?php if (Html::loginColor($comment['created_at'] ?? false)) : ?> green<?php endif; ?>" href="<?= url('profile', ['login' => $comment['login']]); ?>">
<span class="nickname"><?= $comment['login']; ?></span>
</a>
<span class="lowercase gray-600 ml5 mr5"><?= Html::langDate($comment['comment_date']); ?></span>
<?php if (UserData::getRegType(config('trust-levels.tl_add_comm_qa'))) : ?>

View file

@ -19,7 +19,7 @@
<?= Img::avatar($post['avatar'], $post['login'], 'img-sm', 'max'); ?>
<span class="nickname<?php if (Html::loginColor($post['created_at'] ?? false)) : ?> green<?php endif; ?>">
<?= $post['login']; ?>
</span>
</span>
</a>
<div class="gray-600 lowercase"><?= Html::langDate($post['post_date']); ?></div>

View file

@ -31,7 +31,7 @@ $blog = $data['blog'][0] ?? null;
<div class="text-sm flex gray-600 gap">
<a class="gray-600" title="<?= $post['login']; ?>" href="<?= url('profile', ['login' => $post['login']]); ?>">
<?= Img::avatar($post['avatar'], $post['login'], 'img-sm mr5', 'small'); ?>
<?= $post['login']; ?>
<span class="nickname"><?= $post['login']; ?></span>
</a>
<span class="lowercase">

View file

@ -36,7 +36,7 @@
<div class="w160 mb20 center">
<a href="<?= url('profile', ['login' => $user['login']]); ?>">
<?= Img::avatar($user['avatar'], $user['login'], 'img-lg', 'max'); ?>
<div class="block mt5">
<div class="block mt5 nickname<?php if (Html::loginColor($user['created_at'] ?? false)) : ?> green<?php endif; ?>">
<?= $user['login']; ?>
</div>
<?php if ($user['name']) : ?>