« get me outta code hell

content: generateArtTagGalleryPage: stub message for yet unfeatured - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-06 01:30:09 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-02-25 20:03:26 -0400
commit9dad55f40a8465fe9732f6d00b2d1fe8aff61bd5 (patch)
tree80d6a640cea4eb9ff5de8c2880ceb00db29de748
parent6ff9a13abcf19ffb685c31f8bdf85b431912e6bf (diff)
content: generateArtTagGalleryPage: stub message for yet unfeatured
-rw-r--r--src/content/dependencies/generateArtTagGalleryPage.js17
-rw-r--r--src/strings-default.yaml8
2 files changed, 18 insertions, 7 deletions
diff --git a/src/content/dependencies/generateArtTagGalleryPage.js b/src/content/dependencies/generateArtTagGalleryPage.js
index a0b3a0e5..a67e40e6 100644
--- a/src/content/dependencies/generateArtTagGalleryPage.js
+++ b/src/content/dependencies/generateArtTagGalleryPage.js
@@ -126,11 +126,18 @@ export default {
           relations.quickDescription,
 
           html.tag('p', {class: 'quick-info'},
-            language.$(pageCapsule, 'infoLine', {
-              coverArts: language.countArtworks(data.numArtworks, {
-                unit: true,
-              }),
-            })),
+            language.encapsulate(pageCapsule, 'infoLine', capsule =>
+              (data.numArtworks === 0
+                ? language.encapsulate(capsule, 'notFeatured', capsule => [
+                    language.$(capsule),
+                    html.tag('br'),
+                    language.$(capsule, 'callToAction'),
+                  ])
+                : language.$(capsule, {
+                    coverArts: language.countArtworks(data.numArtworks, {
+                      unit: true,
+                    }),
+                  })))),
 
           relations.ancestorLinks &&
             html.tag('p', {class: 'quick-info'},
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index a552febd..5834facd 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -1336,8 +1336,12 @@ artTagInfoPage:
 artTagGalleryPage:
   title: "{TAG}"
 
-  infoLine: >-
-    Appears in {COVER_ARTS}.
+  infoLine:
+    _: "Featured in {COVER_ARTS}."
+
+    notFeatured:
+      _: "This tag hasn't been featured in any artworks yet."
+      callToAction: "Maybe your track will be the first!"
 
   descendsFrom: "Descends from {TAGS}."
   descendants: "Direct descendants: {TAGS}."