| 1 |
{%- import "partials/_ui.html" as ui -%} |
| 2 |
<div id="insertion-library"> |
| 3 |
<h3 class="insertion-list-heading">Clips</h3> |
| 4 |
|
| 5 |
<div class="insertion-list-toolbar"> |
| 6 |
<button type="button" class="btn btn-sm insertion-list-upload" onclick="MNW.insertions.startUpload()">Upload Clip</button> |
| 7 |
<input type="file" id="insertion-file-input" class="sr-only" accept=".mp3,.wav,.flac,.ogg,.m4a" onchange="MNW.insertions.handleFileSelected(this)"> |
| 8 |
</div> |
| 9 |
|
| 10 |
{% if insertions.is_empty() %} |
| 11 |
{% call ui::empty_state("", "No clips yet. Upload an audio clip to use as a pre-roll, mid-roll, or post-roll on your items.") %} |
| 12 |
{% else %} |
| 13 |
<table class="data-table insertion-list-table"> |
| 14 |
<thead> |
| 15 |
<tr> |
| 16 |
<th>Title</th> |
| 17 |
<th>Duration</th> |
| 18 |
<th>Type</th> |
| 19 |
<th>Created</th> |
| 20 |
<th class="insertion-list-th-actions">Actions</th> |
| 21 |
</tr> |
| 22 |
</thead> |
| 23 |
<tbody> |
| 24 |
{% for ins in insertions %} |
| 25 |
<tr id="insertion-row-{{ ins.id }}"> |
| 26 |
<td>{{ ins.title }}</td> |
| 27 |
<td>{{ ins.duration_display }}</td> |
| 28 |
<td>{{ ins.media_type }}</td> |
| 29 |
<td>{{ ins.created_at }}</td> |
| 30 |
<td class="insertion-list-actions"> |
| 31 |
<button type="button" class="btn btn-xs insertion-list-action-btn" onclick="MNW.insertions.rename('{{ ins.id }}', '{{ ins.title }}')">Rename</button> |
| 32 |
<button type="button" class="btn btn-xs btn-danger insertion-list-action-btn" |
| 33 |
hx-delete="/api/insertions/{{ ins.id }}" |
| 34 |
hx-target="#insertion-library" |
| 35 |
hx-swap="outerHTML" |
| 36 |
hx-confirm="Delete this clip? It will be removed from all items using it.">Delete</button> |
| 37 |
</td> |
| 38 |
</tr> |
| 39 |
{% endfor %} |
| 40 |
</tbody> |
| 41 |
</table> |
| 42 |
{% endif %} |
| 43 |
</div> |
| 44 |
|