Browse Source

[PLUGINS][AttachmentShowRelated] Fixed note template error. Fixed if statement.

[CORE][Controller] Commented CSP out.
experimental
parent
commit
d8147cbd2d
Signed by: diogo <mail@diogo.site> GPG Key ID: 18D2D35001FBFAB0
5 changed files with 16 additions and 28 deletions
  1. +3
    -10
      components/Right/templates/right/view.html.twig
  2. +3
    -1
      plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig
  3. +8
    -8
      src/Core/Controller.php
  4. +2
    -2
      templates/base.html.twig
  5. +0
    -7
      templates/cards/note/view.html.twig

+ 3
- 10
components/Right/templates/right/view.html.twig View File

@@ -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 %}

</aside>
</div>


+ 3
- 1
plugins/AttachmentShowRelated/templates/attachmentShowRelated/attachmentRelatedNotes.html.twig View File

@@ -1,9 +1,11 @@
{% import '/cards/note/view.html.twig' as noteView %}

<section class="section-widget section-widget-padded">
<div class="section-title">
{{ 'Notes related' | trans }}
</div>

{% 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 %}
</section>

+ 8
- 8
src/Core/Controller.php View File

@@ -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 {


+ 2
- 2
templates/base.html.twig View File

@@ -14,10 +14,10 @@
</title>

{% block stylesheets %}
<link rel="preload" href="{{ asset('assets/default_theme/css/base.css') }}" as="style" type="text/css">
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/base.css') }}">
<link rel="stylesheet" type='text/css' href="{{ asset('assets/default_theme/css/base.css') }}">

{% for stylesheet in show_stylesheets(app.request.get('_route')) %}
<link rel="preload" {{ preload(asset(stylesheet), { as: 'style', nopush: true }) }}>
<link rel='stylesheet' type='text/css' href="{{ asset(stylesheet) }}">
{% endfor %}
{% endblock %}


+ 0
- 7
templates/cards/note/view.html.twig View File

@@ -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 %}
<div class="u-in-reply-to replies" tabindex="0" title="{{ 'Begin replies to ' | trans }} {{ nickname }}'s note!">


Loading…
Cancel
Save