Skip to content

Commit b6ab85f

Browse files
committed
highlight admin name in comments
1 parent e3c8540 commit b6ab85f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/webapp/WEB-INF/templates/fragments/comments.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
th:src="${#strings.isEmpty(comment.user.smallAvatarLink)} ? @{/images/no-avatar-small.png} :
1717
(${#strings.startsWith(comment.user.smallAvatarLink, 'http')} ? ${comment.user.smallAvatarLink} : (@{/uploads/} + ${comment.user.smallAvatarLink}))" />
1818
</a>
19-
<a class="comment-username" th:href="@{|/users/${comment.user.username}|}" th:text="${comment.user.username}"></a>
19+
<a class="comment-username" th:href="@{|/users/${comment.user.username}|}" th:text="${comment.user.username}"
20+
th:classappend="${comment.user.hasRole('ROLE_ADMIN')} ? 'comment-username-admin'"></a>
2021
</th:block>
2122
<span th:if="${comment.deleted}" class="deleted">[deleted]</span>
2223

src/main/webapp/css/blog.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ label.error {
146146
vertical-align: middle;
147147
}
148148

149+
.comment-username-admin {
150+
color: darkred;
151+
}
152+
149153
.comment-header .post-date {
150154
vertical-align: middle;
151155
}

0 commit comments

Comments
 (0)