From e11c6707e9279d20c1a6373672ba6b3cd684f829 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 6 Apr 2021 14:19:37 -0300 Subject: show cover artists in info card --- static/client.js | 14 ++++++++++++++ upd8.js | 2 ++ 2 files changed, 16 insertions(+) diff --git a/static/client.js b/static/client.js index 6883b83b..fe4f5c45 100644 --- a/static/client.js +++ b/static/client.js @@ -284,6 +284,20 @@ const infoCard = (() => { return a; })); + const coverArtistParagraph = container.querySelector('.info-card-cover-artists'); + const coverArtistSpan = coverArtistParagraph.querySelector('span'); + if (data.links.coverArtists.length) { + coverArtistParagraph.style.display = 'block'; + coverArtistSpan.innerHTML = joinElements('conjunction', data.links.coverArtists.map(({ who: artist }) => { + const a = document.createElement('a'); + a.href = getLinkHref('artist', artist.directory); + a.innerText = artist.name; + return a; + })); + } else { + coverArtistParagraph.style.display = 'none'; + } + // Cover art. const [ containerNoReveal, containerReveal ] = [ diff --git a/upd8.js b/upd8.js index 6ea0bf39..c6ec49b2 100755 --- a/upd8.js +++ b/upd8.js @@ -2444,6 +2444,7 @@ writePage.html = (pageFn, {paths, strings, to}) => {

${strings('releaseInfo.from', {album: ''})}

${strings('releaseInfo.by', {artists: ''})}

+

${strings('releaseInfo.coverArtBy', {artists: ''})}

@@ -3145,6 +3146,7 @@ function writeTrackPage(track) { links: { artists: serializeContribs(track.artists), contributors: serializeContribs(track.contributors), + coverArtists: serializeContribs(track.coverArtists || []), album: serializeLink(track.album), groups: track.album.groups.map(serializeLink), references: track.references.map(serializeLink), -- cgit 1.3.0-6-gf8a5