From f1dcfd613ad7e868a320e3a69c1e39796c1494d4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Apr 2025 17:20:06 -0300 Subject: content, css: wrap sidebar track section range together --- .../generateAlbumSidebarTrackSection.js | 27 +++++++++++++--------- src/static/css/site.css | 9 ++++++++ src/strings-default.yaml | 4 +++- 3 files changed, 28 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/generateAlbumSidebarTrackSection.js b/src/content/dependencies/generateAlbumSidebarTrackSection.js index 5affb079..dae5fa03 100644 --- a/src/content/dependencies/generateAlbumSidebarTrackSection.js +++ b/src/content/dependencies/generateAlbumSidebarTrackSection.js @@ -140,17 +140,22 @@ export default { colorStyle, html.tag('span', - language.encapsulate(capsule, 'group', workingCapsule => { - const workingOptions = {group: sectionName}; - - if (data.hasTrackNumbers) { - workingCapsule += '.withRange'; - workingOptions.range = - `${data.firstTrackNumber}–${data.lastTrackNumber}`; - } - - return language.$(workingCapsule, workingOptions); - }))), + language.encapsulate(capsule, 'group', groupCapsule => + language.encapsulate(groupCapsule, workingCapsule => { + const workingOptions = {group: sectionName}; + + if (data.hasTrackNumbers) { + workingCapsule += '.withRange'; + workingOptions.rangePart = + html.tag('span', {class: 'track-section-range'}, + language.$(groupCapsule, 'withRange.rangePart', { + range: + `${data.firstTrackNumber}–${data.lastTrackNumber}`, + })); + } + + return language.$(workingCapsule, workingOptions); + })))), (data.hasTrackNumbers ? html.tag('ol', diff --git a/src/static/css/site.css b/src/static/css/site.css index 49e3fce4..623f129c 100644 --- a/src/static/css/site.css +++ b/src/static/css/site.css @@ -583,6 +583,15 @@ summary.underline-white > span:hover a:not(:hover) { border-bottom-left-radius: 0; } +.track-list-sidebar-box summary { + padding-left: 20px !important; + text-indent: -15px !important; +} + +.track-list-sidebar-box .track-section-range { + white-space: nowrap; +} + .wiki-search-sidebar-box { padding: 1px 0 0 0; diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 259e01bb..ec028f69 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -972,7 +972,9 @@ albumSidebar: group: _: "{GROUP}" - withRange: "{GROUP} ({RANGE})" + + withRange: "{GROUP} {RANGE_PART}" + withRange.rangePart: "({RANGE})" # groupBox: # This is the box for groups. Apart from the next and previous -- cgit 1.3.0-6-gf8a5