[TWIG][Note] Add single note view

This commit is contained in:
Eliseu Amaro 2021-12-01 21:04:51 +00:00
parent 6f543ccc06
commit 5d8bd6c74a
No known key found for this signature in database
GPG Key ID: 96DA09D4B97BC2D5
2 changed files with 23 additions and 1 deletions

View File

@ -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]);
}
}

View File

@ -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() }}
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/pages/feeds.css') }}" type="text/css">
{% endblock stylesheets %}
{% block body %}
{# Backwards compatibility with hAtom 0.1 #}
<main class="feed" tabindex="0" role="feed">
<div class="h-feed hfeed notes">
{% if note is defined and note is not empty %}
{{ noteView.macro_note(note, null) }}
{% else %}
<div id="empty-notes"><h1>{% trans %}No notes here.{% endtrans %}</h1></div>
{% endif %}
</div>
</main>
{% endblock body %}