« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateArtTagGalleryPage.js59
-rw-r--r--src/content/dependencies/generateArtTagGalleryPageFeaturedLine.js12
-rw-r--r--src/content/dependencies/generateArtTagGalleryPageShowingLine.js8
-rw-r--r--src/static/js/client/art-tag-gallery-filter.js4
-rw-r--r--src/strings-default.yaml13
-rw-r--r--src/urls-default.yaml2
6 files changed, 53 insertions, 45 deletions
diff --git a/src/content/dependencies/generateArtTagGalleryPage.js b/src/content/dependencies/generateArtTagGalleryPage.js
index 3e036b08..646975ef 100644
--- a/src/content/dependencies/generateArtTagGalleryPage.js
+++ b/src/content/dependencies/generateArtTagGalleryPage.js
@@ -130,34 +130,52 @@ export default {
             extraReadingLinks: relations.extraReadingLinks ?? null,
           }),
 
-          data.numArtworksTotal === 0 &&
-            html.tag('p', {class: 'quick-info'},
+          html.tag('p', {class: 'quick-info'}, [
+            data.numArtworksTotal === 0 &&
               language.encapsulate(pageCapsule, 'featuredLine.notFeatured', capsule => [
                 language.$(capsule),
                 html.tag('br'),
                 language.$(capsule, 'callToAction'),
-              ])),
+              ]),
 
