diff --git a/src/Twig/Runtime.php b/src/Twig/Runtime.php index b61086f5b0..d1d0022505 100644 --- a/src/Twig/Runtime.php +++ b/src/Twig/Runtime.php @@ -60,11 +60,6 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface public function getNoteActions(Note $note) { - // Only show buttons if a user is logged in - if (Common::user() == null) { - return []; - } - $actions = []; Event::handle('add_note_actions', [$this->request, $note, &$actions]); return $actions; diff --git a/templates/network/public.html.twig b/templates/network/public.html.twig index 5b1a5a9cef..ca04206903 100644 --- a/templates/network/public.html.twig +++ b/templates/network/public.html.twig @@ -92,7 +92,7 @@ {% if notes is defined and notes is not empty %} {% for note in notes %} {% set id = note.getId() - 1 %} - {% include '/note/view.html.twig' with {'note': note} only %} + {% include '/note/view.html.twig' with {'note': note, 'have_user': have_user} only %} {% endfor %} {% else %}

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

diff --git a/templates/note/reply.html.twig b/templates/note/reply.html.twig index 20552ac9de..6510d82069 100644 --- a/templates/note/reply.html.twig +++ b/templates/note/reply.html.twig @@ -29,7 +29,7 @@ {{ parent() }}
- {% include '/note/view.html.twig' with {'note': note} only %} + {% include '/note/view.html.twig' with {'note': note, 'have_user': have_user} only %} {{ form(reply) }}
diff --git a/templates/note/view.html.twig b/templates/note/view.html.twig index a122ebfdd6..57375f686f 100644 --- a/templates/note/view.html.twig +++ b/templates/note/view.html.twig @@ -35,18 +35,15 @@
- {% for act in get_note_actions(note) %} - {{ form(act) }} - {% endfor %} - - - - - + {% if have_user %} + {% for act in get_note_actions(note) %} + {{ form(act) }} + {% endfor %} + {% endif %}
{% for reply in note.getReplies() %} - {% include '/note/view.html.twig' with {'note': reply, 'skip_reply_to': true} only %} + {% include '/note/view.html.twig' with {'note': reply, 'skip_reply_to': true, 'have_user': have_user} only %} {% endfor %}