material: add metadata to list view

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>
This commit is contained in:
Kevin Decherf 2019-04-27 22:48:28 +02:00
parent ea54c2adb1
commit 4b5b228650
4 changed files with 47 additions and 16 deletions

View 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 {

View File

@ -173,6 +173,10 @@
.row .col {
padding: 0;
}
.card-stacked div.metadata .reading-time {
display: none;
}
}
@media screen and (max-width: 310px),

View 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>

View 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>