refactor(podcast)!: make podcasts global not per user, to match spec

Release-As: 0.15.0
This commit is contained in:
brian-doherty
2022-05-03 16:32:18 -05:00
committed by sentriz
parent e883de8c95
commit 182c96e966
9 changed files with 121 additions and 112 deletions

View File

@@ -169,43 +169,45 @@
</table>
</div>
</div>
<div class="padded box">
<div class="box-title">
<i class="mdi mdi-rss-box"></i> podcasts
</div>
<div class="box-description text-light">
<p>you can add podcasts rss feeds here</p>
</div>
<div class="block-right">
<table id="podcast-preferences">
{{ range $pref := .Podcasts }}
{{ if .User.IsAdmin }}
<div class="padded box">
<div class="box-title">
<i class="mdi mdi-rss-box"></i> podcasts
</div>
<div class="box-description text-light">
<p>you can add podcasts rss feeds here</p>
</div>
<div class="block-right">
<table id="podcast-preferences">
{{ range $pref := .Podcasts }}
<tr>
<form id="podcast-{{ $pref.ID }}-download" action="{{ printf "/admin/download_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<form id="podcast-{{ $pref.ID }}-auto-download" action="{{ printf "/admin/update_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<form id="podcast-{{ $pref.ID }}-delete" action="{{ printf "/admin/delete_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<td>{{ $pref.Title }}</td>
<td><select form="podcast-{{ $pref.ID }}-auto-download" name="setting">
{{ if eq $pref.AutoDownload "latest" }}
<option value="latest" selected="selected">download latest</option>
<option value="none">no auto download</option>
{{ else }}
<option value="none" selected="selected" >no auto download</option>
<option value="latest">download latest</option>
{{ end }}
</select></td>
<td><input form="podcast-{{ $pref.ID }}-download" type="submit" value="download all"></td>
<td><input form="podcast-{{ $pref.ID }}-auto-download" type="submit" value="save"></td>
<td><input form="podcast-{{ $pref.ID }}-delete" type="submit" value="delete"></td>
</tr>
{{ end }}
<tr>
<form id="podcast-{{ $pref.ID }}-download" action="{{ printf "/admin/download_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<form id="podcast-{{ $pref.ID }}-auto-download" action="{{ printf "/admin/update_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<form id="podcast-{{ $pref.ID }}-delete" action="{{ printf "/admin/delete_podcast_do?id=%d" $pref.ID | path }}" method="post"></form>
<td>{{ $pref.Title }}</td>
<td><select form="podcast-{{ $pref.ID }}-auto-download" name="setting">
{{ if eq $pref.AutoDownload "latest" }}
<option value="latest" selected="selected">download latest</option>
<option value="none">no auto download</option>
{{ else }}
<option value="none" selected="selected" >no auto download</option>
<option value="latest">download latest</option>
{{ end }}
</select></td>
<td><input form="podcast-{{ $pref.ID }}-download" type="submit" value="download all"></td>
<td><input form="podcast-{{ $pref.ID }}-auto-download" type="submit" value="save"></td>
<td><input form="podcast-{{ $pref.ID }}-delete" type="submit" value="delete"></td>
<form id="podcast-add" action="{{ path "/admin/add_podcast_do" }}" method="post"></form>
<td><input form="podcast-add" type="text" name="feed" placeholder="rss feed url"></td>
<td><input form="podcast-add" type="submit" value="save"></td>
</tr>
{{ end }}
<tr>
<form id="podcast-add" action="{{ path "/admin/add_podcast_do" }}" method="post"></form>
<td><input form="podcast-add" type="text" name="feed" placeholder="rss feed url"></td>
<td><input form="podcast-add" type="submit" value="save"></td>
</tr>
</table>
</table>
</div>
</div>
</div>
{{ end }}
<div class="padded box">
<div class="box-title">
<i class="mdi mdi-playlist-music"></i> playlists