« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/upd8.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-xsrc/upd8.js27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 5615bb1..1337d28 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -5474,6 +5474,11 @@ function writeGroupPage(group, {wikiData}) {
     const releasedTracks = releasedAlbums.flatMap(album => album.tracks);
     const totalDuration = getTotalDuration(releasedTracks);
 
+    const albumLines = group.albums.map(album => ({
+        album,
+        otherGroup: album.groups.find(g => g !== group)
+    }));
+
     const infoPage = {
         type: 'page',
         path: ['groupInfo', group.directory],
@@ -5505,14 +5510,22 @@ function writeGroupPage(group, {wikiData}) {
                         })
                     }</p>
                     <ul>
-                        ${group.albums.map(album => fixWS`
-                            <li>${
-                                strings('groupInfoPage.albumList.item', {
-                                    year: album.date.getFullYear(),
-                                    album: link.album(album)
+                        ${albumLines.map(({ album, otherGroup }) => {
+                            const item = strings('groupInfoPage.albumList.item', {
+                                year: album.date.getFullYear(),
+                                album: link.album(album)
+                            });
+                            return html.tag('li', (otherGroup
+                                ? strings('groupInfoPage.albumList.item.withAccent', {
+                                    item,
+                                    accent: html.tag('span',
+                                        {class: 'other-group-accent'},
+                                        strings('groupInfoPage.albumList.item.otherGroupAccent', {
+                                            group: link.groupInfo(otherGroup, {color: false})
+                                        }))
                                 })
-                            }</li>
-                        `).join('\n')}
+                                : item));
+                        }).join('\n')}
                     </ul>
                 `
             },