From 25dc07d3c9d88dcb84444d69fd0b4822315c3fac Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 23 Jun 2016 09:06:54 +0200 Subject: [PATCH] Add tags on entries view Should be tested on old browsers --- .../static/themes/material/css/main.css | 38 +++++++++++++++++++ .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../themes/material/Entry/entries.html.twig | 19 ++++++++++ 4 files changed, 59 insertions(+) diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 473b0308..e70bb2b1 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -342,6 +342,44 @@ main ul.row { line-height: 32px; } +.card .card-entry-labels { + position: absolute; + top:10px; + z-index: 90; + max-width: 50%; +} + +.card .card-entry-labels li { + margin: 10px 10px 10px auto; + padding: 5px 12px 5px 16px; + background-color: rgba(0,151,167,0.85); + border-radius: 0 3px 3px 0; + color: #fff; + cursor: default; + max-height: 2em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.card .card-entry-labels-hidden { + margin-top: 5px; +} + +.card .card-entry-labels-hidden li { + display: inline-block; + background-color: rgba(0,151,167,0.85); + margin: 0 5px; + padding: 5px 12px; + border-radius: 3px; + color: #fff; + max-height: 2em; + max-width: calc(100% - 15px); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .card .card-content .estimatedTime { margin-bottom: 10px; } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index b65e4522..826bd470 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -144,6 +144,7 @@ entry: reading_time: 'estimated reading time' reading_time_minutes: 'estimated reading time: %readingTime% min' reading_time_less_one_minute: 'estimated reading time: < 1 min' + number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' original_article: 'original' toogle_as_read: 'Toggle mark as read' toogle_as_star: 'Toggle favorite' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 94300596..7c1464e1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -144,6 +144,7 @@ entry: reading_time: 'durée de lecture' reading_time_minutes: 'durée de lecture: %readingTime% min' reading_time_less_one_minute: 'durée de lecture: < 1 min' + number_of_tags: '{1}et un autre tag|]1,Inf[et %count% autres tags' original_article: 'original' toogle_as_read: 'Marquer comme lu/non lu' toogle_as_star: 'Marquer comme favori' 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 98616635..d245c8fd 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 @@ -26,6 +26,11 @@
{% if not entry.previewPicture is null %}
+
{% endif %} @@ -50,6 +55,11 @@ {% if entry.previewPicture is null %}

{{ entry.content|striptags|slice(0, 300)|raw }}…

+ {% endif %}
@@ -66,6 +76,15 @@

{{ entry.content|striptags|slice(0, 300)|raw }}…

+ + + {% if entry.tags | length > 2 %} + {{ 'entry.list.number_of_tags'|transchoice(entry.tags | length - 2) }} + {% endif %} {% endif %} -- 2.41.0