|
|
|
@ -134,19 +134,29 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="columns" v-bind:class="{four:layout=='list', twelve:layout=='grid'}">
|
|
|
|
|
<button
|
|
|
|
|
class="button button-delete"
|
|
|
|
|
@click="deletePodcast(podcast.ID)"
|
|
|
|
|
class="button button-delete deletePodcast"
|
|
|
|
|
:data-id="podcast.ID"
|
|
|
|
|
title="Delete Podcast and episode files"
|
|
|
|
|
>
|
|
|
|
|
<i class="fas fa-trash"></i>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
<div :id="'deleteDdl-'+podcast.ID" style="display: none">
|
|
|
|
|
<ul>
|
|
|
|
|
<li style="list-style: none;"> <button class="button" :data-id="podcast.ID" onclick="deletePodcast(this)" >Delete Files and Podcast</button></li>
|
|
|
|
|
|
|
|
|
|
<li style="list-style: none;"> <button class="button" :data-id="podcast.ID" onclick="deletePodcastEpisodes(this)">Delete Files, Keep Podcast</button></li>
|
|
|
|
|
|
|
|
|
|
<li style="list-style: none;"> <button class="button" :data-id="podcast.ID" onclick="deleteOnlyPodcast(this)">Keep Files, Delete Podcast</button></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <button
|
|
|
|
|
class="button button-delete"
|
|
|
|
|
title="Delete only episode files"
|
|
|
|
|
@click="deletePodcastEpisodes(podcast.ID)"
|
|
|
|
|
>
|
|
|
|
|
<i class="fas fa-folder-minus"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</button> -->
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
class="button"
|
|
|
|
@ -197,6 +207,9 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{template "scripts"}}
|
|
|
|
|
<script src="/webassets/popper.min.js"></script>
|
|
|
|
|
<script src="/webassets/tippy-bundle.umd.min.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var app = new Vue({
|
|
|
|
|
delimiters: ["${", "}"],
|
|
|
|
@ -216,6 +229,10 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
removePodcast(id) {
|
|
|
|
|
const index= this.podcasts.findIndex(x=>x.ID===id);
|
|
|
|
|
this.podcasts.splice(index,1);
|
|
|
|
|
},
|
|
|
|
|
sortPodcasts(order){
|
|
|
|
|
let compareFunction;
|
|
|
|
|
switch(order){
|
|
|
|
@ -296,7 +313,24 @@
|
|
|
|
|
if (screen.width <= 760) {
|
|
|
|
|
this.layout='list'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$nextTick(function () {
|
|
|
|
|
|
|
|
|
|
checkUseMore();
|
|
|
|
|
tippy(".deletePodcast",{
|
|
|
|
|
allowHTML: true,
|
|
|
|
|
content(reference) {
|
|
|
|
|
|
|
|
|
|
const id = reference.getAttribute('data-id');
|
|
|
|
|
|
|
|
|
|
const template = document.getElementById('deleteDdl-'+id);
|
|
|
|
|
|
|
|
|
|
return template.innerHTML;
|
|
|
|
|
},
|
|
|
|
|
trigger:'click',
|
|
|
|
|
interactive: true
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
sortOrder(newOrder,oldOrder){
|
|
|
|
@ -316,9 +350,6 @@
|
|
|
|
|
localStorage.layout=newLayout
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
updated(){
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
isMobile:false,
|
|
|
|
@ -389,7 +420,10 @@
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
function deletePodcast(id,onSuccess) {
|
|
|
|
|
// console.log(id);
|
|
|
|
|
if (typeof id !== 'string'){
|
|
|
|
|
id= id.getAttribute('data-id')
|
|
|
|
|
}
|
|
|
|
|
console.log(id)
|
|
|
|
|
var confirmed = confirm(
|
|
|
|
|
"Are you sure you want to delete this podcast and all files?"
|
|
|
|
|
);
|
|
|
|
@ -405,9 +439,7 @@
|
|
|
|
|
position: "top-right",
|
|
|
|
|
duration: 5000,
|
|
|
|
|
});
|
|
|
|
|
if(onSuccess){
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
|
|
|
|
app.removePodcast(id)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
@ -425,6 +457,9 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deletePodcastEpisodes(id) {
|
|
|
|
|
if (typeof id !== 'string'){
|
|
|
|
|
id= id.getAttribute('data-id')
|
|
|
|
|
}
|
|
|
|
|
console.log(id);
|
|
|
|
|
var confirmed = confirm(
|
|
|
|
|
"Are you sure you want to delete all episodes of this podcast?"
|
|
|
|
@ -455,6 +490,41 @@
|
|
|
|
|
.then(function () {});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
function deleteOnlyPodcast(id) {
|
|
|
|
|
if (typeof id !== 'string'){
|
|
|
|
|
id= id.getAttribute('data-id')
|
|
|
|
|
}
|
|
|
|
|
console.log(id);
|
|
|
|
|
var confirmed = confirm(
|
|
|
|
|
"Are you sure you want to delete this podcast (without deleting the files)?"
|
|
|
|
|
);
|
|
|
|
|
if (!confirmed) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
axios
|
|
|
|
|
.delete("/podcasts/" + id + "/podcast")
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
Vue.toasted.show("Podcast deleted successfully.", {
|
|
|
|
|
theme: "bubble",
|
|
|
|
|
type: "success",
|
|
|
|
|
position: "top-right",
|
|
|
|
|
duration: 5000,
|
|
|
|
|
});
|
|
|
|
|
app.removePodcast(id)
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
if (error.response) {
|
|
|
|
|
Vue.toasted.show(error.response.data?.message, {
|
|
|
|
|
theme: "bubble",
|
|
|
|
|
type: "error",
|
|
|
|
|
position: "top-right",
|
|
|
|
|
duration: 5000,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(function () {});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|