« get me outta code hell

content: generate{Album,Flash}InfoPage: credit sources - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-24 15:06:58 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-08-02 14:59:40 -0300
commit8d074913ce4ec148e6259cf6fbc23db717a08631 (patch)
treefaf7722ec2daecf70e8693a101699729e2d3e355 /src
parent7be872b48d2886e7331ca38b33005d40ffb187c0 (diff)
content: generate{Album,Flash}InfoPage: credit sources
Diffstat (limited to 'src')
-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',