From d8147cbd2d6084eac24270e7888e921b1ed8cf0f Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Tue, 23 Nov 2021 22:54:49 +0000 Subject: [PATCH] [PLUGINS][AttachmentShowRelated] Fixed note template error. Fixed if statement. [CORE][Controller] Commented CSP out. --- components/Right/templates/right/view.html.twig | 13 +++---------- .../attachmentRelatedNotes.html.twig | 4 +++- src/Core/Controller.php | 16 ++++++++-------- templates/base.html.twig | 4 ++-- templates/cards/note/view.html.twig | 7 ------- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/components/Right/templates/right/view.html.twig b/components/Right/templates/right/view.html.twig index b39d51836b..7c9d546cd0 100644 --- a/components/Right/templates/right/view.html.twig +++ b/components/Right/templates/right/view.html.twig @@ -24,16 +24,9 @@ {% endif %} {% set current_path = app.request.get('_route') %} - - {% if right_panel_vars is defined %} - {% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars}) %} - {{ block | raw }} - {% endfor %} - {% else %} - {% for block in handle_event('AppendRightPanelBlock', {'path': current_path}) %} - {{ block | raw }} - {% endfor %} - {% endif %} + {% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars | default }) %} + {{ block | raw }} + {% endfor %} diff --git a/plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig b/plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig index 0789bddb01..990966b20d 100644 --- a/plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig +++ b/plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig @@ -1,9 +1,11 @@ +{% import '/cards/note/view.html.twig' as noteView %} +
{{ 'Notes related' | trans }}
{% for note in related_notes %} - {% include '/cards/note/view.html.twig' with {'note' : note, 'hide_attachments': true, 'have_user': have_user} only %} + {{ noteView.macro_note_minimal(note) }} {% endfor %}
\ No newline at end of file diff --git a/src/Core/Controller.php b/src/Core/Controller.php index 910a327232..bb793043ad 100644 --- a/src/Core/Controller.php +++ b/src/Core/Controller.php @@ -149,14 +149,14 @@ abstract class Controller extends AbstractController implements EventSubscriberI if ($template !== null) { $event->setResponse($this->render($template, $this->vars)); - // Setting the Content-Security-Policy response header - $policy = "default-src 'self';" - . "script-src 'strict-dynamic' https: http:;" - . "object-src 'none'; base-uri 'none'"; - $potential_response = $event->getResponse(); - $potential_response->headers->set('Content-Security-Policy', $policy); - $potential_response->headers->set('X-Content-Security-Policy', $policy); - $potential_response->headers->set('X-WebKit-CSP', $policy); + /* // Setting the Content-Security-Policy response header + $policy = "default-src 'self';" + . "script-src 'strict-dynamic' https: http:;" + . "object-src 'none'; base-uri 'none'"; + $potential_response = $event->getResponse(); + $potential_response->headers->set('Content-Security-Policy', $policy); + $potential_response->headers->set('X-Content-Security-Policy', $policy); + $potential_response->headers->set('X-WebKit-CSP', $policy);*/ break; } else { diff --git a/templates/base.html.twig b/templates/base.html.twig index 13d408355f..1acca691ee 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -14,10 +14,10 @@ {% block stylesheets %} - - + {% for stylesheet in show_stylesheets(app.request.get('_route')) %} + {% endfor %} {% endblock %} diff --git a/templates/cards/note/view.html.twig b/templates/cards/note/view.html.twig index 812bc4e6e6..dd20af0d95 100644 --- a/templates/cards/note/view.html.twig +++ b/templates/cards/note/view.html.twig @@ -8,13 +8,6 @@ {% endif %} {% endblock note_actions %} -{% block note_reply_to %} - {% set reply_to = note.getReplyToNickname()%} - {% if reply_to is not null %} - {% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %} - {% endif %} -{% endblock note_reply_to %} - {% block note_replies %} {% if replies is defined and replies is not empty %}