aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
blob: 9c4f6097b3da03934b5255c2553a50a8ac9a00ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$fullHandle = $note->author->handle . ($note->author->isLocal ? '' : '@' . hostname_from_uri($note->author->uri));
?>
<article class="note">
    <a href="/@/<?= $fullHandle ?>">
        <picture>
            <source srcset="<?= $note->author->avatar ?>">
            <img class="authorAvatar" src="/static/default-avatar.svg">
        </picture>
    </a>
    <div>
        <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>
    </div>
</article>