« get me outta code hell

content: gAIPFlashesChunkedList: general refactor a la tracks - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-31 23:21:56 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:53 -0300
commit42a06333e4ebf98f22cbb7a856ff4517ee47fcb1 (patch)
tree0ab767330b2acf1a7ff0a0e6cadd2a8339bfca22 /src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js
parent82c2cabd5f27bbb1989e7bd6af210f62b37b18c5 (diff)
content: gAIPFlashesChunkedList: general refactor a la tracks
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js b/src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js
new file mode 100644
index 00000000..e4908bf9
--- /dev/null
+++ b/src/content/dependencies/generateArtistInfoPageFlashesChunkItem.js
@@ -0,0 +1,34 @@
+export default {
+  contentDependencies: ['generateArtistInfoPageChunkItem', 'linkFlash'],
+
+  extraDependencies: ['language'],
+
+  relations: (relation, contrib) => ({
+    // Flashes and games can list multiple contributors as collaborative
+    // credits, but we don't display these on the artist page, since they
+    // usually involve many artists crediting a larger team where collaboration
+    // isn't as relevant (without more particular details that aren't tracked
+    // on the wiki).
+
+    template:
+      relation('generateArtistInfoPageChunkItem'),
+
+    flashLink:
+      relation('linkFlash', contrib.thing),
+  }),
+
+  data: (contrib) => ({
+    annotation:
+      contrib.annotation,
+  }),
+
+  generate: (data, relations, {language}) =>
+    relations.template.slots({
+      annotation: data.annotation,
+
+      content:
+        language.$('artistPage.creditList.entry.flash', {
+          flash: relations.flashLink,
+        }),
+    }),
+};