From 50243f0e3482fb7c10a05d79ae58b050f6e74254 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Aug 2015 22:09:57 +0200 Subject: [PATCH] fix #1357, truncate domain name if it's too loooong --- app/config/services.yml | 5 +++++ .../CoreBundle/Resources/views/Entry/entries.html.twig | 2 +- .../views/themes/material/Entry/entries.html.twig | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/config/services.yml b/app/config/services.yml index b3ec7c51..a7fa9bfe 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -12,3 +12,8 @@ services: class: Doctrine\Common\Cache\FilesystemCache arguments: - %kernel.cache_dir%/doctrine/metadata + + twig.extension.text: + class: Twig_Extensions_Extension_Text + tags: + - { name: twig.extension } diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig index 118a2f4b..3f5cf460 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig @@ -37,7 +37,7 @@
  • {% trans %}delete{% endtrans %}
  • {{ entry.domainName }}
  • -

    {{ entry.content|striptags|slice(0, 300) }}...

    +

    {{ entry.content|striptags|slice(0, 300) }}…

    {% endfor %} {% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index b45552f2..f896dec3 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -40,16 +40,16 @@ {% else %}
    {% trans %}estimated reading time: {% endtrans %} < 1 min
    {% endif %} -

    {{ entry.content|striptags|slice(0, 300) }}...

    +

    {{ entry.content|striptags|slice(0, 300) }}…

    - {{ entry.domainName }} + {{ entry.domainName | truncate(18) }}
    -- 2.41.0