2022-03-27 22:37:04 +02:00
|
|
|
<template>
|
|
|
|
<modals-modal v-model="show" name="podcast-episode-edit-modal" :width="800" :height="'unset'" :processing="processing">
|
|
|
|
<template #outer>
|
|
|
|
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
|
|
|
|
<p class="font-book text-3xl text-white truncate">{{ title }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-07-31 20:12:37 +02:00
|
|
|
<div class="absolute -top-10 left-0 z-10 w-full flex">
|
|
|
|
<template v-for="tab in tabs">
|
|
|
|
<div :key="tab.id" class="w-28 rounded-t-lg flex items-center justify-center mr-0.5 sm:mr-1 cursor-pointer hover:bg-bg font-book border-t border-l border-r border-black-300 tab text-xs sm:text-base" :class="selectedTab === tab.id ? 'tab-selected bg-bg pb-px' : 'bg-primary text-gray-400'" @click="selectTab(tab.id)">{{ tab.title }}</div>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ref="wrapper" class="p-4 w-full text-sm rounded-b-lg rounded-tr-lg bg-bg shadow-lg border border-black-300 relative overflow-y-auto" style="max-height: 80vh">
|
|
|
|
<component v-if="libraryItem && show" :is="tabComponentName" :library-item="libraryItem" :episode="episode" :processing.sync="processing" @close="show = false" @selectTab="selectTab" />
|
2022-03-27 22:37:04 +02:00
|
|
|
</div>
|
|
|
|
</modals-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
processing: false,
|
2022-07-31 20:12:37 +02:00
|
|
|
selectedTab: 'details',
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
id: 'details',
|
2022-11-09 00:10:08 +01:00
|
|
|
title: this.$strings.HeaderDetails,
|
2022-07-31 20:12:37 +02:00
|
|
|
component: 'modals-podcast-tabs-episode-details'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'match',
|
2022-11-09 00:10:08 +01:00
|
|
|
title: this.$strings.HeaderMatch,
|
2022-07-31 20:12:37 +02:00
|
|
|
component: 'modals-podcast-tabs-episode-match'
|
|
|
|
}
|
|
|
|
]
|
2022-03-27 22:37:04 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
show: {
|
|
|
|
get() {
|
2022-04-23 02:31:11 +02:00
|
|
|
return this.$store.state.globals.showEditPodcastEpisode
|
2022-03-27 22:37:04 +02:00
|
|
|
},
|
|
|
|
set(val) {
|
2022-04-23 02:31:11 +02:00
|
|
|
this.$store.commit('globals/setShowEditPodcastEpisodeModal', val)
|
2022-03-27 22:37:04 +02:00
|
|
|
}
|
|
|
|
},
|
2022-04-23 02:31:11 +02:00
|
|
|
libraryItem() {
|
|
|
|
return this.$store.state.selectedLibraryItem
|
|
|
|
},
|
|
|
|
episode() {
|
|
|
|
return this.$store.state.globals.selectedEpisode
|
|
|
|
},
|
2022-03-27 22:37:04 +02:00
|
|
|
title() {
|
|
|
|
if (!this.libraryItem) return ''
|
|
|
|
return this.libraryItem.media.metadata.title || 'Unknown'
|
2022-07-31 20:12:37 +02:00
|
|
|
},
|
|
|
|
tabComponentName() {
|
|
|
|
var _tab = this.tabs.find((t) => t.id === this.selectedTab)
|
|
|
|
return _tab ? _tab.component : ''
|
2022-03-27 22:37:04 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2022-07-31 20:12:37 +02:00
|
|
|
selectTab(tab) {
|
|
|
|
this.selectedTab = tab
|
2022-03-27 22:37:04 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|
2022-07-31 20:12:37 +02:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.tab {
|
|
|
|
height: 40px;
|
|
|
|
}
|
|
|
|
.tab.tab-selected {
|
|
|
|
height: 41px;
|
|
|
|
}
|
|
|
|
</style>
|