-          data.numArtworksTotal >= 1 &&
-            relations.featuredLine.clone()
-              .slots({
-                showing: 'all',
+            data.numArtworksTotal >= 1 &&
+              relations.featuredLine.clone().slots({
+                string:
+                  (data.hasMixedDirectIndirect
+                    ? 'altogether'
+                    : 'simple'),
+
+                filter: 'all',
                 count: data.numArtworksTotal,
               }),
 
-          data.hasMixedDirectIndirect && [
-            relations.featuredLine.clone()
-              .slots({
-                showing: 'direct',
+            data.hasMixedDirectIndirect && [
+              relations.featuredLine.clone().slots({
+                string: 'direct',
+                filter: 'direct',
                 count: data.numArtworksDirectly,
               }),
 
-            relations.featuredLine.clone()
-              .slots({
-                showing: 'indirect',
+              relations.featuredLine.clone().slots({
+                string: 'indirect',
+                filter: 'indirect',
                 count: data.numArtworksIndirectly,
               }),
-          ],
+            ],
+
+            data.hasMixedDirectIndirect && [
+              html.tag('br'),
+
+              relations.showingLine.clone()
+                .slot('filter', 'all'),
+
+              relations.showingLine.clone()
+                .slot('filter', 'direct'),
+
+              relations.showingLine.clone()
+                .slot('filter', 'indirect'),
+            ],
+          ]),
 
           relations.ancestorLinks &&
             html.tag('p', {id: 'descends-from-line'},
@@ -173,17 +191,6 @@ export default {
                 tags: language.formatUnitList(relations.descendantLinks),
               })),
 
-          data.hasMixedDirectIndirect && [
-            relations.showingLine.clone()
-              .slot('showing', 'all'),
-
-            relations.showingLine.clone()
-              .slot('showing', 'direct'),
-
-            relations.showingLine.clone()
-              .slot('showing', 'indirect'),
-          ],
-
           relations.coverGrid
             .slots({
               links: relations.links,
diff --git a/src/content/dependencies/generateArtTagGalleryPageFeaturedLine.js b/src/content/dependencies/generateArtTagGalleryPageFeaturedLine.js
index 8593cc21..8a6d13c6 100644
--- a/src/content/dependencies/generateArtTagGalleryPageFeaturedLine.js
+++ b/src/content/dependencies/generateArtTagGalleryPageFeaturedLine.js
@@ -1,18 +1,16 @@
 export default {
   slots: {
-    showing: {
-      validate: v => v.is('all', 'direct', 'indirect'),
-    },
-
+    string: {validate: v => v.is('simple', 'altogether', 'direct', 'indirect')},
+    filter: {validate: v => v.is('all', 'direct', 'indirect')},
     count: {type: 'number'},
   },
 
   generate: (slots, {html, language}) =>
     language.encapsulate('artTagGalleryPage', pageCapsule =>
-      html.tag('p', {class: 'quick-info'},
-        {id: `featured-${slots.showing}-line`},
+      html.tag('span',
+        {id: `featured-${slots.filter}-line`},
 
-        language.$(pageCapsule, 'featuredLine', slots.showing, {
+        language.$(pageCapsule, 'featuredLine', slots.string, {
           coverArts:
             language.countArtworks(slots.count, {
               unit: true,
diff --git a/src/content/dependencies/generateArtTagGalleryPageShowingLine.js b/src/content/dependencies/generateArtTagGalleryPageShowingLine.js
index 2a34ae57..18734ab8 100644
--- a/src/content/dependencies/generateArtTagGalleryPageShowingLine.js
+++ b/src/content/dependencies/generateArtTagGalleryPageShowingLine.js
@@ -1,6 +1,6 @@
 export default {
   slots: {
-    showing: {
+    filter: {
       validate: v => v.is('all', 'direct', 'indirect'),
     },
 
@@ -9,12 +9,12 @@ export default {
 
   generate: (slots, {html, language}) =>
     language.encapsulate('artTagGalleryPage', pageCapsule =>
-      html.tag('p', {class: 'quick-info'},
-        {id: `showing-${slots.showing}-line`},
+      html.tag('span',
+        {id: `showing-${slots.filter}-line`},
 
         language.$(pageCapsule, 'showingLine', {
           showing:
             html.tag('a', {href: '#'},
-              language.$(pageCapsule, 'showingLine', slots.showing)),
+              language.$(pageCapsule, 'showingLine', slots.filter)),
         }))),
 };
diff --git a/src/static/js/client/art-tag-gallery-filter.js b/src/static/js/client/art-tag-gallery-filter.js
index f74f640e..b7fff70d 100644
--- a/src/static/js/client/art-tag-gallery-filter.js
+++ b/src/static/js/client/art-tag-gallery-filter.js
@@ -140,8 +140,8 @@ export function addPageListeners() {
       currentFeaturedLine.style.display = 'none';
       currentShowingLine.style.display = 'none';
 
-      nextFeaturedLine.style.display = 'block';
-      nextShowingLine.style.display = 'block';
+      nextFeaturedLine.style.display = 'inline';
+      nextShowingLine.style.display = 'inline';
 
       filterArtTagGallery(nextShowing);
     });
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 24b8a5c1..47123c52 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -1609,9 +1609,12 @@ artTagGalleryPage:
   descendants: "Down: {TAGS}."
 
   featuredLine:
-    all: >-
+    simple: >-
       Featured in {COVER_ARTS}.
 
+    altogether: >-
+      Altogether, featured in {COVER_ARTS}.
+
     direct: >-
       Featured directly in {COVER_ARTS}.
 
@@ -1626,16 +1629,16 @@ artTagGalleryPage:
         Maybe your track will be the first!
 
   showingLine:
-    _: "({SHOWING})"
+    _: "Showing: {SHOWING}."
 
     all: >-
-      Showing all artworks.
+      all artworks featuring this tag
 
     indirect: >-
-      Showing artworks where this tag is only featured indirectly.
+      artworks indirectly featuring this tag
 
     direct: >-
-      Showing artworks where this tag is featured directly.
+      artworks directly featuring this tag
 
 #
 # commentaryIndex:
diff --git a/src/urls-default.yaml b/src/urls-default.yaml
index 6a31db69..40ebf096 100644
--- a/src/urls-default.yaml
+++ b/src/urls-default.yaml
@@ -11,7 +11,7 @@ yamlAliases:
   # part of a build. This is so that multiple builds of a wiki can coexist
   # served from the same server / file system root: older builds' HTML files
   # refer to earlier values of STATIC_VERSION, avoiding name collisions.
-  - &staticVersion 5p5
+  - &staticVersion 5p6
 
 data:
   prefix: 'data/'