From: Thomas Citharel Date: Wed, 28 Dec 2016 17:11:01 +0000 (+0100) Subject: Merge pull request #2724 from Simounet/fix/reading-time X-Git-Tag: 2.2.0~3^2~17 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=90f6ee4dbe761f97edf0bf87ffeb1f75acec6c25;hp=92ba3b5c0dcd8a0d03f592a28b0e26ebd7b045fa;p=github%2Fwallabag%2Fwallabag.git Merge pull request #2724 from Simounet/fix/reading-time Fix entry reading time --- diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig index 56442116..d278da1b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig @@ -1,8 +1,6 @@
- timer - {{ entry.readingTime / app.user.config.readingSpeed|round }} min  - + {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} today  {{ entry.createdAt|date('Y-m-d') }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig new file mode 100644 index 00000000..1a932a9f --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig @@ -0,0 +1,7 @@ +{% set readingTime = entry.readingTime / app.user.config.readingSpeed %} +timer +{% if readingTime > 0 %} + {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} +{% else %} + {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} +{% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 0cbf1999..46f89e19 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -214,13 +214,7 @@