« 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--src/content/dependencies/generateAlbumCommentaryPage.js1
-rw-r--r--src/content/dependencies/generateAlbumSidebarTrackSection.js24
-rw-r--r--src/static/site5.css4
3 files changed, 26 insertions, 3 deletions
diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js
index 2982b037..3ad1549e 100644
--- a/src/content/dependencies/generateAlbumCommentaryPage.js
+++ b/src/content/dependencies/generateAlbumCommentaryPage.js
@@ -207,6 +207,7 @@ export default {
             section.slots({
               anchor: true,
               open: true,
+              mode: 'commentary',
             })),
         ],
       });
diff --git a/src/content/dependencies/generateAlbumSidebarTrackSection.js b/src/content/dependencies/generateAlbumSidebarTrackSection.js
index 00e9b621..d3cd37f0 100644
--- a/src/content/dependencies/generateAlbumSidebarTrackSection.js
+++ b/src/content/dependencies/generateAlbumSidebarTrackSection.js
@@ -37,12 +37,21 @@ export default {
       trackSection.tracks
         .map(track => track.directory);
 
+    data.tracksAreMissingCommentary =
+      trackSection.tracks
+        .map(track => !track.commentary);
+
     return data;
   },
 
   slots: {
     anchor: {type: 'boolean'},
     open: {type: 'boolean'},
+
+    mode: {
+      validate: v => v.is('info', 'commentary'),
+      default: 'info',
+    },
   },
 
   generate(data, relations, slots, {getColors, html, language}) {
@@ -62,14 +71,23 @@ export default {
       relations.trackLinks.map((trackLink, index) =>
         html.tag('li',
           {
-            class:
+            class: [
               data.includesCurrentTrack &&
               index === data.currentTrackIndex &&
-              'current',
+                'current',
+
+              slots.mode === 'commentary' &&
+              data.tracksAreMissingCommentary[index] &&
+                'no-commentary',
+            ],
           },
           language.$('albumSidebar.trackList.item', {
             track:
-              (slots.anchor
+              (slots.mode === 'commentary' && data.tracksAreMissingCommentary[index]
+                ? trackLink.slots({
+                    linkless: true,
+                  })
+             : slots.anchor
                 ? trackLink.slots({
                     anchor: true,
                     hash: data.trackDirectories[index],
diff --git a/src/static/site5.css b/src/static/site5.css
index d50d4623..0eb7dcda 100644
--- a/src/static/site5.css
+++ b/src/static/site5.css
@@ -794,6 +794,10 @@ li > ul {
   display: none;
 }
 
+html[data-url-key="localized.albumCommentary"] li.no-commentary {
+  opacity: 0.7;
+}
+
 /* Images */
 
 .image-container {