diff options
author | Simounet <contact@simounet.net> | 2016-12-27 22:37:24 +0100 |
---|---|---|
committer | Simounet <contact@simounet.net> | 2016-12-27 22:37:42 +0100 |
commit | 6ed615ac742a8a4e410d0726e8cec7bd76660d03 (patch) | |
tree | 693a3bc535fcd828483703d695bf6749d649a386 /src/Wallabag | |
parent | 771934632833720c4d0560dc589f22d4f1bdb55e (diff) | |
download | wallabag-6ed615ac742a8a4e410d0726e8cec7bd76660d03.tar.gz wallabag-6ed615ac742a8a4e410d0726e8cec7bd76660d03.tar.zst wallabag-6ed615ac742a8a4e410d0726e8cec7bd76660d03.zip |
Fix entry reading time
Diffstat (limited to 'src/Wallabag')
3 files changed, 9 insertions, 10 deletions
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 @@ | |||
1 | <div class="card-action"> | 1 | <div class="card-action"> |
2 | <span class="reading-time grey-text"> | 2 | <span class="reading-time grey-text"> |
3 | <i class="material-icons" title="{{ 'entry.list.reading_time'|trans }}">timer</i> | 3 | {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} |
4 | {{ entry.readingTime / app.user.config.readingSpeed|round }} min | ||
5 | |||
6 | <i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i> | 4 | <i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i> |
7 | <span class="hide-on-med-and-down"> {{ entry.createdAt|date('Y-m-d') }}</span> | 5 | <span class="hide-on-med-and-down"> {{ entry.createdAt|date('Y-m-d') }}</span> |
8 | </span> | 6 | </span> |
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 @@ | |||
1 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} | ||
2 | <i class="material-icons">timer</i> | ||
3 | {% if readingTime > 0 %} | ||
4 | {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} | ||
5 | {% else %} | ||
6 | {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} | ||
7 | {% 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 @@ | |||
214 | <aside> | 214 | <aside> |
215 | <ul class="tools"> | 215 | <ul class="tools"> |
216 | <li> | 216 | <li> |
217 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} | 217 | {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} |
218 | <i class="material-icons">timer</i> | ||
219 | {% if readingTime > 0 %} | ||
220 | {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} | ||
221 | {% else %} | ||
222 | {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} | ||
223 | {% endif %} | ||
224 | </li> | 218 | </li> |
225 | <li> | 219 | <li> |
226 | <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> | 220 | <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> |