Files
2026-05-23 13:08:09 +03:00

52 lines
1.9 KiB
HTML

{% extends "admin/layout.html" %}
{% block admin_title %}{{ t.nav_media_files }}{% endblock admin_title %}
{% block content %}
<h1>{{ t.media_files_heading }}</h1>
{% if rows.is_empty() %}
<p>{{ t.media_files_empty }}</p>
{% else %}
<table>
<tr>
<th>ID</th>
<th>{{ t.media_files_filename }}</th>
<th>{{ t.media_files_type }}</th>
<th>{{ t.media_files_format }}</th>
<th>{{ t.media_files_size }}</th>
<th>{{ t.media_files_track }}</th>
<th>{{ t.media_files_path }}</th>
<th>{{ t.media_files_created }}</th>
<th>{{ t.media_files_actions }}</th>
</tr>
{% for row in rows %}
<tr>
<td>{{ row.media_file.id_val() }}</td>
<td>{{ row.media_file.original_filename_str() }}</td>
<td>{{ row.media_file.file_type_str() }}</td>
<td>{{ row.media_file.audio_format_str() }}</td>
<td>{{ row.media_file.file_size_display() }}</td>
<td>
{% if row.track_title.is_empty() %}
<span class="badge badge-orphan">{{ t.media_files_orphan }}</span>
{% else %}
{{ row.track_title }}
{% endif %}
</td>
<td style="max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="{{ row.media_file.file_path_str() }}">{{ row.media_file.file_path_str() }}</td>
<td>{{ row.media_file.created_at_str() }}</td>
<td>
<form method="post" action="/admin/media-files/{{ row.media_file.id_val() }}/delete" style="display:inline;" onsubmit="return confirm('{{ t.media_files_delete_confirm }}')">
<button type="submit" style="background:none; border:none; color:#c00; cursor:pointer; padding:0; text-decoration:underline;">{{ t.media_files_delete }}</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
<style>
.badge-orphan { background: #fff3cd; color: #856404; }
</style>
{% endblock content %}