« get me outta code hell

content, css: float commentary entry dates to right - 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>2024-06-01 17:52:16 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-01 17:52:16 -0300
commit3b93ba56b410644ac6c6663041c3af7b085bdbe7 (patch)
treea79b96d17db2251616f4fcf10222387f9b78128e
parentb87af8d74eccacb01ff022d33cbbdc5867dc11cd (diff)
content, css: float commentary entry dates to right
-rw-r--r--src/content/dependencies/generateCommentaryEntry.js20
-rw-r--r--src/static/css/site.css4
-rw-r--r--src/strings-default.yaml7
3 files changed, 21 insertions, 10 deletions
diff --git a/src/content/dependencies/generateCommentaryEntry.js b/src/content/dependencies/generateCommentaryEntry.js
index 522a0284..7994040d 100644
--- a/src/content/dependencies/generateCommentaryEntry.js
+++ b/src/content/dependencies/generateCommentaryEntry.js
@@ -61,19 +61,14 @@ export default {
         relations.annotationContent.slot('mode', 'inline');
     }
 
-    if (data.date) {
-      accentParts.push('withDate');
-      accentOptions.date =
-        language.formatDate(data.date);
-    }
-
     const accent =
       (accentParts.length > 1
         ? html.tag('span', {class: 'commentary-entry-accent'},
             language.$(...accentParts, accentOptions))
         : null);
 
-    const titleParts = ['misc.artistCommentary.entry.title'];
+    const titlePrefix = 'misc.artistCommentary.entry.title';
+    const titleParts = [titlePrefix];
     const titleOptions = {artists: artistsSpan};
 
     if (accent) {
@@ -88,7 +83,16 @@ export default {
     return html.tags([
       html.tag('p', {class: 'commentary-entry-heading'},
         style,
-        language.$(...titleParts, titleOptions)),
+        [
+          data.date &&
+            html.tag('time',
+              language.$(titlePrefix, 'date', {
+                date:
+                  language.formatDate(data.date),
+              })),
+
+          language.$(...titleParts, titleOptions)
+        ]),
 
       html.tag('blockquote', {class: 'commentary-entry-body'},
         style,
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 87f191a6..dc09f2e8 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -1108,6 +1108,10 @@ ul.image-details li {
   font-style: oblique;
 }
 
+.commentary-entry-heading time {
+  float: right;
+}
+
 .commentary-art {
   float: right;
   width: 30%;
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 3ed73b2b..ec09ad70 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -430,12 +430,15 @@ misc:
     entry:
       title:
         _: "{ARTISTS}:"
+
         noArtists: "Unknown artist"
+
         withAccent: "{ARTISTS}: {ACCENT}"
+
         accent:
           withAnnotation: "({ANNOTATION})"
-          withDate: ({DATE})"
-          withAnnotation.withDate: "({ANNOTATION}, {DATE})"
+
+        date: "{DATE}"
 
       seeOriginalRelease: "See {ORIGINAL}!"