From 2686457448372543fdf4f1fc54c4fd20f0f02c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 7 Aug 2015 22:20:30 +0200 Subject: store estimated reading time / filters on reading time --- .../Resources/views/Entry/entries.html.twig | 7 +-- .../Resources/views/Entry/entries.xml.twig | 4 +- .../views/themes/_global/public/css/style.css | 8 ++-- .../views/themes/baggy/public/css/main.css | 50 +++++++++++----------- .../views/themes/material/Entry/entries.html.twig | 5 ++- .../views/themes/material/public/css/print.css | 2 +- 6 files changed, 39 insertions(+), 37 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources') diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig index bf3caf09..7629ef35 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig @@ -21,11 +21,12 @@ {% if entries is empty %}

{% trans %}No articles found.{% endtrans %}

{% else %} +
{{ form_rest(form) }}
{% for entry in entries %} -
+

{{ entry.title|raw }}

- {% if entry.content| readingTime > 0 %} -
{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min
+ {% if entry.readingTime > 0 %} +
{% trans %}estimated reading time :{% endtrans %} {{ entry.readingTime }} min
{% else %}
{% trans %}estimated reading time :{% endtrans %} < 1 min
{% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig index 5ec9bc03..a39a8dc3 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig @@ -17,8 +17,8 @@ {{ entry.createdAt|date('D, d M Y H:i:s') }} 0 -%} - {% trans %}estimated reading time :{% endtrans %} {{ entry.content|readingTime }} min + {%- if entry.readingTime > 0 -%} + {% trans %}estimated reading time :{% endtrans %} {{ entry.readingTime }} min {%- else -%} {% trans %}estimated reading time :{% endtrans %} < 1 min {%- endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/_global/public/css/style.css b/src/Wallabag/CoreBundle/Resources/views/themes/_global/public/css/style.css index e3069b86..ffd9d022 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/_global/public/css/style.css +++ b/src/Wallabag/CoreBundle/Resources/views/themes/_global/public/css/style.css @@ -121,7 +121,7 @@ a:visited { font-size: 1.3em; } -#main #content .entrie { +#main #content .entry { margin-top: 15px; padding-bottom: 15px; border-bottom: 1px dashed #222; @@ -129,19 +129,19 @@ a:visited { } /* First entry */ -#main #content .results + .entrie { +#main #content .results + .entry { clear: both; margin-top: 0; } -#main .entrie .tools { +#main .entry .tools { float: right; text-align: right; list-style-type: none; opacity: 0.5; } -#main .entrie .tools .tool span { +#main .entry .tools .tool span { display: inline-block; width: 16px; height: 16px; diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css index e2844ccc..6090face 100755 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css @@ -322,7 +322,7 @@ footer a { letter-spacing:-5px; } -.listmode .entrie { +.listmode .entry { width: 100%!important; margin-left: 0!important; } @@ -343,7 +343,7 @@ footer a { top: -1px; } -.entrie { +.entry { background-color: #FFF; letter-spacing:normal; box-shadow: 0 3px 7px rgba(0,0,0,0.3); @@ -366,7 +366,7 @@ footer a { /* transition: all 0.5s ease; */ } -.entrie:before { +.entry:before { content: ""; width: 0; height: 0; @@ -384,7 +384,7 @@ footer a { transition: all 0.5s ease; } -.entrie:after { +.entry:after { content: ""; position: absolute; height: 7px; @@ -399,34 +399,34 @@ footer a { transition: all 0.5s ease; } -.entrie:hover { +.entry:hover { box-shadow: 0 3px 10px rgba(0,0,0,1); } -.entrie:hover:after { +.entry:hover:after { height: 40px; } -.entrie:hover:before { +.entry:hover:before { bottom: 2.4em; } -.entrie:hover h2 a { +.entry:hover h2 a { color: #666; } -.entrie h2 { +.entry h2 { text-transform: none; margin-bottom: 0; line-height: 1.2; } - .entrie h2:after { + .entry h2:after { content: none; } -.entrie h2 a { +.entry h2 a { display: block; text-decoration: none; color: #000; @@ -438,7 +438,7 @@ footer a { transition: all 0.5s ease; } /* -.entrie h2 a:after { +.entry h2 a:after { content: ""; position: absolute; top: 0; @@ -448,21 +448,21 @@ footer a { } */ -.entrie p { +.entry p { color: #666; font-size: 0.9em; line-height: 1.7; } - .entrie h2 a:first-letter { + .entry h2 a:first-letter { text-transform: uppercase; } -.entrie:hover .tools { +.entry:hover .tools { bottom: 0; } -.entrie .tools { +.entry .tools { position: absolute; bottom: -50px; left: 0; @@ -477,22 +477,22 @@ footer a { transition: all 0.5s ease; } - .entrie .tools a { + .entry .tools a { color: #666; text-decoration: none; display: block; padding: 0.4em; } - .entrie .tools a:hover { + .entry .tools a:hover { color: #FFF; } - .entrie .tools li { + .entry .tools li { display: inline-block; } -.entrie:nth-child(3n+1) { +.entry:nth-child(3n+1) { margin-left: 0; } @@ -941,13 +941,13 @@ pre code { ========================================================================== */ @media screen and (max-width: 1050px) { - .entrie { + .entry { width: 49%; } - .entrie:nth-child(3n+1) { + .entry:nth-child(3n+1) { margin-left: 1.5%; } - .entrie:nth-child(2n+1) { + .entry:nth-child(2n+1) { margin-left: 0; } } @@ -962,7 +962,7 @@ pre code { } @media screen and (max-width: 700px) { - .entrie { + .entry { width: 100%; margin-left: 0; } @@ -972,7 +972,7 @@ pre code { } @media screen and (max-width: 500px) { - .entrie { + .entry { width: 100%; margin-left: 0; } 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 fbdc1ffd..b9f1be49 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 @@ -18,6 +18,7 @@ {% if entries is not empty %}
{{ entries.count }} {% trans %}entries{% endtrans %}
+
{{ form_rest(form) }}
    {% for p in range(1, entries.nbPages) %}
  • @@ -38,8 +39,8 @@
    {{ entry.title|raw }} - {% if entry.content| readingTime > 0 %} -
    {% trans %}estimated reading time: {% endtrans %} {{ entry.content| readingTime }} min
    + {% if entry.readingTime > 0 %} +
    {% trans %}estimated reading time: {% endtrans %} {{ entry.readingTime }} min
    {% else %}
    {% trans %}estimated reading time: {% endtrans %} < 1 min
    {% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/print.css b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/print.css index 9dd6d295..2a799c44 100755 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/print.css +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/print.css @@ -25,7 +25,7 @@ body > footer, div.tools, header div, .messages, -.entrie + .results { +.entry + .results { display: none !important; } -- cgit v1.2.3