From 5d8bd6c74a153a1508b2658619923b6f3febad82 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Wed, 1 Dec 2021 21:04:51 +0000 Subject: [PATCH] [TWIG][Note] Add single note view --- src/Controller/Note.php | 2 +- templates/note/view.html.twig | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 templates/note/view.html.twig diff --git a/src/Controller/Note.php b/src/Controller/Note.php index 44ba5bb41a..3fd19b3ffe 100644 --- a/src/Controller/Note.php +++ b/src/Controller/Note.php @@ -49,6 +49,6 @@ class Note extends Controller */ public function NoteShow(Request $request, int $id) { - return $this->note($id, fn ($note) => ['_template' => '/cards/note/view.html.twig', 'note' => $note]); + return $this->note($id, fn ($note) => ['_template' => '/note/view.html.twig', 'note' => $note]); } } diff --git a/templates/note/view.html.twig b/templates/note/view.html.twig new file mode 100644 index 0000000000..8af9432527 --- /dev/null +++ b/templates/note/view.html.twig @@ -0,0 +1,22 @@ +{% extends 'stdgrid.html.twig' %} +{% import '/cards/note/view.html.twig' as noteView %} + +{% block title %}{{ note.getActorNickname() ~ '\'s note' | trans }}{% endblock %} + +{% block stylesheets %} + {{ parent() }} + +{% endblock stylesheets %} + +{% block body %} + {# Backwards compatibility with hAtom 0.1 #} +
+
+ {% if note is defined and note is not empty %} + {{ noteView.macro_note(note, null) }} + {% else %} +

{% trans %}No notes here.{% endtrans %}

+ {% endif %} +
+
+{% endblock body %}