From f4f1ae6b9bc2391a769172e23749e5b79661bb3d Mon Sep 17 00:00:00 2001
From: Mario Pietsch
Date: Thu, 3 Oct 2024 13:34:39 +0200
Subject: [PATCH] Fix alignment in tiddler subtitle (#8659)
---
core/ui/ViewTemplate/subtitle/default.tid | 2 +-
core/ui/ViewTemplate/subtitle/modifier.tid | 2 +-
.../tiddler-subtitle/subtitle-modified.tid | 23 ++++++++++++++++++
.../subtitle-modifier-modified.tid | 24 +++++++++++++++++++
4 files changed, 49 insertions(+), 2 deletions(-)
create mode 100644 editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modified.tid
create mode 100644 editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modifier-modified.tid
diff --git a/core/ui/ViewTemplate/subtitle/default.tid b/core/ui/ViewTemplate/subtitle/default.tid
index 99042c95e..5c55712fa 100644
--- a/core/ui/ViewTemplate/subtitle/default.tid
+++ b/core/ui/ViewTemplate/subtitle/default.tid
@@ -4,7 +4,7 @@ title: $:/core/ui/ViewTemplate/subtitle/default
<$reveal type="nomatch" stateTitle=<> text="hide" tag="div" retain="yes" animate="yes">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler">
-<$transclude tiddler=<> mode="inline"/><$list-join> $list-join>
+<$transclude tiddler=<> mode="inline"/>
$list>
$reveal>
diff --git a/core/ui/ViewTemplate/subtitle/modifier.tid b/core/ui/ViewTemplate/subtitle/modifier.tid
index 8437ada9b..e4062380d 100644
--- a/core/ui/ViewTemplate/subtitle/modifier.tid
+++ b/core/ui/ViewTemplate/subtitle/modifier.tid
@@ -1,4 +1,4 @@
title: $:/core/ui/ViewTemplate/subtitle/modifier
tags: $:/tags/ViewTemplate/Subtitle
-<$link to={{!!modifier}}/>
\ No newline at end of file
+<%if [{!!modifier}!is[blank]] %><$link to={{!!modifier}}/><%endif%>
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modified.tid b/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modified.tid
new file mode 100644
index 000000000..0191aaccf
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modified.tid
@@ -0,0 +1,23 @@
+title: Subtitle/modified
+description: Tiddler ViewTemplate Subtitle modified only
+type: text/vnd.tiddlywiki-multiple
+import: [all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]] $:/core/ui/ViewTemplate/subtitle/default
+tags: $:/tags/wiki-test-spec
+
+title: $:/language/Tiddler/DateFormat
+
+[UTC]DDth MMM YYYY at hh12:0mmam
++
+title: Output
+
+\whitespace trim
+{{test||$:/core/ui/ViewTemplate/subtitle/default}}
++
+title: test
+modified: 20241003111606000
+
+text
++
+title: ExpectedResult
+
+3rd October 2024 at 11:16am
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modifier-modified.tid b/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modifier-modified.tid
new file mode 100644
index 000000000..c060faeae
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/tiddler-subtitle/subtitle-modifier-modified.tid
@@ -0,0 +1,24 @@
+title: Subtitle/modifier-modified
+description: Tiddler ViewTemplate Subtitle. Show modifier and modified in UTC format
+type: text/vnd.tiddlywiki-multiple
+import: [all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]] $:/core/ui/ViewTemplate/subtitle/default
+tags: $:/tags/wiki-test-spec
+
+title: $:/language/Tiddler/DateFormat
+
+[UTC]DDth MMM YYYY at hh12:0mmam
++
+title: Output
+
+\whitespace trim
+{{test||$:/core/ui/ViewTemplate/subtitle/default}}
++
+title: test
+modifier: test-user
+modified: 20241003111606000
+
+text
++
+title: ExpectedResult
+
+
\ No newline at end of file