Merge pull request #3745 from burkemw3/patch-3

Add placeholder image to card-based gallery entries page
This commit is contained in:
Jérémy Benoist 2018-10-16 07:45:22 +00:00 committed by GitHub
commit 0658ce4f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 18 deletions

View file

@ -123,6 +123,12 @@ main {
display: block;
}
.card-image .placeholder {
background-color: #111;
filter: invert(100%);
-webkit-filter: invert(100%);
}
&.sw {
max-width: 370px;
margin-left: auto;

View file

@ -1,14 +0,0 @@
<div class="card">
<div class="card-body">
<div class="card-image waves-effect waves-block waves-light">
<ul class="card-entry-labels">
{% for tag in entry.tags | slice(0, 3) %}
<li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
{% endfor %}
</ul>
</div>
{% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry} only %}
</div>
{% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %}
</div>

View file

@ -7,7 +7,11 @@
{% endfor %}
</ul>
<a href="{{ path('view', { 'id': entry.id }) }}">
{% if entry.previewPicture is null %}
<span class="preview placeholder" style="background-image: url({{ asset('wallassets/themes/_global/img/logo-square.svg') }});"></span>
{% else %}
<span class="preview" style="background-image: url({{ entry.previewPicture }})"></span>
{% endif %}
</a>
</div>
{% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withPreview': true} only %}

View file

@ -39,11 +39,9 @@
<li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
{% if listMode == 1 %}
{% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %}
{% elseif entry.previewPicture is null %}
{% include "@WallabagCore/themes/material/Entry/_card_no_preview.html.twig" with {'entry': entry} only %}
{% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %}
{% include "@WallabagCore/themes/material/Entry/_card_full_image.html.twig" with {'entry': entry} only %}
{% elseif not entry.previewPicture is null %}
{% else %}
{% include "@WallabagCore/themes/material/Entry/_card_preview.html.twig" with {'entry': entry} only %}
{% endif %}
</li>

File diff suppressed because one or more lines are too long