« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--static/client.js14
-rwxr-xr-xupd8.js2
2 files changed, 16 insertions, 0 deletions
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}) => {
                     <h1 class="info-card-name"><a></a></h1>
                     <p class="info-card-album">${strings('releaseInfo.from', {album: '<a></a>'})}</p>
                     <p class="info-card-artists">${strings('releaseInfo.by', {artists: '<span></span>'})}</p>
+                    <p class="info-card-cover-artists">${strings('releaseInfo.coverArtBy', {artists: '<span></span>'})}</p>
                 </div>
             </div>
         </div>
@@ -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),