« get me outta code hell

content, css: generateAdditionalFilesListChunk: description in li - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-04 11:46:21 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-04 11:46:21 -0300
commit48a57e64e705624a219b140fb88fcf295329deb5 (patch)
treebc4dac3ac2a9f0def1943bed106913eebeada1bb /src
parent8d655f592df09a15537fd2275cd9c51b5af78d01 (diff)
content, css: generateAdditionalFilesListChunk: description in li
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAdditionalFilesListChunk.js35
-rw-r--r--src/static/site6.css10
-rw-r--r--src/strings-default.yaml2
3 files changed, 28 insertions, 19 deletions
diff --git a/src/content/dependencies/generateAdditionalFilesListChunk.js b/src/content/dependencies/generateAdditionalFilesListChunk.js
index d0a603a8..5804115a 100644
--- a/src/content/dependencies/generateAdditionalFilesListChunk.js
+++ b/src/content/dependencies/generateAdditionalFilesListChunk.js
@@ -18,29 +18,28 @@ export default {
   },
 
   generate(slots, {html, language}) {
-    const titleParts = ['releaseInfo.additionalFiles.entry'];
-    const titleOptions = {
-      title:
-        html.tag('span', {class: 'group-name'},
-          slots.title),
-    };
-
-    if (!html.isBlank(slots.description)) {
-      titleParts.push('withDescription');
-      titleOptions.description = slots.description;
-    }
-
     const summary =
       html.tag('summary',
         html.tag('span',
-          language.$(...titleParts, titleOptions)));
+          language.$('releaseInfo.additionalFiles.entry', {
+            title:
+              html.tag('span', {class: 'group-name'},
+                slots.title),
+          })));
+
+    const description =
+      html.tag('li', {class: 'entry-description'},
+        {[html.onlyIfContent]: true},
+        slots.description);
+
+    const items =
+      (html.isBlank(slots.items)
+        ? html.tag('li',
+            language.$('releaseInfo.additionalFiles.entry.noFilesAvailable'))
+        : slots.items);
 
     const content =
-      html.tag('ul',
-        (html.isBlank(slots.items)
-          ? html.tag('li',
-              language.$('releaseInfo.additionalFiles.entry.noFilesAvailable'))
-          : slots.items));
+      html.tag('ul', [description, items]);
 
     const details =
       html.tag('details',
diff --git a/src/static/site6.css b/src/static/site6.css
index ed2bb987..c1c4b9d5 100644
--- a/src/static/site6.css
+++ b/src/static/site6.css
@@ -1095,6 +1095,16 @@ li > ul {
   margin-bottom: 10px;
 }
 
+.additional-files-list .entry-description {
+  list-style-type: none;
+  max-width: 540px;
+
+  /* This should be margin-bottom, but cascading rules
+   * cause some awkwardness - `#content li` takes precedence.
+   */
+  padding-bottom: 3px;
+}
+
 .group-contributions-table {
   display: inline-block;
 }
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 004f867e..4d31f3bc 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -325,7 +325,7 @@ releaseInfo:
 
     entry:
       _: "{TITLE}"
-      withDescription: "{TITLE}: {DESCRIPTION}"
+
       noFilesAvailable: >-
         There are no files available or listed for this entry.