[CONTROLLER][Actor] Add group notes query and fixup template
This commit is contained in:
parent
6a8144003f
commit
e7dcea3f26
@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -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 @@
|
||||
<main class="feed" tabindex="0" role="feed">
|
||||
<div class="h-feed hfeed notes">
|
||||
{% 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 %}
|
||||
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
|
||||
{% endblock current_note %}
|
||||
{% endfor %}
|
||||
|
@ -18,9 +18,13 @@
|
||||
<main class="feed" tabindex="0" role="feed">
|
||||
<div class="h-feed hfeed notes">
|
||||
{% 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 %}
|
||||
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
|
||||
{% endblock current_note %}
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user