40 lines
1.5 KiB
HTML
40 lines
1.5 KiB
HTML
{{define "podcasts"}}{{template "header" .}}
|
|
{{if not .Data}}<p class="text-secondary">No podcasts yet. Ask an administrator to add a channel.</p>{{end}}
|
|
{{range .Data}}
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<div class="d-flex align-items-center justify-content-between gap-2">
|
|
<h2 class="h6 mb-0">{{.Channel.Title}}</h2>
|
|
{{if .Episodes}}
|
|
<form method="post" action="/podcasts/{{.Channel.ID}}/download-all">
|
|
{{template "csrf_field" $.CSRFToken}}
|
|
<button type="submit" class="btn btn-sm btn-outline-primary"><i class="bi bi-download"></i> Download all episodes</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
<p class="text-secondary small">{{.Channel.Description}}</p>
|
|
<table class="table table-sm vs-table mb-0">
|
|
<tbody>
|
|
{{range .Episodes}}
|
|
<tr>
|
|
<td>{{.Title}}</td>
|
|
<td class="text-secondary small">{{.PublishDate}}</td>
|
|
<td>{{.Status}}</td>
|
|
<td class="text-end">
|
|
{{if eq .Status "completed"}}<span class="text-success"><i class="bi bi-check-circle"></i> Downloaded</span>
|
|
{{else}}
|
|
<form method="post" action="/podcasts/{{.ID}}/download">
|
|
{{template "csrf_field" $.CSRFToken}}
|
|
<button type="submit" class="btn btn-sm btn-outline-primary">Download</button>
|
|
</form>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{template "footer" .}}{{end}}
|