1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Upgrade to Twig 3

This commit is contained in:
Jeremy Benoist 2022-12-15 12:32:16 +01:00
parent e62a9d05cc
commit 28abfe264a
No known key found for this signature in database
GPG key ID: 7168D5DD29F38552
10 changed files with 313 additions and 58 deletions

View file

@ -3,7 +3,7 @@
<i class="grey-text text-darken-4 activator material-icons right">more_vert</i>
{% endif %}
<a href="{{ path('view', {'id': entry.id}) }}" title="{{ entry.title|striptags|e('html_attr') }}" class="card-title dot-ellipsis dot-resize-update">
{{ entry.title|striptags|truncate(80, true, '…')|default('entry.default_title'|trans)|raw }}
{{ entry.title|striptags|u.truncate(80, '…', false)|default('entry.default_title'|trans)|raw }}
</a>
<div class="{{ subClass|default('original grey-text') }}">

View file

@ -18,7 +18,7 @@
<i class="card-title activator grey-text text-darken-4 material-icons right">clear</i>
<span class="card-title">
<a href="{{ path('view', {'id': entry.id}) }}" title="{{ entry.title|striptags|e('html_attr') }}">
{{ entry.title|striptags|truncate(80, true, '…')|raw }}
{{ entry.title|striptags|u.truncate(80, '…', false)|raw }}
</a>
</span>

View file

@ -274,7 +274,7 @@
<li>
<i class="material-icons grey-text" title="{{ 'entry.view.provided_by'|trans }}">launch</i>
<a href="{{ entry.originUrl|e }}" target="_blank" rel="noopener" class="tool grey-text">
{{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }}
{{ entry.originUrl|striptags|removeSchemeAndWww|u.truncate(32) }}
</a>
</li>
{% endif %}

View file

@ -31,7 +31,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
$this->rootDir = $rootDir;
}
public function getGlobals()
public function getGlobals(): array
{
return [];
}

View file

@ -77,7 +77,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
*/
public function sendAuthCode(TwoFactorInterface $user): void
{
$template = $this->twig->loadTemplate('@WallabagUser/TwoFactor/email_auth_code.html.twig');
$template = $this->twig->load('@WallabagUser/TwoFactor/email_auth_code.html.twig');
$subject = $template->renderBlock('subject', []);
$bodyHtml = $template->renderBlock('body_html', [