From ed5f6b6eedbf818ec013438de63aba4f496bd5a5 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 28 Nov 2021 21:07:29 +0000 Subject: [PATCH] [COMPONENTS][Search][UI] Use base template and macros to display search results --- components/Search/Controller/Search.php | 1 + .../Search/templates/search/show.html.twig | 25 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/Search/Controller/Search.php b/components/Search/Controller/Search.php index a825a0bdf0..621faafa8f 100644 --- a/components/Search/Controller/Search.php +++ b/components/Search/Controller/Search.php @@ -54,6 +54,7 @@ class Search extends Controller '_template' => 'search/show.html.twig', 'notes' => $notes, 'actors' => $actors, + 'page' => 1, // TODO paginate ]; } } diff --git a/components/Search/templates/search/show.html.twig b/components/Search/templates/search/show.html.twig index 94dc9952d1..1ab99275f9 100644 --- a/components/Search/templates/search/show.html.twig +++ b/components/Search/templates/search/show.html.twig @@ -1,7 +1,20 @@ -{% for note in notes %} - {% include '/cards/note/view.html.twig' with {'note': note} %} -{% endfor %} +{% extends 'base.html.twig' %} + +{% import '/cards/note/view.html.twig' as noteView %} + +{% block body %} + {% for note in notes %} + {% block current_note %} +
+ {{ noteView.macro_note(note) }} +
+ {% endblock current_note %} + {% endfor %} + + {% for actor in actors %} + {% include 'actor/view.html.twig' with {'actor': actor} %} + {% endfor %} + + {{ "Page: " ~ page }} +{% endblock %} -{% for actor in actors %} - {% include 'actor/view.html.twig' with {'actor': actor} %} -{% endfor %}