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>
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 {
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 {
}
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;
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 {
.row .col {
padding: 0;
}
+
+ .card-stacked div.metadata .reading-time {
+ display: none;
+ }
}
@media screen and (max-width: 310px),
<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>
<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>