« 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/generateAlbumInfoPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAlbumInfoPage.js')
-rw-r--r--src/content/dependencies/generateAlbumInfoPage.js31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js
index 1c5be6e6..8f8b921c 100644
--- a/src/content/dependencies/generateAlbumInfoPage.js
+++ b/src/content/dependencies/generateAlbumInfoPage.js
@@ -13,9 +13,9 @@ export default {
     'generateAlbumSocialEmbed',
     'generateAlbumStyleTags',
     'generateAlbumTrackList',
+    'generateCollapsedContentEntrySection',
     'generateCommentaryContentHeading',
     'generateCommentaryEntry',
-    'generateContentContentHeading',
     'generateContentHeading',
     'generatePageLayout',
     'generateReadCommentaryLine',
@@ -58,9 +58,6 @@ export default {
     contentHeading:
       relation('generateContentHeading'),
 
-    contentContentHeading:
-      relation('generateContentContentHeading', album),
-
     releaseInfo:
       relation('generateAlbumReleaseInfo', album),
 
@@ -90,9 +87,10 @@ export default {
       album.commentary
         .map(entry => relation('generateCommentaryEntry', entry)),
 
-    creditSourceEntries:
-      album.creditingSources
-        .map(entry => relation('generateCommentaryEntry', entry)),
+    creditingSourcesSection:
+      relation('generateCollapsedContentEntrySection',
+        album.creditingSources,
+        album),
   }),
 
   data: (album) => ({
@@ -172,7 +170,7 @@ export default {
               !html.isBlank(relations.artistCommentaryEntries) &&
                 relations.readCommentaryLine,
 
-              !html.isBlank(relations.creditSourceEntries) &&
+              !html.isBlank(relations.creditingSourcesSection) &&
                 language.encapsulate(capsule, 'readCreditingSources', capsule =>
                   language.$(capsule, {
                     link:
@@ -192,9 +190,7 @@ export default {
               date: language.formatDate(data.dateAddedToWiki),
             })),
 
-          (!html.isBlank(relations.artistCommentaryEntries) ||
-           !html.isBlank(relations.creditSourceEntries))
-          &&
+          !html.isBlank(relations.artistCommentaryEntries) &&
             html.tag('hr', {class: 'main-separator'}),
 
           language.encapsulate('releaseInfo.additionalFiles', capsule =>
@@ -213,15 +209,10 @@ export default {
             relations.artistCommentaryEntries,
           ]),
 
-          html.tags([
-            relations.contentContentHeading.clone()
-              .slots({
-                attributes: {id: 'crediting-sources'},
-                string: 'misc.creditingSources',
-              }),
-
-            relations.creditSourceEntries,
-          ]),
+          relations.creditingSourcesSection.slots({
+            id: 'crediting-sources',
+            string: 'misc.creditingSources',
+          }),
         ],
 
         navLinkStyle: 'hierarchical',