diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index 179ffedd738d93c76322ea6e06809aae3afe174c..f225313b6b5f64139ed668473a6ebea51bc58eec 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -36,6 +36,12 @@ <router-link class="item" v-else :to="{name: 'login'}"><i class="sign in icon"></i> Login</router-link> <router-link class="item" :to="{path: '/library'}"><i class="sound icon"> </i>Browse library</router-link> <router-link class="item" :to="{path: '/favorites'}"><i class="heart icon"></i> Favorites</router-link> + <a + @click="$store.commit('playlists/chooseTrack', null)" + v-if="$store.state.auth.authenticated" + class="item"> + <i class="list icon"></i> Playlists + </a> <router-link v-if="$store.state.auth.authenticated" class="item" :to="{path: '/activity'}"><i class="bell icon"></i> Activity</router-link> diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index a40409615dc75bb0e29ebe230f626a1757b7a9f4..0437ac88151ad166ea6704579b8069adf35007f2 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -24,6 +24,11 @@ <play-button class="orange" :track="track">Play</play-button> <track-favorite-icon :track="track" :button="true"></track-favorite-icon> + <track-playlist-icon + :button="true" + v-if="$store.state.auth.authenticated" + :track="track"></track-playlist-icon> + <a :href="wikipediaUrl" target="_blank" class="ui button"> <i class="wikipedia icon"></i> Search on wikipedia @@ -66,6 +71,7 @@ import logger from '@/logging' import backend from '@/audio/backend' import PlayButton from '@/components/audio/PlayButton' import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon' +import TrackPlaylistIcon from '@/components/playlists/TrackPlaylistIcon' const FETCH_URL = 'tracks/' @@ -73,6 +79,7 @@ export default { props: ['id'], components: { PlayButton, + TrackPlaylistIcon, TrackFavoriteIcon }, data () { diff --git a/front/src/router/index.js b/front/src/router/index.js index 31bd0805cc1f660fbd1aae163f341476d0d7c027..7cffb6f9975954861bd8c01f7047db66818d5f8c 100644 --- a/front/src/router/index.js +++ b/front/src/router/index.js @@ -110,7 +110,14 @@ export default new Router({ }, { path: 'radios/build', name: 'library.radios.build', component: RadioBuilder, props: true }, { path: 'radios/build/:id', name: 'library.radios.edit', component: RadioBuilder, props: true }, - { path: 'playlists/:id', name: 'library.playlists.detail', component: PlaylistDetail, props: true }, + { + path: 'playlists/:id', + name: 'library.playlists.detail', + component: PlaylistDetail, + props: (route) => ({ + id: route.params.id, + defaultEdit: route.query.mode === 'edit' }) + }, { path: 'artists/:id', name: 'library.artists.detail', component: LibraryArtist, props: true }, { path: 'albums/:id', name: 'library.albums.detail', component: LibraryAlbum, props: true }, { path: 'tracks/:id', name: 'library.tracks.detail', component: LibraryTrack, props: true },