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