给作者加个标签
This commit is contained in:
浪子 2024-07-29 19:06:39 +08:00
parent 5dd748cb53
commit c5c5b94f4f
1 changed files with 29 additions and 1 deletions

View File

@ -102,7 +102,12 @@ function threadedComments($comments, $options) {
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="comment--meta"> <div class="comment--meta">
<div class="comment--author"><?php echo $comments->author; ?><span class="dot"></span> <div class="comment--author"><?php echo $comments->author; ?>
<?php if ($comments->authorId == $comments->ownerId): ?>
<span class="dot"></span> <span class="custom-span">作者</span>
<?php endif; ?>
<span class="dot"></span>
<div class="comment--time"><?php $comments->date('Y-m-d H:i'); ?></div> <div class="comment--time"><?php $comments->date('Y-m-d H:i'); ?></div>
<span class="comment-reply-link u-cursorPointer"> <span class="comment-reply-link u-cursorPointer">
<?php $comments->reply('<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" class="" ><g><path d="M12 3.786c-4.556 0-8.25 3.694-8.25 8.25s3.694 8.25 8.25 8.25c1.595 0 3.081-.451 4.341-1.233l1.054 1.7c-1.568.972-3.418 1.534-5.395 1.534-5.661 0-10.25-4.589-10.25-10.25S6.339 1.786 12 1.786s10.25 4.589 10.25 10.25c0 .901-.21 1.77-.452 2.477-.592 1.731-2.343 2.477-3.917 2.334-1.242-.113-2.307-.74-3.013-1.647-.961 1.253-2.45 2.011-4.092 1.78-2.581-.363-4.127-2.971-3.76-5.578.366-2.606 2.571-4.688 5.152-4.325 1.019.143 1.877.637 2.519 1.342l1.803.258-.507 3.549c-.187 1.31.761 2.509 2.079 2.629.915.083 1.627-.356 1.843-.99.2-.585.345-1.224.345-1.83 0-4.556-3.694-8.25-8.25-8.25zm-.111 5.274c-1.247-.175-2.645.854-2.893 2.623-.249 1.769.811 3.143 2.058 3.319 1.247.175 2.645-.854 2.893-2.623.249-1.769-.811-3.144-2.058-3.319z"></path></g></svg>'); ?> <?php $comments->reply('<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" class="" ><g><path d="M12 3.786c-4.556 0-8.25 3.694-8.25 8.25s3.694 8.25 8.25 8.25c1.595 0 3.081-.451 4.341-1.233l1.054 1.7c-1.568.972-3.418 1.534-5.395 1.534-5.661 0-10.25-4.589-10.25-10.25S6.339 1.786 12 1.786s10.25 4.589 10.25 10.25c0 .901-.21 1.77-.452 2.477-.592 1.731-2.343 2.477-3.917 2.334-1.242-.113-2.307-.74-3.013-1.647-.961 1.253-2.45 2.011-4.092 1.78-2.581-.363-4.127-2.971-3.76-5.578.366-2.606 2.571-4.688 5.152-4.325 1.019.143 1.877.637 2.519 1.342l1.803.258-.507 3.549c-.187 1.31.761 2.509 2.079 2.629.915.083 1.627-.356 1.843-.99.2-.585.345-1.224.345-1.83 0-4.556-3.694-8.25-8.25-8.25zm-.111 5.274c-1.247-.175-2.645.854-2.893 2.623-.249 1.769.811 3.143 2.058 3.319 1.247.175 2.645-.854 2.893-2.623.249-1.769-.811-3.144-2.058-3.319z"></path></g></svg>'); ?>
@ -122,3 +127,26 @@ function threadedComments($comments, $options) {
<?php } ?> <?php } ?>
</li> </li>
<?php } ?> <?php } ?>
<style>.custom-span {
display: inline-flex;
align-items: center;
font-weight: 500; /* Equivalent to font-medium */
border-radius: 0.375rem; /* Equivalent to rounded-md */
font-size: 0.75rem; /* Equivalent to text-xs */
padding-left: 1.5px; /* Equivalent to px-1.5 */
padding-right: 1.5px; /* Equivalent to px-1.5 */
padding-top: 0.5px; /* Equivalent to py-0.5 */
padding-bottom: 0.5px; /* Equivalent to py-0.5 */
border: 1px solid var(--farallon-border-color); /* ring-1 and ring-inset with ring-gray-300 */
color: var(--farallon-text-gray); /* text-gray-700 */
background: var(--farallon-background-gray); /* bg-gray-50 */
}
/* Dark mode styles */
@media (prefers-color-scheme: dark) {
.custom-span {
border-color: var(--farallon-hover-color); /* ring-gray-700 */
color: var(--farallon-hover-color); /* text-gray-200 */
background-color: var(--farallon-background-gray); /* bg-gray-800 */
}
}</style>