« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateAlbumInfoPage.js17
-rw-r--r--src/content/dependencies/generateFlashInfoPage.js17
2 files changed, 33 insertions, 1 deletions
diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js
index 1bffe2d0..5af3c1d6 100644
--- a/src/content/dependencies/generateAlbumInfoPage.js
+++ b/src/content/dependencies/generateAlbumInfoPage.js
@@ -74,6 +74,9 @@ export default {
 
     artistCommentarySection:
       relation('generateCommentarySection', album.commentary),
+
+    creditSourcesSection:
+      relation('generateCommentarySection', album.creditSources),
   }),
 
   data: (album) => ({
@@ -150,6 +153,15 @@ export default {
                     }))
 
                 : html.blank()),
+
+              !html.isBlank(relations.creditSourcesSection) &&
+                language.encapsulate(capsule, 'readCreditSources', capsule =>
+                  language.$(capsule, {
+                    link:
+                      html.tag('a',
+                        {href: '#credit-sources'},
+                        language.$(capsule, 'link')),
+                  })),
             ])),
 
           relations.trackList,
@@ -177,6 +189,11 @@ export default {
             ])),
 
           relations.artistCommentarySection,
+
+          relations.creditSourcesSection.slots({
+            id: 'credit-sources',
+            title: language.$('misc.creditSources'),
+          }),
         ],
 
         navLinkStyle: 'hierarchical',
diff --git a/src/content/dependencies/generateFlashInfoPage.js b/src/content/dependencies/generateFlashInfoPage.js
index d06f0c01..2119977f 100644
--- a/src/content/dependencies/generateFlashInfoPage.js
+++ b/src/content/dependencies/generateFlashInfoPage.js
@@ -63,6 +63,9 @@ export default {
 
     artistCommentarySection:
       relation('generateCommentarySection', flash.commentary),
+
+    creditSourcesSection:
+      relation('generateCommentarySection', flash.creditSources),
   }),
 
   data: (_query, flash) => ({
@@ -125,6 +128,15 @@ export default {
                         {href: '#artist-commentary'},
                         language.$(capsule, 'link')),
                   })),
+
+              !html.isBlank(relations.creditSourcesSection) &&
+                language.encapsulate(capsule, 'readCreditSources', capsule =>
+                  language.$(capsule, {
+                    link:
+                      html.tag('a',
+                        {href: '#credit-sources'},
+                        language.$(capsule, 'link')),
+                  })),
             ])),
 
           html.tags([
@@ -152,7 +164,10 @@ export default {
             }),
           ]),
 
-          relations.artistCommentarySection,
+          relations.creditSourcesSection.slots({
+            id: 'credit-sources',
+            title: language.$('misc.creditSources'),
+          }),
         ],
 
         navLinkStyle: 'hierarchical',