obscreen/views/playlist/component/table.jinja.html
2024-07-16 02:17:31 +02:00

46 lines
2.1 KiB
HTML

<div class="tiles playlists">
<div class="tiles-inner">
{% for playlist in playlists %}
{% set active = current_playlist and ''~playlist.id == ''~current_playlist.id %}
<a href="{{ url_for('playlist_list', playlist_id=playlist.id) }}"
class="{% if active %}active{% endif %} tile-item {% if not playlist.enabled %}disabled{% endif %} playlist-item"
data-level="{{ playlist.id }}"
data-entity="{{ playlist.to_json() }}">
<div class="tile-header">
<div class="head-icon">
<i class="fa {{ 'fa fa-circle' if active else 'fa fa-circle' }}"></i>
</div>
</div>
<div class="tile-body">
{% set title = playlist.name|trim %}
{% set title = title if title|length > 0 %}
{{ truncate((title)|default(l.common_untitled), 35, '...') }}
</div>
<div class="tile-footer">
<div class="foot-span">
{% set total_duration = seconds_to_hhmmss(durations[playlist.id]) %}
{% if total_duration %}
{{ total_duration }}
{% else %}
{{ l.common_empty }}
{% endif %}
</div>
{% if AUTH_ENABLED %}
{% if playlist.id %}
{% set creator = track_created(playlist) %}
{% if creator.username %}
<div class="foot-span {% if not creator.enabled %}anonymous{% endif %}">
{{ creator.username }}
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
</a>
{% endfor %}
<div class="inner-empty empty-flag {% if playlists|length != 0 %}hidden{% endif %}">
<i class="fa fa-list"></i>
</div>
</div>
</div>