mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[web] Refactor the Spotify playlist item page
This commit is contained in:
parent
cee1513966
commit
ee48395f1b
@ -5,16 +5,34 @@
|
|||||||
<h2 class="subtitle is-7" v-text="item.owner.display_name" />
|
<h2 class="subtitle is-7" v-text="item.owner.display_name" />
|
||||||
</div>
|
</div>
|
||||||
<div class="media-right">
|
<div class="media-right">
|
||||||
<slot name="actions" />
|
<a @click.prevent.stop="show_details_modal = true">
|
||||||
|
<mdicon class="icon has-text-dark" name="dots-vertical" size="16" />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<teleport to="#app">
|
||||||
|
<modal-dialog-playlist-spotify
|
||||||
|
:show="show_details_modal"
|
||||||
|
:playlist="item"
|
||||||
|
@close="show_details_modal = false"
|
||||||
|
/>
|
||||||
|
</teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ModalDialogPlaylistSpotify from '@/components/ModalDialogPlaylistSpotify.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListItemPlaylistSpotify',
|
name: 'ListItemPlaylistSpotify',
|
||||||
|
components: {
|
||||||
|
ModalDialogPlaylistSpotify
|
||||||
|
},
|
||||||
props: { item: { required: true, type: Object } },
|
props: { item: { required: true, type: Object } },
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return { show_details_modal: false }
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
open_playlist() {
|
open_playlist() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
@ -40,21 +40,7 @@
|
|||||||
:key="playlist.id"
|
:key="playlist.id"
|
||||||
:item="playlist"
|
:item="playlist"
|
||||||
>
|
>
|
||||||
<template #actions>
|
|
||||||
<a @click.prevent.stop="open_playlist_dialog(playlist)">
|
|
||||||
<mdicon
|
|
||||||
class="icon has-text-dark"
|
|
||||||
name="dots-vertical"
|
|
||||||
size="16"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-playlist-spotify>
|
</list-item-playlist-spotify>
|
||||||
<modal-dialog-playlist-spotify
|
|
||||||
:show="show_playlist_details_modal"
|
|
||||||
:playlist="selected_playlist"
|
|
||||||
@close="show_playlist_details_modal = false"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav class="level">
|
<nav class="level">
|
||||||
@ -76,8 +62,6 @@ import * as types from '@/store/mutation_types'
|
|||||||
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
||||||
import ListItemAlbumSpotify from '@/components/ListItemAlbumSpotify.vue'
|
import ListItemAlbumSpotify from '@/components/ListItemAlbumSpotify.vue'
|
||||||
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
||||||
import ModalDialogAlbumSpotify from '@/components/ModalDialogAlbumSpotify.vue'
|
|
||||||
import ModalDialogPlaylistSpotify from '@/components/ModalDialogPlaylistSpotify.vue'
|
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
import TabsMusic from '@/components/TabsMusic.vue'
|
import TabsMusic from '@/components/TabsMusic.vue'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
@ -122,7 +106,6 @@ export default {
|
|||||||
ContentWithHeading,
|
ContentWithHeading,
|
||||||
ListItemAlbumSpotify,
|
ListItemAlbumSpotify,
|
||||||
ListItemPlaylistSpotify,
|
ListItemPlaylistSpotify,
|
||||||
ModalDialogPlaylistSpotify,
|
|
||||||
TabsMusic
|
TabsMusic
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -139,13 +122,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
selected_playlist: {},
|
|
||||||
show_playlist_details_modal: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
featured_playlists() {
|
featured_playlists() {
|
||||||
return this.$store.state.spotify_featured_playlists.slice(0, 3)
|
return this.$store.state.spotify_featured_playlists.slice(0, 3)
|
||||||
@ -153,13 +129,6 @@ export default {
|
|||||||
new_releases() {
|
new_releases() {
|
||||||
return this.$store.state.spotify_new_releases.slice(0, 3)
|
return this.$store.state.spotify_new_releases.slice(0, 3)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
open_playlist_dialog(playlist) {
|
|
||||||
this.selected_playlist = playlist
|
|
||||||
this.show_playlist_details_modal = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,21 +14,7 @@
|
|||||||
:key="playlist.id"
|
:key="playlist.id"
|
||||||
:item="playlist"
|
:item="playlist"
|
||||||
>
|
>
|
||||||
<template #actions>
|
|
||||||
<a @click.prevent.stop="open_playlist_dialog(playlist)">
|
|
||||||
<mdicon
|
|
||||||
class="icon has-text-dark"
|
|
||||||
name="dots-vertical"
|
|
||||||
size="16"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-playlist-spotify>
|
</list-item-playlist-spotify>
|
||||||
<modal-dialog-playlist-spotify
|
|
||||||
:show="show_details_modal"
|
|
||||||
:playlist="selected_playlist"
|
|
||||||
@close="show_details_modal = false"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
</div>
|
</div>
|
||||||
@ -38,7 +24,6 @@
|
|||||||
import * as types from '@/store/mutation_types'
|
import * as types from '@/store/mutation_types'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
||||||
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
||||||
import ModalDialogPlaylistSpotify from '@/components/ModalDialogPlaylistSpotify.vue'
|
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
import TabsMusic from '@/components/TabsMusic.vue'
|
import TabsMusic from '@/components/TabsMusic.vue'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
@ -69,7 +54,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
ContentWithHeading,
|
ContentWithHeading,
|
||||||
ListItemPlaylistSpotify,
|
ListItemPlaylistSpotify,
|
||||||
ModalDialogPlaylistSpotify,
|
|
||||||
TabsMusic
|
TabsMusic
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -86,24 +70,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
selected_playlist: {},
|
|
||||||
show_details_modal: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
featured_playlists() {
|
featured_playlists() {
|
||||||
return this.$store.state.spotify_featured_playlists
|
return this.$store.state.spotify_featured_playlists
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
open_playlist_dialog(playlist) {
|
|
||||||
this.selected_playlist = playlist
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -217,15 +217,6 @@
|
|||||||
:key="playlist.id"
|
:key="playlist.id"
|
||||||
:item="playlist"
|
:item="playlist"
|
||||||
>
|
>
|
||||||
<template #actions>
|
|
||||||
<a @click.prevent.stop="open_playlist_dialog(playlist)">
|
|
||||||
<mdicon
|
|
||||||
class="icon has-text-dark"
|
|
||||||
name="dots-vertical"
|
|
||||||
size="16"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-playlist-spotify>
|
</list-item-playlist-spotify>
|
||||||
<VueEternalLoading
|
<VueEternalLoading
|
||||||
v-if="query.type === 'playlist'"
|
v-if="query.type === 'playlist'"
|
||||||
@ -240,11 +231,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #no-more> </template>
|
<template #no-more> </template>
|
||||||
</VueEternalLoading>
|
</VueEternalLoading>
|
||||||
<modal-dialog-playlist-spotify
|
|
||||||
:show="show_playlist_details_modal"
|
|
||||||
:playlist="selected_playlist"
|
|
||||||
@close="show_playlist_details_modal = false"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_button(playlists)" class="level">
|
<nav v-if="show_all_button(playlists)" class="level">
|
||||||
@ -278,7 +264,6 @@ import ListItemArtistSpotify from '@/components/ListItemArtistSpotify.vue'
|
|||||||
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
import ListItemPlaylistSpotify from '@/components/ListItemPlaylistSpotify.vue'
|
||||||
import ListItemTrackSpotify from '@/components/ListItemTrackSpotify.vue'
|
import ListItemTrackSpotify from '@/components/ListItemTrackSpotify.vue'
|
||||||
import ModalDialogArtistSpotify from '@/components/ModalDialogArtistSpotify.vue'
|
import ModalDialogArtistSpotify from '@/components/ModalDialogArtistSpotify.vue'
|
||||||
import ModalDialogPlaylistSpotify from '@/components/ModalDialogPlaylistSpotify.vue'
|
|
||||||
import ModalDialogTrackSpotify from '@/components/ModalDialogTrackSpotify.vue'
|
import ModalDialogTrackSpotify from '@/components/ModalDialogTrackSpotify.vue'
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
import TabsSearch from '@/components/TabsSearch.vue'
|
import TabsSearch from '@/components/TabsSearch.vue'
|
||||||
@ -297,7 +282,6 @@ export default {
|
|||||||
ListItemPlaylistSpotify,
|
ListItemPlaylistSpotify,
|
||||||
ListItemTrackSpotify,
|
ListItemTrackSpotify,
|
||||||
ModalDialogArtistSpotify,
|
ModalDialogArtistSpotify,
|
||||||
ModalDialogPlaylistSpotify,
|
|
||||||
ModalDialogTrackSpotify,
|
ModalDialogTrackSpotify,
|
||||||
TabsSearch,
|
TabsSearch,
|
||||||
VueEternalLoading
|
VueEternalLoading
|
||||||
@ -312,10 +296,8 @@ export default {
|
|||||||
search_param: {},
|
search_param: {},
|
||||||
search_query: '',
|
search_query: '',
|
||||||
selected_artist: {},
|
selected_artist: {},
|
||||||
selected_playlist: {},
|
|
||||||
selected_track: {},
|
selected_track: {},
|
||||||
show_artist_details_modal: false,
|
show_artist_details_modal: false,
|
||||||
show_playlist_details_modal: false,
|
|
||||||
show_track_details_modal: false,
|
show_track_details_modal: false,
|
||||||
tracks: { items: [], total: 0 },
|
tracks: { items: [], total: 0 },
|
||||||
validSearchTypes: ['track', 'artist', 'album', 'playlist']
|
validSearchTypes: ['track', 'artist', 'album', 'playlist']
|
||||||
@ -362,10 +344,6 @@ export default {
|
|||||||
this.selected_artist = artist
|
this.selected_artist = artist
|
||||||
this.show_artist_details_modal = true
|
this.show_artist_details_modal = true
|
||||||
},
|
},
|
||||||
open_playlist_dialog(playlist) {
|
|
||||||
this.selected_playlist = playlist
|
|
||||||
this.show_playlist_details_modal = true
|
|
||||||
},
|
|
||||||
open_recent_search(query) {
|
open_recent_search(query) {
|
||||||
this.search_query = query
|
this.search_query = query
|
||||||
this.new_search()
|
this.new_search()
|
||||||
|
Loading…
Reference in New Issue
Block a user