aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
diff options
context:
space:
mode:
authorwinter2025-01-16 18:33:18 +0000
committerwinter2025-01-16 18:33:18 +0000
commit8de5608976dc8a73a400267601acb4c8e127de5a (patch)
treea907dd4c4e55e331979cd9ce14852592af2654a0 /templates/note.php
parente3a0248c3b1762abf5138fbd1b8228601006d44d (diff)
note privacy and summary stuff
Diffstat (limited to 'templates/note.php')
-rw-r--r--templates/note.php33
1 files changed, 26 insertions, 7 deletions
diff --git a/templates/note.php b/templates/note.php
index 0a19475..0de2168 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -1,5 +1,6 @@
<?php
use Digitigrade\Model\InteractionKind;
+use Digitigrade\Model\NotePrivacyScope;
use Digitigrade\Model\UserAccount;
$user = UserAccount::findByCurrentSession();
@@ -26,18 +27,36 @@ if ($user != null) {
)
?>
</a>
+ <span class="privacyScope inlineIcon material-symbols-outlined" title="<?= match ($note->privacy->scope) {
+ NotePrivacyScope::NONE => __('note.privacy.scope.none'),
+ NotePrivacyScope::MUTUALS => __('note.privacy.scope.mutuals'),
+ NotePrivacyScope::FOLLOWERS => __('note.privacy.scope.followers'),
+ NotePrivacyScope::PUBLIC => __('note.privacy.scope.public')
+ } . '">' . match ($note->privacy->scope) {
+ NotePrivacyScope::NONE => 'lock',
+ NotePrivacyScope::MUTUALS => 'group',
+ NotePrivacyScope::FOLLOWERS => 'groups',
+ NotePrivacyScope::PUBLIC => 'public'
+ } ?></span>
</div>
<?php if (isset($note->inReplyTo)): ?>
- <div class="replyInfo">
- <a href="/@/<?= $note->inReplyTo->author->getFullHandle() ?>/note/<?= $note->inReplyTo->id ?>">
- <span class="material-symbols-outlined inlineIcon">reply</span>
- <?= sprintf(__('note.info.replyTo'),
- '<b>' . $note->inReplyTo->author->displayName) . '</b>' ?>
- </a>
+ <div class=" replyInfo">
+ <a href="/@/<?= $note->inReplyTo->author->getFullHandle() ?>/note/<?= $note->inReplyTo->id ?>">
+ <span class="material-symbols-outlined inlineIcon">reply</span>
+ <?= sprintf(__('note.info.replyTo'),
+ '<b>' . $note->inReplyTo->author->displayName) . '</b>' ?>
+ </a>
</div>
<?php endif; ?>
<div class="content">
- <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
+ <?php if (isset($note->summary)): ?>
+ <details>
+ <summary><?= htmlspecialchars($note->summary) ?></summary>
+ <?php endif; ?>
+ <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
+ <?php if (isset($note->summary)): ?>
+ </details>
+ <?php endif; ?>
</div>
<div class="buttons">
<?php foreach (['like', 'dislike', 'reshare'] as $action) {