aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
blob: 83770aa4abf4d4b269070705e7bf88f421b35b7f (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
<article class="note">
    <a href="/@/<?= $note->author->getFullHandle() ?>">
        <?php call_template('actor_avatar', ['actor' => $note->author]); ?>
    </a>
    <div>
        <div class="infoLine">
            <span class="authorName"><?= $note->author->displayName ?></span>
            <span class="authorHandle">@<?= $note->author->getFullHandle() ?></span>
            <a class="timestamp" href="/@/<?= $note->author->getFullHandle() ?>/note/<?= $note->id ?>">
                <?= // TODO: localise
                    $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') . ')'
                        : ''
                    )
                    ?>
            </a>
        </div>
        <div class="content">
            <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
        </div>
        <div class="buttons">
            <?php foreach (['like', 'dislike', 'reshare'] as $action) {
                render_template('interaction_button', ['action' => $action, 'note' => $note]);
            } ?>
        </div>
    </div>
</article>