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/index.html

114 lines
3.1 KiB

4 years ago
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
4 years ago
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css" integrity="sha512-EZLkOqwILORob+p0BXZc+Vm3RgJBOe1Iq/0fiI7r/wJgzOFZMlsqTa29UEl6v6U6gsV4uIpsNZoV32YZqrCRCQ==" crossorigin="anonymous" />
4 years ago
<title>PodGrab</title>
{{template "commoncss"}}
4 years ago
<style>
.button-delete{
background-color: indianred;
color:wheat;
}
4 years ago
img{
display: none;
}
/* Larger than tablet */
@media (min-width: 750px) {
img{
display: block
}
}
4 years ago
</style>
4 years ago
</head>
<body>
4 years ago
<div class="container">
<section class="header">
4 years ago
<h1>{{ .title }}</h1>
4 years ago
</section>
4 years ago
{{template "navbar"}}
<div class="row" style="display: none;">
4 years ago
<form action="/" method="post">
4 years ago
<div class="nine columns">
<input type="url" name="url" id="url" placeholder="Enter Podcast RSS feed to add" class="u-full-width">
</div><div class="three columns">
<input type="submit" value="Add Podcast" class="u-full-width button-primary">
4 years ago
</div>
</form>
</div>
<br>
4 years ago
{{range .podcasts}}
<div class="podcasts row" id="podcast-{{ .ID }}">
<div class="columns two">
<img onerror="onImageError(this)" class="u-full-width" src="{{ .Image }}" alt="{{ .Title }}">
4 years ago
</div>
<div class="columns ten">
<a style="text-decoration: none;" href="/podcasts/{{ .ID }}/view"> <h3>{{.Title}}</h3></a>
4 years ago
<p>{{ .Summary }}</p>
4 years ago
<div class="row">
<div class="columns four">
Last Episode : {{ latestEpisodeDate .PodcastItems}}
4 years ago
</div>
<div class="columns four">
{{ len .PodcastItems }} episodes
4 years ago
</div>
<div class="columns four">
<button class="button button-delete" onclick="deletePodcast('{{.ID}}')">Delete</button>
</div>
</div>
</div>
4 years ago
</div>
4 years ago
<hr>
{{else}}
<h5>You haven't added any podcasts yet. <a href="/add">Click here</a> to add a new podcast to start monitoring.</h5>
4 years ago
{{end}}
<!-- <div class="row">
<div class="columns twelve" style="text-align: center;">
<a href="/episodes" class="button button-primary">All Episodes</a>
</div>
</div> -->
</div>
{{template "scripts"}}
<script>
function deletePodcast(id){
console.log(id)
var confirmed= confirm("Are you sure you want to delete this podcast?");
if(!confirmed){
return false;
}
axios.delete("/podcasts/"+id)
.then(function(response){
Vue.toasted.show('Podcast deleted successfully.' ,{
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>
4 years ago
</body>
</html>