You've already forked wp-fedistream
feat: Initial release v0.1.0
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>
This commit is contained in:
107
templates/single/playlist.twig
Normal file
107
templates/single/playlist.twig
Normal file
@@ -0,0 +1,107 @@
|
||||
{# Single playlist template #}
|
||||
<article class="fedistream-single fedistream-single--playlist">
|
||||
<header class="fedistream-single__header fedistream-single__header--playlist">
|
||||
<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--playlist">
|
||||
{% else %}
|
||||
<div class="fedistream-single__placeholder fedistream-single__placeholder--playlist">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M15 6H3v2h12V6zm0 4H3v2h12v-2zM3 16h8v-2H3v2zM17 6v8.18c-.31-.11-.65-.18-1-.18-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3V8h3V6h-5z"/></svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if post.visibility == 'private' %}
|
||||
<span class="fedistream-single__badge fedistream-single__badge--private">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/></svg>
|
||||
{{ __('Private', 'wp-fedistream') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="fedistream-single__info">
|
||||
<span class="fedistream-single__type-badge">{{ __('Playlist', 'wp-fedistream') }}</span>
|
||||
<h1 class="fedistream-single__title">{{ post.title }}</h1>
|
||||
{% if post.author %}
|
||||
<p class="fedistream-single__author">
|
||||
{{ __('Created by', 'wp-fedistream') }} <a href="{{ post.author_link }}">{{ post.author }}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="fedistream-single__meta">
|
||||
{% 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 %}
|
||||
{% if post.updated_date %}
|
||||
<span class="fedistream-single__updated">{{ __('Updated', 'wp-fedistream') }} {{ post.updated_date }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if post.moods is not empty %}
|
||||
<div class="fedistream-single__moods">
|
||||
{% for mood in post.moods %}
|
||||
<a href="{{ mood.link }}" class="fedistream-tag fedistream-tag--mood">{{ mood.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="fedistream-single__actions">
|
||||
<button type="button" class="fedistream-btn fedistream-btn--primary fedistream-btn--play-all" data-playlist-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-playlist-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.content %}
|
||||
<section class="fedistream-single__content">
|
||||
<div class="fedistream-single__description">
|
||||
{{ post.content|raw }}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if post.tracks is not empty %}
|
||||
<section class="fedistream-single__tracklist">
|
||||
<div class="fedistream-tracklist fedistream-tracklist--playlist">
|
||||
{% for track in post.tracks %}
|
||||
<div class="fedistream-tracklist__item" data-track-id="{{ track.id }}">
|
||||
<span class="fedistream-tracklist__number">{{ loop.index }}</span>
|
||||
{% if track.thumbnail %}
|
||||
<img src="{{ track.thumbnail }}" alt="" class="fedistream-tracklist__artwork">
|
||||
{% endif %}
|
||||
<div class="fedistream-tracklist__info">
|
||||
<a href="{{ track.permalink }}" class="fedistream-tracklist__title">{{ track.title }}</a>
|
||||
<span class="fedistream-tracklist__artist">
|
||||
{% if track.artists is iterable %}
|
||||
{% for artist in track.artists %}
|
||||
<a href="{{ artist.link }}">{{ artist.name }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{{ track.artist }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</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>
|
||||
{% else %}
|
||||
<section class="fedistream-single__empty">
|
||||
<div class="fedistream-empty">
|
||||
<p>{{ __('This playlist is empty.', 'wp-fedistream') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
</article>
|
||||
Reference in New Issue
Block a user