Skip to content
Snippets Groups Projects
Verified Commit 55cb7fc2 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #432: display tags on artist, album and track pages

parent d2b7db2c
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<div v-html="subtitle"></div> <div v-html="subtitle"></div>
</div> </div>
</h2> </h2>
<tags-list v-if="object.tags && object.tags.length > 0" :tags="object.tags"></tags-list>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div class="header-buttons"> <div class="header-buttons">
...@@ -103,6 +104,7 @@ import backend from "@/audio/backend" ...@@ -103,6 +104,7 @@ import backend from "@/audio/backend"
import PlayButton from "@/components/audio/PlayButton" import PlayButton from "@/components/audio/PlayButton"
import EmbedWizard from "@/components/audio/EmbedWizard" import EmbedWizard from "@/components/audio/EmbedWizard"
import Modal from '@/components/semantic/Modal' import Modal from '@/components/semantic/Modal'
import TagsList from "@/components/tags/List"
const FETCH_URL = "albums/" const FETCH_URL = "albums/"
...@@ -123,7 +125,8 @@ export default { ...@@ -123,7 +125,8 @@ export default {
components: { components: {
PlayButton, PlayButton,
EmbedWizard, EmbedWizard,
Modal Modal,
TagsList,
}, },
data() { data() {
return { return {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</div> </div>
</div> </div>
</h2> </h2>
<tags-list v-if="object.tags && object.tags.length > 0" :tags="object.tags"></tags-list>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div class="header-buttons"> <div class="header-buttons">
<div class="ui buttons"> <div class="ui buttons">
...@@ -123,17 +124,20 @@ import PlayButton from "@/components/audio/PlayButton" ...@@ -123,17 +124,20 @@ import PlayButton from "@/components/audio/PlayButton"
import EmbedWizard from "@/components/audio/EmbedWizard" import EmbedWizard from "@/components/audio/EmbedWizard"
import Modal from '@/components/semantic/Modal' import Modal from '@/components/semantic/Modal'
import RadioButton from "@/components/radios/Button" import RadioButton from "@/components/radios/Button"
import TagsList from "@/components/tags/List"
const FETCH_URL = "albums/" const FETCH_URL = "albums/"
export default { export default {
props: ["id"], props: ["id"],
components: { components: {
PlayButton, PlayButton,
EmbedWizard, EmbedWizard,
Modal, Modal,
RadioButton RadioButton,
TagsList,
}, },
data() { data() {
return { return {
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<div class="sub header" v-html="subtitle"></div> <div class="sub header" v-html="subtitle"></div>
</div> </div>
</h2> </h2>
<tags-list v-if="track.tags && track.tags.length > 0" :tags="track.tags"></tags-list>
<div class="ui hidden divider"></div>
<div class="header-buttons"> <div class="header-buttons">
<div class="ui buttons"> <div class="ui buttons">
<play-button class="orange" :track="track"> <play-button class="orange" :track="track">
...@@ -121,6 +123,7 @@ import TrackFavoriteIcon from "@/components/favorites/TrackFavoriteIcon" ...@@ -121,6 +123,7 @@ import TrackFavoriteIcon from "@/components/favorites/TrackFavoriteIcon"
import TrackPlaylistIcon from "@/components/playlists/TrackPlaylistIcon" import TrackPlaylistIcon from "@/components/playlists/TrackPlaylistIcon"
import Modal from '@/components/semantic/Modal' import Modal from '@/components/semantic/Modal'
import EmbedWizard from "@/components/audio/EmbedWizard" import EmbedWizard from "@/components/audio/EmbedWizard"
import TagsList from "@/components/tags/List"
const FETCH_URL = "tracks/" const FETCH_URL = "tracks/"
...@@ -131,7 +134,8 @@ export default { ...@@ -131,7 +134,8 @@ export default {
TrackPlaylistIcon, TrackPlaylistIcon,
TrackFavoriteIcon, TrackFavoriteIcon,
Modal, Modal,
EmbedWizard EmbedWizard,
TagsList,
}, },
data() { data() {
return { return {
......
<template>
<div>
<router-link
:to="{name: 'library.tags.detail', params: {id: tag}}"
class="ui circular hashtag label"
v-for="tag in toDisplay"
:key="tag">
#{{ tag }}
</router-link>
<div role="button" @click.prevent="honorLimit = false" class="ui circular inverted teal label" v-if="toDisplay.length < tags.length">
<translate translate-context="Content/*/Button/Label/Verb" :translate-params="{count: tags.length - toDisplay.length}" :translate-n="tags.length - toDisplay.length" translate-plural="Show %{ count } more tags">Show 1 more tag</translate>
</div>
</div>
</template>
<script>
export default {
props: ['tags'],
data () {
return {
limit: 5,
honorLimit: true,
}
},
computed: {
toDisplay () {
if (!this.honorLimit) {
return this.tags
}
return (this.tags || []).slice(0, this.limit)
}
}
}
</script>
<style lang="scss" scoped>
.ui.circular.label {
padding-left: 1em !important;
padding-right: 1em !important;
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment