diff options
Diffstat (limited to 'src/listing-spec.js')
-rw-r--r-- | src/listing-spec.js | 72 |
1 files changed, 7 insertions, 65 deletions
diff --git a/src/listing-spec.js b/src/listing-spec.js index 82503174..e19b90e8 100644 --- a/src/listing-spec.js +++ b/src/listing-spec.js @@ -212,71 +212,7 @@ listingSpec.push({ featureFlag: 'enableArtTagUI', }); -/* -function listAdditionalFilesInProperty(property, { - directory, - stringsKey, - seeAlso, -}) { - return { - directory, - stringsKey, - seeAlso, - groupUnderOther: true, - - data: ({wikiData: {albumData}}) => - albumData - .map(album => ({ - album, - tracks: album.tracks.filter(t => !empty(t[property])), - })) - .filter(({tracks}) => !empty(tracks)), - - html: (data, { - html, - language, - link, - }) => - data.flatMap(({album, tracks}) => [ - html.tag('h3', {class: 'content-heading'}, - link.album(album)), - - html.tag('dl', tracks.flatMap(track => [ - // No hash here since the full list of additional files is already visible - // below. The track link serves more as a way to quickly recall the track or - // to access listen links, all of which is positioned at the top of the page. - html.tag('dt', link.track(track)), - html.tag('dd', - // This page doesn't really look better with color-coded file links. - // Track links are still colored. - html.tag('ul', track[property].map(({title, files}) => - html.tag('li', - {class: [files.length > 1 && 'has-details']}, - (files.length === 1 - ? link.albumAdditionalFile( - {album, file: files[0]}, - { - text: language.$(`listingPage.${stringsKey}.file`, {title}), - }) - : html.tag('details', [ - html.tag('summary', - html.tag('span', - language.$(`listingPage.${stringsKey}.file.withMultipleFiles`, { - title: html.tag('span', {class: 'group-name'}, title), - files: language.countAdditionalFiles(files.length, {unit: true}), - }))), - html.tag('ul', files.map(file => - html.tag('li', - link.albumAdditionalFile({album, file})))), - ])))))), - ])), - ]), - }; -} -*/ - listingSpec.push({ - /* listAdditionalFilesInProperty('sheetMusicFiles') */ directory: 'all-sheet-music-files', stringsKey: 'other.allSheetMusic', contentFunction: 'listAllSheetMusicFiles', @@ -285,7 +221,6 @@ listingSpec.push({ }); listingSpec.push({ - /* listAdditionalFilesInProperty('midiProjectFiles') */ directory: 'all-midi-project-files', stringsKey: 'other.allMidiProjectFiles', contentFunction: 'listAllMidiProjectFiles', @@ -294,6 +229,13 @@ listingSpec.push({ }); listingSpec.push({ + directory: 'all-additional-files', + stringsKey: 'other.allAdditionalFiles', + contentFunction: 'listAllAdditionalFiles', + groupUnderOther: true, +}); + +listingSpec.push({ directory: 'random', stringsKey: 'other.randomPages', contentFunction: 'listRandomPageLinks', |