You've already forked wp-fedistream
WP FediStream - Stream music over ActivityPub Features: - Custom post types: Artist, Album, Track, Playlist - Custom taxonomies: Genre, Mood, License - User roles: Artist, Label - Admin dashboard with statistics - Frontend templates and shortcodes - Audio player with queue management - ActivityPub integration with actor support - WooCommerce product types for albums/tracks - User library with favorites and history - Notification system (in-app and email) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
106 lines
5.7 KiB
Twig
106 lines
5.7 KiB
Twig
{# Single album template #}
|
|
<article class="fedistream-single fedistream-single--album">
|
|
<header class="fedistream-single__header fedistream-single__header--album">
|
|
<div class="fedistream-single__artwork">
|
|
{% if post.thumbnail %}
|
|
<img src="{{ post.thumbnail }}" alt="{{ post.title|e('html_attr') }}" class="fedistream-single__image fedistream-single__image--album">
|
|
{% else %}
|
|
<div class="fedistream-single__placeholder fedistream-single__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-single__info">
|
|
<span class="fedistream-single__type-badge">{{ post.album_type|default('Album') }}</span>
|
|
<h1 class="fedistream-single__title">{{ post.title }}</h1>
|
|
{% if post.artist %}
|
|
<p class="fedistream-single__artist">
|
|
<a href="{{ post.artist_link }}">{{ post.artist }}</a>
|
|
</p>
|
|
{% endif %}
|
|
<div class="fedistream-single__meta">
|
|
{% if post.release_date %}
|
|
<span class="fedistream-single__date">{{ post.release_date }}</span>
|
|
{% endif %}
|
|
{% if post.track_count %}
|
|
<span class="fedistream-single__tracks">{{ post.track_count }} {{ post.track_count == 1 ? __('track', 'wp-fedistream') : __('tracks', 'wp-fedistream') }}</span>
|
|
{% endif %}
|
|
{% if post.duration_formatted %}
|
|
<span class="fedistream-single__duration">{{ post.duration_formatted }}</span>
|
|
{% endif %}
|
|
</div>
|
|
{% if post.genres is not empty %}
|
|
<div class="fedistream-single__genres">
|
|
{% for genre in post.genres %}
|
|
<a href="{{ genre.link }}" class="fedistream-tag">{{ genre.name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
<div class="fedistream-single__actions">
|
|
<button type="button" class="fedistream-btn fedistream-btn--primary fedistream-btn--play-all" data-album-id="{{ post.id }}">
|
|
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
|
{{ __('Play All', 'wp-fedistream') }}
|
|
</button>
|
|
<button type="button" class="fedistream-btn fedistream-btn--secondary fedistream-btn--shuffle" data-album-id="{{ post.id }}">
|
|
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z"/></svg>
|
|
{{ __('Shuffle', 'wp-fedistream') }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
{% if post.tracks is not empty %}
|
|
<section class="fedistream-single__tracklist">
|
|
<div class="fedistream-tracklist fedistream-tracklist--album">
|
|
{% for track in post.tracks %}
|
|
<div class="fedistream-tracklist__item" data-track-id="{{ track.id }}">
|
|
<span class="fedistream-tracklist__number">{{ track.track_number|default(loop.index) }}</span>
|
|
<div class="fedistream-tracklist__info">
|
|
<a href="{{ track.permalink }}" class="fedistream-tracklist__title">{{ track.title }}</a>
|
|
{% if track.featured_artists %}
|
|
<span class="fedistream-tracklist__featuring">{{ __('feat.', 'wp-fedistream') }} {{ track.featured_artists }}</span>
|
|
{% endif %}
|
|
</div>
|
|
{% if track.explicit %}
|
|
<span class="fedistream-badge fedistream-badge--explicit">E</span>
|
|
{% endif %}
|
|
{% if track.duration_formatted %}
|
|
<span class="fedistream-tracklist__duration">{{ track.duration_formatted }}</span>
|
|
{% endif %}
|
|
<button type="button" class="fedistream-tracklist__play" aria-label="{{ __('Play', 'wp-fedistream') }}">
|
|
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
|
</button>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if post.content %}
|
|
<section class="fedistream-single__content">
|
|
<h2 class="fedistream-section__title">{{ __('About This Album', 'wp-fedistream') }}</h2>
|
|
<div class="fedistream-single__description">
|
|
{{ post.content|raw }}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if post.credits %}
|
|
<section class="fedistream-single__credits">
|
|
<h2 class="fedistream-section__title">{{ __('Credits', 'wp-fedistream') }}</h2>
|
|
<div class="fedistream-credits">
|
|
{{ post.credits|raw }}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if post.license %}
|
|
<section class="fedistream-single__license">
|
|
<p class="fedistream-license">
|
|
<strong>{{ __('License:', 'wp-fedistream') }}</strong>
|
|
<a href="{{ post.license.link }}">{{ post.license.name }}</a>
|
|
</p>
|
|
</section>
|
|
{% endif %}
|
|
</article>
|