« get me outta code hell

content: listAll{Additional,SheetMusic,MidiProject}Files - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/listing-spec.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-09 09:42:15 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-09 09:43:09 -0300
commitc4b40f4b7fa7ef5439845538af22cc9076e4cb9c (patch)
treef6532309e7ae7fd7455cdfa90dd67c62b8959634 /src/listing-spec.js
parent725482638dcc96632c3a9cf2b885f4128c50a1c1 (diff)
content: listAll{Additional,SheetMusic,MidiProject}Files
Diffstat (limited to 'src/listing-spec.js')
-rw-r--r--src/listing-spec.js72
1 files changed, 7 insertions, 65 deletions
diff --git a/src/listing-spec.js b/src/listing-spec.js
index 8250317..e19b90e 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',