From 49fb9e7cabef39c30579eee0301f1019a3251dcd Mon Sep 17 00:00:00 2001 From: Simounet Date: Thu, 21 Dec 2017 17:10:46 +0100 Subject: [PATCH] Card tags template shared --- .../static/themes/material/css/cards.scss | 4 ++++ .../themes/material/Entry/Card/_content.html.twig | 8 ++------ .../views/themes/material/Entry/_tags.html.twig | 14 ++++++++++++++ .../views/themes/material/Entry/entry.html.twig | 11 +---------- web/wallassets/material.css | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_tags.html.twig diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index 4a442228..8f7f8f7b 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -250,6 +250,10 @@ a.original:not(.waves-effect) { float: right; max-width: 6em; } + + .tags { + display: inline-block; + } } #content .collection .collection-item { diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig index 06dc0b6d..fc5bfc48 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig @@ -8,12 +8,8 @@
{{ entry.domainName|removeWww }} - {% if withTags %} - {% for tag in entry.tags | slice(0, 3) %} - - {{ tag.label }} - - {% endfor %} + {% if withTags is defined %} + {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'listClass': ' hide-on-med-and-down'} only %} {% endif %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_tags.html.twig new file mode 100644 index 00000000..144a105e --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_tags.html.twig @@ -0,0 +1,14 @@ +{% if tags is iterable and tags is not empty %} + +{% 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 86588a7b..273a9b57 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 @@ -268,16 +268,7 @@ {% endif %} - + {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags, 'withRemove': true} only %}