[CORE] Typo in GSFile and slight Twig weirdness in base template

This commit is contained in:
Hugo Sales 2021-04-28 20:16:59 +00:00
parent b1e514832b
commit be91fb754d
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 31 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class GSFile
bool $is_local = true, bool $is_local = true,
int $actor_id = null): Attachment int $actor_id = null): Attachment
{ {
Event::handle('HashFile', [$file->getPathname(), &$hash]); Event::handle('HashFile', [$sfile->getPathname(), &$hash]);
// The following properly gets the mimetype with `file` or other // The following properly gets the mimetype with `file` or other
// available methods, so should be safe // available methods, so should be safe
$mimetype = $sfile->getMimeType(); $mimetype = $sfile->getMimeType();

View File

@ -0,0 +1,25 @@
{% extends 'left/left.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public.css') }}"
media="screen and (min-width: 1300px)">
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public_mid.css') }}"
media="screen and (max-width: 1300px)">
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public_small.css') }}"
media="screen and (max-width: 750px)">
{% endblock %}
{# {% block header %} #}
{# {{ parent() }} #}
{# {% endblock %} #}
{# {% block left %} #}
{# {{ parent() }} #}
{# {% endblock %} #}
{% block body %}
<div class="content">
yooo
</div>
{% endblock body %}

View File

@ -18,8 +18,11 @@
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/' ~ stylesheet) }}"> <link rel='stylesheet' type='text/css' href="{{ asset('assets/css/' ~ stylesheet) }}">
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% for type, element in handle_event('ShowHeadElements', app.request) %} {% for arr in handle_event('ShowHeadElements', app.request) %}
<{{type}} rel="{{element['rel']}}" type="{{element['type']}}" href="{{element['href']}}" title="{{element['title']}}"> {# Only one element, but has dynamic value, can't access it directly #}
{% for type, element in arr %}
<{{type}} rel="{{element['rel']}}" type="{{element['type']}}" href="{{element['href']}}" title="{{element['title']}}">
{% endfor %}
{% endfor %} {% endfor %}
</head> </head>
<body> <body>