You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
podgrab/client/episodes.html

159 lines
3.7 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PodGrab</title>
{{template "commoncss"}}
<style>
img{
display: none
}
h1,h2,h3,h4,h5{
margin-bottom: 1rem;
}
h4{
font-size: 2rem;
}
h5{
font-size: 1.5rem;
}
p{
margin-bottom: 0.5rem;
}
hr{
margin-top: 1rem;
margin-bottom: 1rem;
}
/* Larger than tablet */
@media (min-width: 750px) {
img{
display: block
}
}
</style>
</head>
<body>
<div class="container">
{{template "navbar" .}}
<br>{{$setting := .setting}}
{{range .podcastItems}}
<div class="podcasts row">
<div class="columns two">
<img onerror="onImageError(this)" class="u-full-width" src="{{ .Image }}" alt="{{ .Title }}">
</div>
<div class="columns ten">
<div class="row">
<div class="columns eight">
<h4>{{.Title}} {{if .Podcast.Title }} // {{ .Podcast.Title}} {{end}}</h4>
</div>
<div class="columns three">
<small title="{{ formatDate .PubDate }}">{{ naturalDate .PubDate }}</small>
</div>
<div class="columns one">
<small> {{ formatDuration .Duration}}</small>
</div>
</div>
<p class="useMore">{{ .Summary }}</p>
{{if .DownloadPath}}
<a class="button button-primary" href="{{ .DownloadPath }}" download>Download</a>
<a class="button button" onclick="deleteFile('{{.ID}}')" download>Delete</a>
{{else}}
{{if not $setting.AutoDownload}}
<a class="button button-primary" onclick="downloadToDisk('{{.ID}}')" download>Download to Disk</a>
{{else}}
{{if eq .DownloadStatus 3}}
<a class="button button-primary" onclick="downloadToDisk('{{.ID}}')" download>Download to Disk</a>
{{end}}
{{end}}
{{end }}
</div>
<div class="columns one">
</div>
</div>
<hr>
{{end}}
<div class="row"><div class="columns twelve" style="text-align: center;">
{{if .previousPage }}
<a href="?page={{.previousPage}}" class="button button-primary">Newer</a>
{{end}}
{{if .nextPage }}
<a href="?page={{.nextPage}}" class="button button-primary">Older</a>
{{end}}
</div></div>
</div>
{{template "scripts"}}
<script>
function downloadToDisk(id){
axios.get("/podcastitems/"+id+"/download")
.then(function(response){
Vue.toasted.show('Podcast download enqueued.' ,{
theme: "bubble",
position: "top-right",
duration : 5000
});
var row = document.getElementById('podcast-'+id);
row.remove();
})
.catch(function(error){
if(error.response){
Vue.toasted.show(error.response.data?.message, {
theme: "bubble",
position: "top-right",
duration : 5000
})
}
}).
then(function(){
})
return false;
}
function deleteFile(id){
axios.get("/podcastitems/"+id+"/delete")
.then(function(response){
Vue.toasted.show('Podcast file deleted.' ,{
theme: "bubble",
position: "top-right",
duration : 5000
});
var row = document.getElementById('podcast-'+id);
row.remove();
})
.catch(function(error){
if(error.response){
Vue.toasted.show(error.response.data?.message, {
theme: "bubble",
position: "top-right",
duration : 5000
})
}
}).
then(function(){
})
return false;
}
</script>
</body>
</html>