diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-10-16 00:42:37 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-11-02 22:12:49 -0300 |
commit | 8fa2a306dbd74accf77028669b3a1e69f6bbeafc (patch) | |
tree | c2b7124e019d4135b0cb77263192da448c351e44 /src/content/dependencies/generateAlbumSidebar.js | |
parent | 2fb05acbe294a4d709284b959843e78aa93cb935 (diff) |
content, css: series nav presentation tweaks
Diffstat (limited to 'src/content/dependencies/generateAlbumSidebar.js')
-rw-r--r-- | src/content/dependencies/generateAlbumSidebar.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/content/dependencies/generateAlbumSidebar.js b/src/content/dependencies/generateAlbumSidebar.js index ec1b670f..3dbe3867 100644 --- a/src/content/dependencies/generateAlbumSidebar.js +++ b/src/content/dependencies/generateAlbumSidebar.js @@ -9,6 +9,8 @@ export default { 'generatePageSidebarConjoinedBox', ], + extraDependencies: ['html'], + query(album) { const query = {}; @@ -50,20 +52,33 @@ export default { isAlbumPage: !track, }), - generate(data, relations) { + generate(data, relations, {html}) { + for (const box of [ + ...relations.groupBoxes, + ...relations.seriesBoxes.flat(), + ]) { + box.setSlot('mode', + data.isAlbumPage ? 'album' : 'track'); + } + const groupAndSeriesBoxes = stitchArrays({ groupBox: relations.groupBoxes, seriesBoxes: relations.seriesBoxes, }).map(({groupBox, seriesBoxes}) => - [groupBox, ...seriesBoxes]) + [groupBox].concat( + seriesBoxes.map(seriesBox => [ + html.tag('div', + {class: 'sidebar-box-joiner'}, + {class: 'collapsible'}), + seriesBox, + ]))) .flat(); return relations.sidebar.slots({ boxes: [ data.isAlbumPage && - groupAndSeriesBoxes - .map(box => box.slot('mode', 'album')), + groupAndSeriesBoxes, relations.trackListBox, @@ -72,7 +87,6 @@ export default { attributes: {class: 'conjoined-group-sidebar-box'}, boxes: groupAndSeriesBoxes - .map(box => box.slot('mode', 'track')) .map(box => box.content), /* TODO: Kludge. */ }), ], |