refactor: the author of the post uses the owner field

Fixes https://github.com/halo-dev/theme-earth/issues/18
This commit is contained in:
Ryan Wang
2022-11-16 10:52:33 +08:00
parent 58fb80b0e2
commit f260f28db2
4 changed files with 22 additions and 22 deletions

View File

@@ -57,17 +57,17 @@
th:text="${post.status.excerpt}"
th:classappend="${list_layout == 'grid_3' ? ' sm:line-clamp-8' : ''}"
></p>
<div class="mt-4 flex flex-1 items-center justify-start gap-2" th:with="contributor = ${post.contributors[0]}">
<div class="mt-4 flex flex-1 items-center justify-start gap-2">
<img
th:src="${contributor.avatar ?: #theme.assets('/images/default-avatar.svg')}"
th:title="${contributor.displayName}"
th:alt="${contributor.displayName}"
th:src="${post.owner.avatar ?: #theme.assets('/images/default-avatar.svg')}"
th:title="${post.owner.displayName}"
th:alt="${post.owner.displayName}"
class="h-8 w-8 rounded-full border drop-shadow-sm dark:border-slate-700"
/>
<span
class="text-sm font-medium text-gray-900 dark:text-slate-100"
th:if="${#strings.isEmpty(contributor.avatar)}"
th:text="${contributor.displayName}"
th:if="${#strings.isEmpty(post.owner.avatar)}"
th:text="${post.owner.displayName}"
></span>
<span
class="text-sm tabular-nums text-gray-600 dark:text-slate-300"