aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-12-28 18:11:01 +0100
committerGitHub <noreply@github.com>2016-12-28 18:11:01 +0100
commit90f6ee4dbe761f97edf0bf87ffeb1f75acec6c25 (patch)
treef01741d64ae0177a31743a7f86b90baa1a7c8d3d /src
parent92ba3b5c0dcd8a0d03f592a28b0e26ebd7b045fa (diff)
parent6ed615ac742a8a4e410d0726e8cec7bd76660d03 (diff)
downloadwallabag-90f6ee4dbe761f97edf0bf87ffeb1f75acec6c25.tar.gz
wallabag-90f6ee4dbe761f97edf0bf87ffeb1f75acec6c25.tar.zst
wallabag-90f6ee4dbe761f97edf0bf87ffeb1f75acec6c25.zip
Merge pull request #2724 from Simounet/fix/reading-time
Fix entry reading time
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig7
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig8
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&nbsp;
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">&nbsp;{{ entry.createdAt|date('Y-m-d') }}</span> 5 <span class="hide-on-med-and-down">&nbsp;{{ 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>