]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
material: fix missing thumbnail on list view 3782/head
authorKevin Decherf <kevin@kdecherf.com>
Sun, 25 Nov 2018 14:00:08 +0000 (15:00 +0100)
committerKevin Decherf <kevin@kdecherf.com>
Sun, 25 Nov 2018 14:00:08 +0000 (15:00 +0100)
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
app/Resources/static/themes/material/css/cards.scss
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig

index 6691adc6e4a7ec247db63612307701cdb3cff822..9e3599d5ea020efbf1bbc9eea6abb5f2f21e3e52 100644 (file)
@@ -116,18 +116,6 @@ main {
     height: 13.5em;
   }
 
-  .card-image .preview,
-  .card-fullimage .preview {
-    height: 100%;
-    background: no-repeat 50%/cover;
-    background-color: #efefef;
-    display: block;
-
-    &--default {
-      background-size: contain;
-    }
-  }
-
   &.sw {
     max-width: 370px;
     margin-left: auto;
@@ -142,6 +130,19 @@ a.original:not(.waves-effect) {
   display: block;
 }
 
+.card .card-image .preview,
+.card .card-fullimage .preview,
+.card-stacked .preview {
+  height: 100%;
+  background: no-repeat 50%/cover;
+  background-color: #efefef;
+  display: block;
+
+  &--default {
+    background-size: contain;
+  }
+}
+
 .card-entry-labels li,
 .card-tag-labels li {
   margin: 10px 10px 10px auto;
@@ -210,16 +211,11 @@ a.original:not(.waves-effect) {
     text-align: right;
   }
 
-  .preview {
+  .card-preview {
     max-width: 100px;
-    height: auto;
+    max-height: 50px;
     margin-right: 10px;
     flex: 1;
-
-    img {
-      max-width: 100%;
-      max-height: 100%;
-    }
   }
 
   div.metadata {
index 7c83c3bba712200a17c64aee1810a712c8bdc6d9..1c00f2fa3f5f5d67193a2ccfb3a7a8932229d834 100644 (file)
@@ -1,10 +1,9 @@
 <div class="card-stacked">
-    <div class="preview">
-        {% if entry.previewPicture is not null %}
-            <a href="{{ path('view', { 'id': entry.id }) }}">
-                <img src="{{ entry.previewPicture }}" />
-            </a>
-        {% endif %}
+    <div class="card-preview">
+        <a href="{{ path('view', { 'id': entry.id }) }}">
+            {% set previewClassModifier = entry.previewPicture ? '' : ' preview--default' %}
+            <span class="preview{{ previewClassModifier }}" style="background-image: url({{ entry.previewPicture | default(asset('wallassets/themes/_global/img/logo-square.svg')) }})"></span>
+        </a>
     </div>
     {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withTags': true, 'subClass': 'metadata'} only %}
     <ul class="tools-list hide-on-small-only">