diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-08-13 23:24:36 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-08-13 23:24:36 -0300 |
commit | 3d218700701a42d2b43714ddc63620ee308f354e (patch) | |
tree | 3a96dc4107966949bbf3b5326994d8f2164b3510 /src/content/dependencies/listRandomPageLinks.js | |
parent | 004967af7dff9d7c1f87ef89d8bbafddf830afce (diff) |
content, client: "Random Pages" listing
Diffstat (limited to 'src/content/dependencies/listRandomPageLinks.js')
-rw-r--r-- | src/content/dependencies/listRandomPageLinks.js | 77 |
1 files changed, 70 insertions, 7 deletions
diff --git a/src/content/dependencies/listRandomPageLinks.js b/src/content/dependencies/listRandomPageLinks.js index 28a925ac..43bf7dd5 100644 --- a/src/content/dependencies/listRandomPageLinks.js +++ b/src/content/dependencies/listRandomPageLinks.js @@ -1,28 +1,91 @@ export default { - contentDependencies: ['generateListingPage'], - extraDependencies: ['html', 'wikiData'], + contentDependencies: [ + 'generateListingPage', + 'generateListRandomPageLinksGroupSection', + ], - sprawl() { - return {}; + extraDependencies: ['html', 'language', 'wikiData'], + + sprawl({groupData}) { + return {groupData}; }, query(sprawl, spec) { + const group = directory => + sprawl.groupData.find(group => group.directory === directory); + return { spec, + officialGroup: group('official'), + fandomGroup: group('fandom'), + beyondGroup: group('beyond'), }; }, relations(relation, query) { return { page: relation('generateListingPage', query.spec), + + officialSection: + relation('generateListRandomPageLinksGroupSection', query.officialGroup), + + fandomSection: + relation('generateListRandomPageLinksGroupSection', query.fandomGroup), + + beyondSection: + relation('generateListRandomPageLinksGroupSection', query.beyondGroup), }; }, - generate(relations, {html}) { + generate(relations, {html, language}) { return relations.page.slots({ type: 'custom', - content: - html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + content: [ + html.tag('p', + language.$('listingPage.other.randomPages.chooseLinkLine')), + + html.tag('p', + {class: 'js-hide-once-data'}, + language.$('listingPage.other.randomPages.dataLoadingLine')), + + html.tag('p', + {class: 'js-show-once-data'}, + language.$('listingPage.other.randomPages.dataLoadedLine')), + + html.tag('dl', [ + html.tag('dt', + language.$('listingPage.other.randomPages.misc')), + + html.tag('dd', + html.tag('ul', [ + html.tag('li', [ + html.tag('a', + {href: '#', 'data-random': 'artist'}, + language.$('listingPage.other.randomPages.misc.randomArtist')), + + '(' + + html.tag('a', + {href: '#', 'data-random': 'artist-more-than-one-contrib'}, + language.$('listingPage.other.randomPages.misc.atLeastTwoContributions')) + + ')', + ]), + + html.tag('li', + html.tag('a', + {href: '#', 'data-random': 'album'}, + language.$('listingPage.other.randomPages.misc.randomAlbumWholeSite'))), + + html.tag('li', + html.tag('a', + {href: '#', 'data-random': 'track'}, + language.$('listingPage.other.randomPages.misc.randomTrackWholeSite'))), + ])), + + relations.officialSection, + relations.fandomSection, + relations.beyondSection, + ]), + ], }); }, }; |