Files
wp-fedistream/templates/partials/card-album.twig

32 lines
1.6 KiB
Twig
Raw Permalink Normal View History

{# Album card partial #}
<article class="fedistream-card fedistream-card--album">
<a href="{{ post.permalink }}" class="fedistream-card__link">
<div class="fedistream-card__image fedistream-card__image--square">
{% if post.thumbnail %}
<img src="{{ post.thumbnail }}" alt="{{ post.title|e('html_attr') }}" loading="lazy">
{% else %}
<div class="fedistream-card__placeholder fedistream-card__placeholder--album">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14.5c-2.49 0-4.5-2.01-4.5-4.5S9.51 7.5 12 7.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-5.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z"/></svg>
</div>
{% endif %}
</div>
<div class="fedistream-card__content">
<h3 class="fedistream-card__title">{{ post.title }}</h3>
{% if post.artist_name %}
<p class="fedistream-card__artist">{{ post.artist_name }}</p>
{% endif %}
<p class="fedistream-card__meta">
<span class="fedistream-card__type">{{ post.album_type_label }}</span>
{% if post.release_year %}
<span class="fedistream-card__year">{{ post.release_year }}</span>
{% endif %}
</p>
{% if post.total_tracks > 0 %}
<p class="fedistream-card__stats">
{{ post.total_tracks }} {{ post.total_tracks == 1 ? 'track' : 'tracks' }}
</p>
{% endif %}
</div>
</a>
</article>