« get me outta code hell

show cover artists in info card - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/static
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-04-06 14:19:37 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-04-06 14:19:37 -0300
commite11c6707e9279d20c1a6373672ba6b3cd684f829 (patch)
tree9c4be9136bc76f3c399c85b1d2d428ddd3e545cb /static
parentde0f42a3cd34311d1448fc0ebed901ad1260d3db (diff)
show cover artists in info card
Diffstat (limited to 'static')
-rw-r--r--static/client.js14
1 files changed, 14 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 ] = [