77 lines
3.3 KiB
HTML
77 lines
3.3 KiB
HTML
{% extends "admin/base.html" %}
|
|
|
|
{% block title %}Upload song{% endblock title %}
|
|
{% block crumb %}audio/upload{% endblock crumb %}
|
|
|
|
{% block content %}
|
|
<header class="term-cmd">
|
|
<div>
|
|
<h1 class="term-title">upload a song</h1>
|
|
{% if album %}
|
|
<p class="term-sub">// goes straight into the album “{{ album.title }}”.</p>
|
|
{% else %}
|
|
<p class="term-sub">// uploads as a standalone song (a single) — you can add it to an album later.</p>
|
|
{% endif %}
|
|
</div>
|
|
<div class="term-cmd-actions">
|
|
{% if album %}
|
|
<a href="/admin/audio/albums/{{ album.id }}/tracks" class="btn btn-outline btn-sm">[ cancel ]</a>
|
|
{% else %}
|
|
<a href="/admin/audio/tracks" class="btn btn-outline btn-sm">[ cancel ]</a>
|
|
{% endif %}
|
|
</div>
|
|
</header>
|
|
|
|
<div class="card">
|
|
<div class="term-head">
|
|
<span class="term-head-name">{% if album %}~/audio/{{ album.slug }}/upload{% else %}~/audio/songs/upload{% endif %}</span>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if album %}
|
|
<form method="post" action="/admin/audio/albums/{{ album.id }}/tracks/upload-file" enctype="multipart/form-data" class="space-y-2">
|
|
{% else %}
|
|
<form method="post" action="/admin/audio/tracks/upload-file" enctype="multipart/form-data" class="space-y-2">
|
|
{% endif %}
|
|
<div class="form-control">
|
|
<label class="label"><span class="label-text t-green">1. audio file *</span></label>
|
|
<input type="file" name="file" accept="audio/mpeg,audio/wav,audio/ogg,audio/flac,audio/aac,audio/mp4,audio/webm" required class="file-input file-input-bordered w-full">
|
|
<p class="term-help">required — mp3, wav, ogg, flac, aac, m4a or webm.</p>
|
|
</div>
|
|
|
|
<div class="form-control">
|
|
<label class="label"><span class="label-text t-green">2. title</span></label>
|
|
<input type="text" name="title" class="input input-bordered w-full" placeholder="e.g. Sunburst Jam">
|
|
<p class="term-help">optional — leave blank to use the audio file’s name.</p>
|
|
</div>
|
|
|
|
{% if album %}
|
|
<div class="form-control">
|
|
<label class="label"><span class="label-text t-green">3. track number</span></label>
|
|
<input type="number" name="track_number" min="1" class="input input-bordered w-full" placeholder="1">
|
|
<p class="term-help">optional — this song’s position in the album’s track list.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<label class="label cursor-pointer justify-start gap-2">
|
|
<input type="checkbox" name="featured" class="checkbox checkbox-sm">
|
|
<span class="label-text">featured — highlight this song on the site</span>
|
|
</label>
|
|
|
|
<label class="label cursor-pointer justify-start gap-2">
|
|
<input type="checkbox" name="published" class="checkbox checkbox-sm">
|
|
<span class="label-text">publish now — visitors can see it (leave off to keep it a draft)</span>
|
|
</label>
|
|
|
|
<div class="flex flex-wrap gap-2 pt-2">
|
|
<button type="submit" class="btn btn-primary btn-sm">[ ↑ upload song ]</button>
|
|
{% if album %}
|
|
<a href="/admin/audio/albums/{{ album.id }}/tracks" class="btn btn-ghost btn-sm">cancel</a>
|
|
{% else %}
|
|
<a href="/admin/audio/tracks" class="btn btn-ghost btn-sm">cancel</a>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock content %}
|