« get me outta code hell

content: group info + gallery pages - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateGroupSidebar.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-22 16:37:36 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-22 16:37:36 -0300
commit53395fa815cdf6f912e78f80bef8908005186270 (patch)
tree47a5a37c0505e8c10ffba949f5d1a34e44524598 /src/content/dependencies/generateGroupSidebar.js
parenta5e6bb93032ee32f2fa19689455e6cb8dd9f3da9 (diff)
content: group info + gallery pages
These are good to go! Only thing missing is carousels on gallery pages.
Diffstat (limited to 'src/content/dependencies/generateGroupSidebar.js')
-rw-r--r--src/content/dependencies/generateGroupSidebar.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/content/dependencies/generateGroupSidebar.js b/src/content/dependencies/generateGroupSidebar.js
new file mode 100644
index 0000000..6baf37f
--- /dev/null
+++ b/src/content/dependencies/generateGroupSidebar.js
@@ -0,0 +1,35 @@
+export default {
+  contentDependencies: ['generateGroupSidebarCategoryDetails'],
+  extraDependencies: ['html', 'language', 'wikiData'],
+
+  sprawl({groupCategoryData}) {
+    return {groupCategoryData};
+  },
+
+  relations(relation, sprawl, group) {
+    return {
+      categoryDetails:
+        sprawl.groupCategoryData.map(category =>
+          relation('generateGroupSidebarCategoryDetails', category, group)),
+    };
+  },
+
+  slots: {
+    currentExtra: {
+      validate: v => v.is('gallery'),
+    },
+  },
+
+  generate(relations, slots, {html, language}) {
+    return {
+      leftSidebarContent: [
+        html.tag('h1',
+          language.$('groupSidebar.title')),
+
+        relations.categoryDetails
+          .map(details =>
+            details.slot('currentExtra', slots.currentExtra)),
+      ],
+    };
+  },
+};