2021-08-18 00:01:11 +02:00
|
|
|
<template>
|
|
|
|
<div class="w-full my-2">
|
2021-11-04 23:35:59 +01:00
|
|
|
<div class="w-full bg-primary px-4 md:px-6 py-2 flex items-center cursor-pointer" @click.stop="clickBar">
|
2022-03-17 18:25:12 +01:00
|
|
|
<p class="pr-2 md:pr-4">{{ title }}</p>
|
2021-11-04 23:35:59 +01:00
|
|
|
<div class="h-5 md:h-7 w-5 md:w-7 rounded-full bg-white bg-opacity-10 flex items-center justify-center">
|
2021-10-07 04:08:52 +02:00
|
|
|
<span class="text-sm font-mono">{{ tracks.length }}</span>
|
|
|
|
</div>
|
2021-08-18 00:01:11 +02:00
|
|
|
<div class="flex-grow" />
|
2023-04-09 23:10:03 +02:00
|
|
|
<ui-btn v-if="userIsAdmin" small :color="showFullPath ? 'gray-600' : 'primary'" class="mr-2 hidden md:block" @click.stop="showFullPath = !showFullPath">{{ $strings.ButtonFullPath }}</ui-btn>
|
2022-04-28 02:42:34 +02:00
|
|
|
<nuxt-link v-if="userCanUpdate && !isFile" :to="`/audiobook/${libraryItemId}/edit`" class="mr-2 md:mr-4" @mousedown.prevent>
|
2022-11-08 15:37:39 +01:00
|
|
|
<ui-btn small color="primary">{{ $strings.ButtonManageTracks }}</ui-btn>
|
2021-08-18 00:01:11 +02:00
|
|
|
</nuxt-link>
|
|
|
|
<div class="cursor-pointer h-10 w-10 rounded-full hover:bg-black-400 flex justify-center items-center duration-500" :class="showTracks ? 'transform rotate-180' : ''">
|
|
|
|
<span class="material-icons text-4xl">expand_more</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<transition name="slide">
|
|
|
|
<div class="w-full" v-show="showTracks">
|
|
|
|
<table class="text-sm tracksTable">
|
2023-02-11 22:02:56 +01:00
|
|
|
<tr>
|
2021-10-07 04:08:52 +02:00
|
|
|
<th class="w-10">#</th>
|
2022-11-08 15:37:39 +01:00
|
|
|
<th class="text-left">{{ $strings.LabelFilename }}</th>
|
2023-04-16 01:09:49 +02:00
|
|
|
<th v-if="!showFullPath" class="text-left w-20 hidden lg:table-cell">{{ $strings.LabelCodec }}</th>
|
|
|
|
<th v-if="!showFullPath" class="text-left w-20 hidden xl:table-cell">{{ $strings.LabelBitrate }}</th>
|
|
|
|
<th class="text-left w-20 hidden md:table-cell">{{ $strings.LabelSize }}</th>
|
|
|
|
<th class="text-left w-20 hidden sm:table-cell">{{ $strings.LabelDuration }}</th>
|
|
|
|
<th class="text-center w-16"></th>
|
2021-08-18 00:01:11 +02:00
|
|
|
</tr>
|
2022-03-11 01:45:02 +01:00
|
|
|
<template v-for="track in tracks">
|
2023-04-16 01:09:49 +02:00
|
|
|
<tables-audio-tracks-table-row :key="track.index" :track="track" :library-item-id="libraryItemId" :showFullPath="showFullPath" @showMore="showMore" />
|
2021-08-18 00:01:11 +02:00
|
|
|
</template>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2023-04-16 01:09:49 +02:00
|
|
|
|
|
|
|
<modals-audio-file-data-modal v-model="showAudioFileDataModal" :audio-file="selectedAudioFile" />
|
2021-08-18 00:01:11 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2022-03-17 18:25:12 +01:00
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: 'Audio Tracks'
|
|
|
|
},
|
2021-08-18 00:01:11 +02:00
|
|
|
tracks: {
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
|
|
|
},
|
2022-04-28 02:42:34 +02:00
|
|
|
libraryItemId: String,
|
|
|
|
isFile: Boolean
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-10-07 04:08:52 +02:00
|
|
|
showTracks: false,
|
2022-10-02 22:24:32 +02:00
|
|
|
showFullPath: false,
|
2023-04-16 01:09:49 +02:00
|
|
|
selectedAudioFile: null,
|
|
|
|
showAudioFileDataModal: false
|
2021-08-18 00:01:11 +02:00
|
|
|
}
|
|
|
|
},
|
2021-09-07 00:42:15 +02:00
|
|
|
computed: {
|
|
|
|
userCanDownload() {
|
|
|
|
return this.$store.getters['user/getUserCanDownload']
|
|
|
|
},
|
|
|
|
userCanUpdate() {
|
|
|
|
return this.$store.getters['user/getUserCanUpdate']
|
2022-10-02 22:24:32 +02:00
|
|
|
},
|
2023-04-16 01:09:49 +02:00
|
|
|
userCanDelete() {
|
|
|
|
return this.$store.getters['user/getUserCanDelete']
|
|
|
|
},
|
2023-04-09 23:10:03 +02:00
|
|
|
userIsAdmin() {
|
|
|
|
return this.$store.getters['user/getIsAdminOrUp']
|
2021-09-07 00:42:15 +02:00
|
|
|
}
|
|
|
|
},
|
2021-08-18 00:01:11 +02:00
|
|
|
methods: {
|
|
|
|
clickBar() {
|
|
|
|
this.showTracks = !this.showTracks
|
2023-04-16 01:09:49 +02:00
|
|
|
},
|
|
|
|
showMore(audioFile) {
|
|
|
|
this.selectedAudioFile = audioFile
|
|
|
|
this.showAudioFileDataModal = true
|
2021-08-18 00:01:11 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|