Newer
Older
Eliot Berriot
committed
<template>
<table class="ui compact very basic fixed single line table">
<thead>
<tr>
<th></th>
<th></th>
<th colspan="6">Title</th>
<th colspan="6">Artist</th>
<th colspan="6">Album</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="track in tracks">
<td>
<play-button class="basic icon" :discrete="true" :track="track"></play-button>
</td>
<td>
<img class="ui mini image" v-if="track.album.cover" :src="backend.absoluteUrl(track.album.cover)">
<img class="ui mini image" v-else src="../../..//assets/audio/default-cover.png">
</td>
<td colspan="6">
Eliot Berriot
committed
<router-link class="track" :to="{name: 'library.track', params: {id: track.id }}">
Eliot Berriot
committed
{{ track.title }}
</router-link>
</td>
<td colspan="6">
Eliot Berriot
committed
<router-link class="artist discrete link" :to="{name: 'library.artist', params: {id: track.artist.id }}">
Eliot Berriot
committed
{{ track.artist.name }}
</router-link>
</td>
<td colspan="6">
Eliot Berriot
committed
<router-link class="album discrete link" :to="{name: 'library.album', params: {id: track.album.id }}">
Eliot Berriot
committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{{ track.album.title }}
</router-link>
</td>
<td><track-favorite-icon class="favorite-icon" :track="track"></track-favorite-icon></td>
</tr>
</tbody>
</table>
</template>
<script>
import backend from '@/audio/backend'
import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
import PlayButton from '@/components/audio/PlayButton'
export default {
props: ['tracks'],
components: {
TrackFavoriteIcon,
PlayButton
},
data () {
return {
backend: backend
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
tr:not(:hover) .favorite-icon:not(.favorited) {
display: none;
}
</style>