2020-10-04 11:31:47 -04:00
|
|
|
<template>
|
2022-02-19 01:47:54 -05:00
|
|
|
<div
|
|
|
|
v-for="playlist in playlists"
|
|
|
|
:key="playlist.id"
|
|
|
|
class="media"
|
|
|
|
:playlist="playlist"
|
|
|
|
@click="open_playlist(playlist)"
|
|
|
|
>
|
|
|
|
<figure class="media-left fd-has-action">
|
|
|
|
<span class="icon">
|
2022-04-16 04:14:03 -04:00
|
|
|
<mdicon :name="icon_name(playlist)" size="16" />
|
2022-02-19 01:47:54 -05:00
|
|
|
</span>
|
|
|
|
</figure>
|
|
|
|
<div class="media-content fd-has-action is-clipped">
|
|
|
|
<h1 class="title is-6">
|
|
|
|
{{ playlist.name }}
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<div class="media-right">
|
|
|
|
<a @click.prevent.stop="open_dialog(playlist)">
|
|
|
|
<span class="icon has-text-dark"
|
2022-04-16 04:14:03 -04:00
|
|
|
><mdicon name="dots-vertical" size="16"
|
2022-02-19 01:47:54 -05:00
|
|
|
/></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<teleport to="#app">
|
2022-02-19 00:39:14 -05:00
|
|
|
<modal-dialog-playlist
|
|
|
|
:show="show_details_modal"
|
|
|
|
:playlist="selected_playlist"
|
|
|
|
@close="show_details_modal = false"
|
|
|
|
/>
|
2022-02-19 01:47:54 -05:00
|
|
|
</teleport>
|
2020-10-04 11:31:47 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 00:18:01 -05:00
|
|
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist.vue'
|
2020-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ListPlaylists',
|
2022-02-19 01:47:54 -05:00
|
|
|
components: { ModalDialogPlaylist },
|
2020-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
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
|
2022-04-16 04:14:03 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
icon_name: function (playlist) {
|
|
|
|
if (playlist.type === 'folder') {
|
|
|
|
return 'folder'
|
|
|
|
} else if (playlist.type === 'rss') {
|
|
|
|
return 'rss'
|
|
|
|
} else {
|
|
|
|
return 'music-box-multiple'
|
|
|
|
}
|
2020-10-04 11:31:47 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|