From 8d074913ce4ec148e6259cf6fbc23db717a08631 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 24 Jun 2024 15:06:58 -0300 Subject: content: generate{Album,Flash}InfoPage: credit sources --- src/content/dependencies/generateAlbumInfoPage.js | 17 +++++++++++++++++ src/content/dependencies/generateFlashInfoPage.js | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'src') 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', -- cgit 1.3.0-6-gf8a5