]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix entry reading time 2724/head
authorSimounet <contact@simounet.net>
Tue, 27 Dec 2016 21:37:24 +0000 (22:37 +0100)
committerSimounet <contact@simounet.net>
Tue, 27 Dec 2016 21:37:42 +0000 (22:37 +0100)
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig

index 56442116579c2bff1fe7c976e98a4cacd6003aa0..d278da1b91d988bc31073b24abf6b3ad1d9e49fc 100644 (file)
@@ -1,8 +1,6 @@
 <div class="card-action">
     <span class="reading-time grey-text">
-        <i class="material-icons" title="{{ 'entry.list.reading_time'|trans }}">timer</i>
-        {{ entry.readingTime / app.user.config.readingSpeed|round }} min&nbsp;
-
+        {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
         <i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i>
         <span class="hide-on-med-and-down">&nbsp;{{ entry.createdAt|date('Y-m-d') }}</span>
     </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 (file)
index 0000000..1a932a9
--- /dev/null
@@ -0,0 +1,7 @@
+{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
+<i class="material-icons">timer</i>
+{% 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 %}
index 0cbf1999d1e826ff36ab411889999c1ba7146533..46f89e19d8eb86dd0e5bfd3c9ee2e5304ca58f31 100644 (file)
         <aside>
             <ul class="tools">
                 <li>
-                    {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
-                    <i class="material-icons">timer</i>
-                    {% 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 %}
+                    {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
                 </li>
                 <li>
                     <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>