2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
|
|
|
<content-with-heading>
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-4">Playlists</p>
|
|
|
|
<p class="heading">{{ playlists.total }} playlists</p>
|
|
|
|
</template>
|
|
|
|
<template slot="content">
|
2018-12-17 04:35:39 -05:00
|
|
|
<list-item-playlist v-for="playlist in playlists.items" :key="playlist.id" :playlist="playlist" @click="open_playlist(playlist)">
|
2018-12-15 03:56:09 -05:00
|
|
|
<template slot="actions">
|
|
|
|
<a @click="open_dialog(playlist)">
|
|
|
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</list-item-playlist>
|
|
|
|
<modal-dialog-playlist :show="show_details_modal" :playlist="selected_playlist" @close="show_details_modal = false" />
|
2018-08-11 01:47:10 -04:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
|
|
|
import TabsMusic from '@/components/TabsMusic'
|
|
|
|
import ListItemPlaylist from '@/components/ListItemPlaylist'
|
2018-12-15 03:56:09 -05:00
|
|
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
2018-08-11 01:47:10 -04:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
const playlistsData = {
|
|
|
|
load: function (to) {
|
|
|
|
return webapi.library_playlists()
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
|
|
|
vm.playlists = response.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PagePlaylists',
|
|
|
|
mixins: [ LoadDataBeforeEnterMixin(playlistsData) ],
|
2018-12-15 03:56:09 -05:00
|
|
|
components: { ContentWithHeading, TabsMusic, ListItemPlaylist, ModalDialogPlaylist },
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
2018-12-15 03:56:09 -05:00
|
|
|
playlists: {},
|
|
|
|
|
|
|
|
show_details_modal: false,
|
|
|
|
selected_playlist: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2018-12-17 04:35:39 -05:00
|
|
|
open_playlist: function (playlist) {
|
|
|
|
this.$router.push({ path: '/playlists/' + playlist.id })
|
|
|
|
},
|
|
|
|
|
2018-12-15 03:56:09 -05:00
|
|
|
open_dialog: function (playlist) {
|
|
|
|
this.selected_playlist = playlist
|
|
|
|
this.show_details_modal = true
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|