]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
material: add metadata to list view 3942/head
authorKevin Decherf <kevin@kdecherf.com>
Sat, 27 Apr 2019 20:48:28 +0000 (22:48 +0200)
committerKevin Decherf <kevin@kdecherf.com>
Wed, 1 May 2019 13:47:48 +0000 (15:47 +0200)
Add reading time and creation date to rows of list view.
Refactor styles using a sass mixin.

Fixes #3838

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
app/Resources/static/themes/material/css/cards.scss
app/Resources/static/themes/material/css/media_queries.scss
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig

index 68001a014412af35ff9dafc0bfb7968a39ec781a..0cdc74573eab3bd69393ee4be562a29dc59fdeaa 100644 (file)
@@ -18,6 +18,24 @@ main {
   overflow: hidden;
 }
 
+@mixin mixin-reading-time {
+  .reading-time {
+    display: inline-flex;
+    vertical-align: middle;
+
+    .card-reading-time,
+    .card-created-at {
+      display: inline-flex;
+    }
+
+    span {
+      margin-right: 5px;
+    }
+
+    @content;
+  }
+}
+
 .card {
   .card-content .card-title,
   .card-reveal .card-title {
@@ -98,19 +116,7 @@ main {
       margin-right: 5px !important;
     }
 
-    .reading-time {
-      display: inline-flex;
-      vertical-align: middle;
-
-      .card-reading-time,
-      .card-created-at {
-        display: inline-flex;
-      }
-
-      span {
-        margin-right: 5px;
-      }
-    }
+    @include mixin-reading-time;
   }
 
   .card-image {
@@ -224,10 +230,18 @@ a.original:not(.waves-effect) {
   }
 
   div.metadata {
+    overflow: hidden;
+    height: 1.5em;
+    display: flex;
+
+    ul.tags {
+      margin-left: 4px;
+    }
+
     .chip {
       background-color: $blueAccentColor;
       padding: 0 7px;
-      margin: auto 2px;
+      margin: auto 1px;
       border-radius: 6px;
       line-height: 22px;
       height: 22px;
@@ -244,6 +258,16 @@ a.original:not(.waves-effect) {
         padding-left: 8px;
       }
     }
+
+    @include mixin-reading-time {
+      padding: 0 5px;
+      flex-wrap: wrap;
+      margin-left: auto;
+
+      i.material-icons {
+        font-size: 20px;
+      }
+    }
   }
 
   div.card-content {
index 491eedce37d45a963fb08fdbefa028f044eb98f7..6f9d2a9551949136ee7279700c3b2c850c74236c 100644 (file)
   .row .col {
     padding: 0;
   }
+
+  .card-stacked div.metadata .reading-time {
+    display: none;
+  }
 }
 
 @media screen and (max-width: 310px),
index 1f3cd1a72393011b9678058dc69868812e63ebf9..1102a0bdb8bfac7b9b267dee154261a7d5621b32 100644 (file)
@@ -8,8 +8,11 @@
 
     <div class="{{ subClass|default('original grey-text') }}">
         <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool grey-text">{{ entry.domainName|removeWww }}</a>
-        {% if withTags is defined %}
+        {% if withMetadata is defined %}
             {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'entryId': entry.id, 'listClass': ' hide-on-med-and-down'} only %}
+            <div class="reading-time grey-text">
+                <div class="card-reading-time">{% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}</div>
+            </div>
         {% endif %}
     </div>
 </div>
index 1c00f2fa3f5f5d67193a2ccfb3a7a8932229d834..6a0950355612554446fb9e89da8e1871447c5df4 100644 (file)
@@ -5,7 +5,7 @@
             <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 %}
+    {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
     <ul class="tools-list hide-on-small-only">
         <li>
             <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>