« get me outta code hell

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:
Diffstat (limited to 'src/listing-spec.js')
-rw-r--r--src/listing-spec.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/listing-spec.js b/src/listing-spec.js
index ef51fe90..29b7645c 100644
--- a/src/listing-spec.js
+++ b/src/listing-spec.js
@@ -826,6 +826,74 @@ const listingSpec = [
   },
 
   {
+    directory: 'tracks/with-sheet-music-files',
+    stringsKey: 'listTracks.withSheetMusicFiles',
+
+    data: ({wikiData: {albumData}}) =>
+      albumData
+        .map(album => ({
+          album,
+          tracks: album.tracks.filter(t => !empty(t.sheetMusicFiles)),
+        }))
+        .filter(({tracks}) => !empty(tracks)),
+
+    html: (data, {html, language, link}) =>
+      html.tag('dl',
+        data.flatMap(({album, tracks}) => [
+          html.tag('dt',
+            {class: 'content-heading'},
+            language.$('listingPage.listTracks.withSheetMusicFiles.album', {
+              album: link.album(album),
+              date: language.formatDate(album.date),
+            })),
+
+          html.tag('dd',
+            html.tag('ul',
+              tracks.map(track =>
+                html.tag('li',
+                  language.$('listingPage.listTracks.withSheetMusicFiles.track', {
+                    track: link.track(track, {
+                      hash: 'sheet-music-files',
+                    }),
+                  }))))),
+        ])),
+  },
+
+  {
+    directory: 'tracks/with-midi-project-files',
+    stringsKey: 'listTracks.withMidiProjectFiles',
+
+    data: ({wikiData: {albumData}}) =>
+      albumData
+        .map(album => ({
+          album,
+          tracks: album.tracks.filter(t => !empty(t.midiProjectFiles)),
+        }))
+        .filter(({tracks}) => !empty(tracks)),
+
+    html: (data, {html, language, link}) =>
+      html.tag('dl',
+        data.flatMap(({album, tracks}) => [
+          html.tag('dt',
+            {class: 'content-heading'},
+            language.$('listingPage.listTracks.withMidiProjectFiles.album', {
+              album: link.album(album),
+              date: language.formatDate(album.date),
+            })),
+
+          html.tag('dd',
+            html.tag('ul',
+              tracks.map(track =>
+                html.tag('li',
+                  language.$('listingPage.listTracks.withMidiProjectFiles.track', {
+                    track: link.track(track, {
+                      hash: 'midi-project-files',
+                    }),
+                  }))))),
+        ])),
+  },
+
+  {
     directory: 'tags/by-name',
     stringsKey: 'listTags.byName',