aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note_page.php
blob: 647c64e0e2b5741ebf0ec6b486d31a7d6e997654 (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
30
31
32
33
34
35
36
<?php

/** @var \Digitigrade\Model\Note $note */

use Digitigrade\FormattingProvider;
use Digitigrade\Model\UserAccount;
use Digitigrade\UserSettings;

$page = $note->getPage();

call_template('skeleton', ['pageTitle' => $page->title, 'renderTitleHeading' => false], function () use ($note, $page) { ?>
    <div class="notePage">
        <article lang="<?= htmlspecialchars($note->language) ?>">
            <h1><?= htmlspecialchars($page->title) ?></h1>
            <a class="pageAuthor" href="/@/<?= htmlspecialchars($note->author->getFullHandle()) ?>">
                <?php call_template('actor_avatar', ['actor' => $note->author]); ?>
                <span><?= __f(
                    'note.page.author',
                    '<span class="displayName">' . htmlspecialchars($note->author->displayName) . '</span>'
                ) ?></span>
            </a>
            <div class="created">
                <?= __f('note.page.created', format_datetime($note->created)) ?>
            </div>
            <?php if (isset($note->modified) && $note->modified != $note->created): ?>
                <div class="modified">
                    <?= __f('note.page.modified', format_datetime($note->modified)) ?>
                </div>
            <?php endif; ?>
            <hr>
            <div class="pageContent">
                <?= $page->getBestContentAsHtml() ?>
            </div>
        </article>
    </div>
<?php });