2020-10-04 11:31:47 -04:00
|
|
|
<template>
|
|
|
|
<div>
|
2022-02-19 00:39:14 -05:00
|
|
|
<list-item-playlist
|
|
|
|
v-for="playlist in playlists"
|
|
|
|
:key="playlist.id"
|
|
|
|
:playlist="playlist"
|
|
|
|
@click="open_playlist(playlist)"
|
|
|
|
>
|
|
|
|
<template #icon>
|
2020-10-04 11:31:47 -04:00
|
|
|
<span class="icon">
|
2022-02-19 00:39:14 -05:00
|
|
|
<i
|
|
|
|
class="mdi"
|
|
|
|
:class="{
|
|
|
|
'mdi-library-music': playlist.type !== 'folder',
|
|
|
|
'mdi-rss': playlist.type === 'rss',
|
|
|
|
'mdi-folder': playlist.type === 'folder'
|
|
|
|
}"
|
|
|
|
/>
|
2020-10-04 11:31:47 -04:00
|
|
|
</span>
|
|
|
|
</template>
|
2022-02-19 00:39:14 -05:00
|
|
|
<template #actions>
|
2022-02-19 00:18:01 -05:00
|
|
|
<a @click.prevent.stop="open_dialog(playlist)">
|
2022-02-19 00:39:14 -05:00
|
|
|
<span class="icon has-text-dark"
|
|
|
|
><i class="mdi mdi-dots-vertical mdi-18px"
|
|
|
|
/></span>
|
2020-10-04 11:31:47 -04:00
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</list-item-playlist>
|
2022-02-19 00:39:14 -05:00
|
|
|
<modal-dialog-playlist
|
|
|
|
:show="show_details_modal"
|
|
|
|
:playlist="selected_playlist"
|
|
|
|
@close="show_details_modal = false"
|
|
|
|
/>
|
2020-10-04 11:31:47 -04:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 00:18:01 -05:00
|
|
|
import ListItemPlaylist from '@/components/ListItemPlaylist.vue'
|
|
|
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist.vue'
|
2020-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ListPlaylists',
|
|
|
|
components: { ListItemPlaylist, ModalDialogPlaylist },
|
|
|
|
|
|
|
|
props: ['playlists'],
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
data() {
|
2020-10-04 11:31:47 -04:00
|
|
|
return {
|
|
|
|
show_details_modal: false,
|
|
|
|
selected_playlist: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
open_playlist: function (playlist) {
|
|
|
|
if (playlist.type !== 'folder') {
|
|
|
|
this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' })
|
|
|
|
} else {
|
|
|
|
this.$router.push({ path: '/playlists/' + playlist.id })
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
open_dialog: function (playlist) {
|
|
|
|
this.selected_playlist = playlist
|
|
|
|
this.show_details_modal = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|