diff options
| author | winter | 2024-12-23 21:03:21 +0000 |
|---|---|---|
| committer | winter | 2024-12-23 21:03:21 +0000 |
| commit | 8f1f84d92cabf3a606585bc79eba14e63c149b60 (patch) | |
| tree | 04852c50d2f037769471b24027ba9114967146b4 /templates/note.php | |
| parent | 505d25e29f1c13403bfbfe7cd9d1ab125be87a4b (diff) | |
improve timelines
Diffstat (limited to 'templates/note.php')
| -rw-r--r-- | templates/note.php | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/templates/note.php b/templates/note.php index 93a22fd..9c4f609 100644 --- a/templates/note.php +++ b/templates/note.php @@ -1,12 +1,27 @@ +<?php +$fullHandle = $note->author->handle . ($note->author->isLocal ? '' : '@' . hostname_from_uri($note->author->uri)); +?> <article class="note"> - <picture> - <source srcset="<?= $note->author->avatar ?>"> - <img class="authorAvatar" src="/static/default-avatar.svg"> - </picture> + <a href="/@/<?= $fullHandle ?>"> + <picture> + <source srcset="<?= $note->author->avatar ?>"> + <img class="authorAvatar" src="/static/default-avatar.svg"> + </picture> + </a> <div> - <a class="authorName" <?= isset($note->author->homepage) ? 'href="' . $note->author->homepage . '"' : '' ?>> - <?= $note->author->displayName ?> - </a> + <div class="infoLine"> + <span class="authorName"><?= $note->author->displayName ?></span> + <span class="authorHandle">@<?= $fullHandle ?></span> + <span class="timestamp"> + <?= + $note->created->format('Y-m-d \a\t H:i') + . (isset($note->modified) && $note->modified != $note->created + ? ' (edited ' . $note->modified->format('Y-m-d \a\t H:i') . ')' + : '' + ) + ?> + </span> + </div> <div class="postContent"> <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?> </div> |
