From e0588a6113ff6b3c1000fa6c82629f81fb5e05b5 Mon Sep 17 00:00:00 2001 From: winter Date: Sat, 15 Mar 2025 18:53:29 +0000 Subject: [refactor] move some templates to subdirs --- templates/note/note.php | 176 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 templates/note/note.php (limited to 'templates/note/note.php') diff --git a/templates/note/note.php b/templates/note/note.php new file mode 100644 index 0000000..7cef342 --- /dev/null +++ b/templates/note/note.php @@ -0,0 +1,176 @@ +getInteractionsWithAuthor($user->actor); + $interKinds = array_map(fn($inter) => $inter->kind, $interactions); +} +$pathToSelf = $note->getLocalUiHref(); +?> +
+ + + $note->author]); ?> + + +
+ +
+ author->displayName) ?> + + author->pronouns) && trim($note->author->pronouns) != '') { + echo htmlspecialchars($note->author->pronouns); + } ?> + + + created) + . (isset($note->modified) && $note->modified != $note->created + ? ' (' . format_datetime($note->modified) . ')' + : '' + ) ?> + + +
+ + inReplyTo)): ?> + + mentions) > 0): ?> +
+ + + '' . htmlspecialchars($m->displayName) . '', + $note->mentions + ))) ?> + +
+ + + summary)): ?> +
+ summary) ?> + +
+ hasPage()): ?> + getPage()->title)) ?> + + getBestContentAsHtml() ?> + +
+ + attachments) > 0): ?> +
+ attachments as $attachment) { + call_template('note/attachment', ['attachment' => $attachment]); + } ?> +
+ + + getLinkPreviews() as $preview) { + call_template('note/link_preview', ['preview' => $preview]); + if (++$i > $MAX_PREVIEW_CARDS) + break; + } + ?> + + summary)): ?> +
+ + + hasPage()): ?> + + + + + + +
+ $action, + 'note' => $note, + 'active' => in_array($kind, $interKinds), + 'count' => $note->countInteractionsOfKind($kind), + 'disabled' => $actionsDisabled + ]); + } + call_template('note/reply_button', [ + 'note' => $note, + 'count' => $note->countReplies(), + 'disabled' => $actionsDisabled + ]); + ?> +
+ +
  • + +
  • + author->isLocal && ($note->author == $user?->actor || $user?->isAdmin)): ?> +
  • + +
  • + + author->isLocal): ?> +
  • + + + + +
  • + + +
    +
    + + $note]); ?> +
    +
    \ No newline at end of file -- cgit v1.3