bragi/templates/playlist.html
2020-03-08 13:52:34 +08:00

66 lines
2.3 KiB
HTML

{% if index == -1 %}
<tr class="table-dark">
<td colspan="4" class="text-muted" style="text-align:center;"> Play list is empty. </td>
</tr>
{% else %}
{% if index == playlist.current_index %}
<tr class="table-active">
{% else %}
<tr>
{% endif %}
<th scope="row">{{ index + 1 }}</th>
<td>
<div class="playlist-title">
{% if m.type != 'radio' and m.thumbnail %}
<img width="80" src="data:image/PNG;base64,{{ m.thumbnail }}"/>
{% else %}
<img width="80" src="static/image/unknown-album.png"/>
{% endif %}
</div>
<div class="playlist-artwork">
{% if m.title.strip() %}
<b>{{ m.title|truncate(45) }}</b>
{% elif m.url %}
<b>{{ m.url|truncate(45) }}</b>
{% endif %}
<span class="badge badge-secondary">{{ m.display_type() }}</span>
<br />
{% if m.type == 'file' %}
{% if m.artist %}
{{ m.artist }}
{% else %}
??
{% endif %}
{% elif m.type == 'url_from_playlist' %}
<a href="{{ m.playlist_url }}"><i>{{ m.playlist_title|truncate(50) }}</i></a>
{% else %}
Unknown Artist
{% endif %}
<br />
{% for tag in m.tags %}
<span class="badge badge-{{ tags_color_lookup[tag] }}">{{ tag }}</span>
{% endfor %}
</div>
</td>
<td>
{% if m.type == 'url' or m.type == 'radio' or m.type == 'url_from_playlist' %}
<small><a href="{{ m.url }}"><i>{{ m.url|truncate(50) }}</i></a></small>
{% elif m.type == 'file' %}
<small>{{ m.path|truncate(50) }}</small>
{% endif %}
</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-info btn-sm btn-space"
onclick="request('post', {play_music : '{{ index }}'})">
<i class="fa fa-play" aria-hidden="true"></i>
</button>
<button type="button" class="btn btn-danger btn-sm btn-space"
onclick="request('post', {delete_music : '{{ index }}'})">
<i class="fas fa-trash-alt" aria-hidden="true"></i>
</button>
</div>
</td>
</tr>
{% endif %}