34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
<div class="row-between">
|
|
<h1>Admin · Playlists</h1>
|
|
<a href="/admin/playlists/new" class="btn-primary">New playlist</a>
|
|
</div>
|
|
|
|
<nav class="tabs">
|
|
<a href="/admin/songs">Songs</a>
|
|
<a href="/admin/playlists" class="active">Playlists</a>
|
|
</nav>
|
|
|
|
<% if (playlists.length === 0) { %>
|
|
<p class="muted">No playlists yet.</p>
|
|
<% } else { %>
|
|
<table class="data-table">
|
|
<thead><tr><th>Title</th><th>Public</th><th>Created</th><th></th></tr></thead>
|
|
<tbody>
|
|
<% playlists.forEach((p) => { %>
|
|
<tr>
|
|
<td><a href="/playlists/<%= p.id %>"><%= p.title %></a></td>
|
|
<td><%= p.isPublic ? 'yes' : 'no' %></td>
|
|
<td class="muted small"><%= p.createdAt %></td>
|
|
<td class="actions">
|
|
<a href="/admin/playlists/<%= p.id %>/edit">Edit</a>
|
|
<form method="post" action="/admin/playlists/<%= p.id %>/delete" class="inline-form" onsubmit="return confirm('Delete this playlist?');">
|
|
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
|
<button type="submit" class="linklike danger">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<% }) %>
|
|
</tbody>
|
|
</table>
|
|
<% } %>
|