« 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/generateAlbumCommentaryPage.js51
1 files changed, 32 insertions, 19 deletions
diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js
index eb07a226..b78fd24e 100644
--- a/src/content/dependencies/generateAlbumCommentaryPage.js
+++ b/src/content/dependencies/generateAlbumCommentaryPage.js
@@ -97,6 +97,7 @@ export default {
 
     data.name = album.name;
     data.color = album.color;
+    data.date = album.date;
 
     const tracksWithCommentary =
       album.tracks
@@ -150,25 +151,37 @@ export default {
         mainClasses: ['long-content'],
         mainContent: [
           html.tag('p',
-            language.encapsulate(pageCapsule, 'infoLine', workingCapsule => {
-              const workingOptions = {};
-
-              if (data.entryCount >= 1) {
-                workingOptions.words =
-                  html.tag('b',
-                    language.formatWordCount(data.wordCount, {unit: true}));
-
-                workingOptions.entries =
-                  html.tag('b',
-                    language.countCommentaryEntries(data.entryCount, {unit: true}));
-              }
-
-              if (data.entryCount === 0) {
-                workingCapsule += '.withoutCommentary';
-              }
-
-              return language.$(workingCapsule, workingOptions);
-            })),
+            {[html.joinChildren]: html.tag('br')},
+
+            [
+              data.date &&
+              data.entryCount >= 1 &&
+                language.$('releaseInfo.albumReleased', {
+                  date:
+                    html.tag('b',
+                      language.formatDate(data.date)),
+                }),
+
+              language.encapsulate(pageCapsule, 'infoLine', workingCapsule => {
+                const workingOptions = {};
+
+                if (data.entryCount >= 1) {
+                  workingOptions.words =
+                    html.tag('b',
+                      language.formatWordCount(data.wordCount, {unit: true}));
+
+                  workingOptions.entries =
+                    html.tag('b',
+                      language.countCommentaryEntries(data.entryCount, {unit: true}));
+                }
+
+                if (data.entryCount === 0) {
+                  workingCapsule += '.withoutCommentary';
+                }
+
+                return language.$(workingCapsule, workingOptions);
+              })
+            ]),
 
           relations.albumCommentaryEntries &&
             language.encapsulate(pageCapsule, 'entry', entryCapsule => [