diff --git a/changes/changelog.d/725.enhancement b/changes/changelog.d/725.enhancement new file mode 100644 index 000000000..4c30ba427 --- /dev/null +++ b/changes/changelog.d/725.enhancement @@ -0,0 +1 @@ +Merged artist/album buttons with title text on artist and album pages (#725) diff --git a/front/src/App.vue b/front/src/App.vue index e214f2fb4..1cc6a2d3c 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -93,6 +93,18 @@ export default { handler: this.incrementNotificationCountInSidebar }) }, + mounted () { + let self = this + + // slight hack to allow use to have internal links in tags + // while preserving router behaviour + document.documentElement.addEventListener('click', function (event) { + if (!event.target.matches('a.internal')) return; + self.$router.push(event.target.getAttribute('href')) + event.preventDefault(); + }, false); + + }, destroyed () { this.$store.commit('ui/removeWebsocketEventHandler', { eventName: 'inbox.item_added', diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue index ce6f0abff..55190a3d3 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -12,11 +12,6 @@ {{ album.title }}
-
- - Artist page - -
@@ -181,8 +176,9 @@ export default { ) }, subtitle () { - let msg = this.$npgettext('Content/Album/Header.Title', 'Album containing %{ count } track, by %{ artist }', 'Album containing %{ count } tracks, by %{ artist }', this.album.tracks.length) - return this.$gettextInterpolate(msg, {count: this.album.tracks.length, artist: this.album.artist.name}) + let route = this.$router.resolve({name: 'library.artists.detail', params: {id: this.album.artist.id }}) + let msg = this.$npgettext('Content/Album/Header.Title', 'Album containing %{ count } track, by %{ artist }', 'Album containing %{ count } tracks, by %{ artist }', this.album.tracks.length) + return this.$gettextInterpolate(msg, {count: this.album.tracks.length, artist: this.album.artist.name, artistUrl: route.location.path}) } }, watch: { diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index 0d0e84565..66b17d04b 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -15,24 +15,9 @@
{{ track.title }}
- From album %{ album } by %{ artist } -
-
-
- - Album page - - - Artist page - +
From album %{ album } by %{ artist }
@@ -299,6 +284,14 @@ export default { cover() { return null }, + albumUrl () { + let route = this.$router.resolve({name: 'library.albums.detail', params: {id: this.track.album.id }}) + return route.location.path + }, + artistUrl () { + let route = this.$router.resolve({name: 'library.artists.detail', params: {id: this.track.artist.id }}) + return route.location.path + }, headerStyle() { if (!this.cover) { return ""