audio
This commit is contained in:
48
assets/views/audio/album.html
Normal file
48
assets/views/audio/album.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ album.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="space-y-2">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">{{ album.title }}</h1>
|
||||
{% if album.artist %}
|
||||
<p class="text-sm opacity-70">{{ album.artist }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="/audio/albums" class="btn btn-ghost btn-sm">Back to albums</a>
|
||||
</div>
|
||||
|
||||
{% if album.cover_image_id %}
|
||||
<img src="/images/{{ album.cover_image_id }}" alt="" class="mb-4 rounded">
|
||||
{% endif %}
|
||||
|
||||
{% if album.description %}
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<p class="whitespace-pre-line">{{ album.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
{% if tracks | length > 0 %}
|
||||
<div class="space-y-2">
|
||||
{% for track in tracks %}
|
||||
<div class="border-t border-base-300 pt-2">
|
||||
<p class="font-medium">{% if track.track_number %}{{ track.track_number }}. {% endif %}{{ track.title }}</p>
|
||||
<audio controls preload="metadata" class="mt-2 w-full">
|
||||
<source src="/audio/tracks/{{ track.id }}/stream">
|
||||
</audio>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center font-medium">No tracks yet.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
42
assets/views/audio/albums.html
Normal file
42
assets/views/audio/albums.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Audio{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="space-y-2">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Audio</h1>
|
||||
<p class="text-sm opacity-70">Published albums.</p>
|
||||
</div>
|
||||
|
||||
{% if albums | length > 0 %}
|
||||
<div class="grid grid-cols-2 gap-4 pt-4">
|
||||
{% for album in albums %}
|
||||
<article class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
{% if album.cover_image_id %}
|
||||
<img src="/images/{{ album.cover_image_id }}" alt="" class="mb-3 rounded">
|
||||
{% endif %}
|
||||
<h2 class="card-title text-base">{{ album.title }}</h2>
|
||||
{% if album.artist %}
|
||||
<p class="text-sm opacity-70">{{ album.artist }}</p>
|
||||
{% endif %}
|
||||
{% if album.description %}
|
||||
<p class="text-sm opacity-80">{{ album.description }}</p>
|
||||
{% endif %}
|
||||
<div class="pt-2">
|
||||
<a href="/audio/albums/{{ album.slug }}" class="btn btn-neutral btn-sm">Open album</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||
<div class="card-body text-center">
|
||||
<p class="font-medium">No published albums yet.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user