aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
diff options
context:
space:
mode:
authorwinter2025-03-15 18:35:59 +0000
committerwinter2025-03-15 18:52:54 +0000
commit61b122e88cc6783b4d0cf5142a22002f8e558c60 (patch)
tree847b864a93f716157456891d4526077e5f0b93f7 /templates/note.php
parentcb904ef3fb05ab106d5e5e12f6273b8117db4216 (diff)
implement pages
Diffstat (limited to 'templates/note.php')
-rw-r--r--templates/note.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/templates/note.php b/templates/note.php
index 759a7c7..c80eace 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -17,7 +17,7 @@ if ($user != null) {
$interactions = $note->getInteractionsWithAuthor($user->actor);
$interKinds = array_map(fn($inter) => $inter->kind, $interactions);
}
-$pathToSelf = '/@/' . $note->author->getFullHandle() . '/note/' . $note->id;
+$pathToSelf = $note->getLocalUiHref();
?>
<article class="note <?= ($selected ?? false) ? 'selected' : '' ?>">
@@ -36,9 +36,9 @@ $pathToSelf = '/@/' . $note->author->getFullHandle() . '/note/' . $note->id;
} ?>
</span>
<a class="timestamp" href="<?= htmlspecialchars($pathToSelf) ?>">
- <?= format_datetime($note->created, $prefs?->get('locale.timezone'))
+ <?= format_datetime($note->created)
. (isset($note->modified) && $note->modified != $note->created
- ? ' (' . format_datetime($note->modified, $prefs?->get('locale.timezone')) . ')'
+ ? ' (' . format_datetime($note->modified) . ')'
: ''
) ?>
</a>
@@ -81,7 +81,11 @@ $pathToSelf = '/@/' . $note->author->getFullHandle() . '/note/' . $note->id;
<summary><?= htmlspecialchars($note->summary) ?></summary>
<?php endif; ?>
<div class="content" lang="<?= $note->language ?>">
- <?= $note->getBestContentAsHtml() ?>
+ <?php if ($note->hasPage()): ?>
+ <?= __f('note.page.summaryMessage', htmlspecialchars($note->getPage()->title)) ?>
+ <?php else: ?>
+ <?= $note->getBestContentAsHtml() ?>
+ <?php endif; ?>
</div>
<?php if (count($note->attachments) > 0): ?>
@@ -105,6 +109,13 @@ $pathToSelf = '/@/' . $note->author->getFullHandle() . '/note/' . $note->id;
</details>
<?php endif; ?>
+ <?php if ($note->hasPage()): ?>
+ <a class="button secondary minWidth" href="<?= $note->getLocalUiHref(true) ?>">
+ <span class="material-symbols article-outline"></span>
+ <span><?= __('note.openPage') ?></span>
+ </a>
+ <?php endif; ?>
+
<div class="buttons">
<?php foreach (['like', 'dislike', 'reshare'] as $action) {
$kind = InteractionKind::from($action);