2016-01-15 07:27:25 +00:00
|
|
|
<template>
|
|
|
|
<section id="artistWrapper">
|
|
|
|
<h1 class="heading">
|
|
|
|
<span class="overview">
|
|
|
|
<img :src="artist.image" width="64" height="64" class="cover">
|
|
|
|
{{ artist.name }}
|
|
|
|
<i class="fa fa-angle-down toggler"
|
|
|
|
v-show="isPhone && !showingControls"
|
|
|
|
@click="showingControls = true"></i>
|
|
|
|
<i class="fa fa-angle-up toggler"
|
|
|
|
v-show="isPhone && showingControls"
|
|
|
|
@click.prevent="showingControls = false"></i>
|
|
|
|
|
|
|
|
<span class="meta" v-show="meta.songCount">
|
2016-01-15 10:05:54 +00:00
|
|
|
{{ artist.albums.length }} {{ artist.albums.length | pluralize 'album' }}
|
2016-01-15 07:27:25 +00:00
|
|
|
•
|
2016-01-15 10:05:54 +00:00
|
|
|
{{ meta.songCount }} {{ meta.songCount | pluralize 'song' }}
|
2016-01-15 07:27:25 +00:00
|
|
|
•
|
|
|
|
{{ meta.totalLength }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="buttons" v-show="!isPhone || showingControls">
|
2016-01-16 18:11:24 +00:00
|
|
|
<button class="play-shuffle" @click.prevent="shuffle" v-if="selectedSongs.length < 2">
|
2016-01-15 07:27:25 +00:00
|
|
|
<i class="fa fa-random"></i> All
|
|
|
|
</button>
|
|
|
|
<button class="play-shuffle" @click.prevent="shuffleSelected" v-if="selectedSongs.length > 1">
|
|
|
|
<i class="fa fa-random"></i> Selected
|
|
|
|
</button>
|
|
|
|
<button class="add-to" @click.prevent="showingAddToMenu = !showingAddToMenu" v-if="selectedSongs.length">
|
|
|
|
{{ showingAddToMenu ? 'Cancel' : 'Add To…' }}
|
|
|
|
</button>
|
|
|
|
|
2016-01-16 18:11:24 +00:00
|
|
|
<add-to-menu :songs="selectedSongs" :showing="showingAddToMenu"><add-to-menu>
|
2016-01-15 07:27:25 +00:00
|
|
|
</div>
|
|
|
|
</h1>
|
|
|
|
|
2016-01-16 18:11:24 +00:00
|
|
|
<song-list :items="artist.songs" :selected-songs.sync="selectedSongs" type="artist"></song-list>
|
2016-01-15 07:27:25 +00:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import isMobile from 'ismobilejs';
|
|
|
|
|
|
|
|
import artistStore from '../../../stores/artist';
|
|
|
|
import playback from '../../../services/playback';
|
|
|
|
import hasSongList from '../../../mixins/has-song-list';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
mixins: [hasSongList],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
artist: artistStore.stub,
|
|
|
|
isPhone: isMobile.phone,
|
|
|
|
showingControls: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
events: {
|
|
|
|
/**
|
2016-01-15 08:13:23 +00:00
|
|
|
* Listen to 'main-content-view:load' event (triggered from $root currently)
|
|
|
|
* to load the requested artist into view if applicable.
|
|
|
|
*
|
2016-01-17 14:26:24 +00:00
|
|
|
* @param {String} view The view's name
|
2016-01-15 08:13:23 +00:00
|
|
|
* @param {Object} artist
|
2016-01-15 07:27:25 +00:00
|
|
|
*/
|
2016-01-15 08:13:23 +00:00
|
|
|
'main-content-view:load': function (view, artist) {
|
|
|
|
if (view === 'artist') {
|
|
|
|
artistStore.getSongsByArtist(artist);
|
|
|
|
this.artist = artist;
|
|
|
|
}
|
2016-01-15 07:27:25 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
/**
|
|
|
|
* Shuffle the songs by the current artist.
|
|
|
|
*/
|
|
|
|
shuffle() {
|
|
|
|
playback.queueAndPlay(this.artist.songs, true);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass" scoped>
|
|
|
|
@import "resources/assets/sass/partials/_vars.scss";
|
|
|
|
@import "resources/assets/sass/partials/_mixins.scss";
|
|
|
|
|
|
|
|
#artistWrapper {
|
|
|
|
button.play-shuffle {
|
|
|
|
i {
|
|
|
|
margin-right: 0 !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.heading {
|
|
|
|
.overview {
|
|
|
|
position: relative;
|
|
|
|
padding-left: 84px;
|
2016-01-15 08:26:02 +00:00
|
|
|
|
|
|
|
@media only screen and (max-device-width : 768px) {
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
2016-01-15 07:27:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.cover {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: -7px;
|
2016-01-15 08:26:02 +00:00
|
|
|
|
|
|
|
@media only screen and (max-device-width : 768px) {
|
|
|
|
display: none;
|
|
|
|
}
|
2016-01-15 07:27:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|