diff --git a/src/Controller/Actor.php b/src/Controller/Actor.php index 9051e05523..790e8e1779 100644 --- a/src/Controller/Actor.php +++ b/src/Controller/Actor.php @@ -128,10 +128,21 @@ class Actor extends ActorController } } + $notes = DB::dql( + <<<'EOF' + select n from note n + join activity a with n.id = a.object_id + join group_inbox gi with a.id = gi.activity_id + where a.object_type = 'note' and gi.group_id = :group_id + EOF, + ['group_id' => $group->getId()], + ); + return [ '_template' => 'actor/group_view.html.twig', 'actor' => $group, 'nickname' => $group->getNickname(), + 'notes' => $notes, ]; } } diff --git a/templates/actor/group_view.html.twig b/templates/actor/group_view.html.twig index fc41bb84df..193d2fbc8b 100644 --- a/templates/actor/group_view.html.twig +++ b/templates/actor/group_view.html.twig @@ -1,7 +1,7 @@ {% extends 'stdgrid.html.twig' %} {% import '/cards/note/view.html.twig' as noteView %} -{% set nickname = nickname|escape %} + {% block title %}{{ nickname }}{% endblock %} @@ -20,9 +20,13 @@
{% if notes is defined and notes is not empty %} - {% for note in notes %} + {% for conversation in notes %} {% block current_note %} - {{ noteView.macro_note(note, null) }} + {% if conversation is instanceof('array') %} + {{ noteView.macro_note(conversation['note'], conversation['replies']) }} + {% else %} + {{ noteView.macro_note(conversation) }} + {% endif %}
{% endblock current_note %} {% endfor %} diff --git a/templates/actor/view.html.twig b/templates/actor/view.html.twig index bd10975741..6428d0f0b5 100644 --- a/templates/actor/view.html.twig +++ b/templates/actor/view.html.twig @@ -18,9 +18,13 @@
{% if notes is defined and notes is not empty %} - {% for note in notes %} + {% for conversation in notes %} {% block current_note %} - {{ noteView.macro_note(note, null) }} + {% if conversation is instanceof('array') %} + {{ noteView.macro_note(conversation['note'], conversation['replies']) }} + {% else %} + {{ noteView.macro_note(conversation) }} + {% endif %}
{% endblock current_note %} {% endfor %}