1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 20:09:57 +00:00

Feat: allow tags have its ViewTemplate tag and cascade (#8462)

* feat: allow tags have its ViewTemplate tag and cascade

* feat: quick addition of subtitle cascade

* docs: tag subtitle cascade control panel

* Update ControlPanel.multids
This commit is contained in:
lin onetwo 2024-08-02 01:01:22 +08:00 committed by GitHub
parent 5c43512a56
commit 57d3e8e765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 54 additions and 11 deletions

View File

@ -235,3 +235,7 @@ ViewTemplateBody/Caption: View Template Body
ViewTemplateBody/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the body of a tiddler. ViewTemplateBody/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the body of a tiddler.
ViewTemplateTitle/Caption: View Template Title ViewTemplateTitle/Caption: View Template Title
ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler. ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler.
ViewTemplateSubtitle/Caption: View Template Subtitle
ViewTemplateSubtitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the subtitle of a tiddler.
ViewTemplateTags/Caption: View Template Tags
ViewTemplateTags/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the tags area of a tiddler.

View File

@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/ViewTemplateSubtitle
tags: $:/tags/ControlPanel/Cascades
caption: {{$:/language/ControlPanel/ViewTemplateSubtitle/Caption}}
\define lingo-base() $:/language/ControlPanel/ViewTemplateSubtitle/
<<lingo Hint>>
{{$:/tags/ViewTemplateSubtitleFilter||$:/snippets/ListTaggedCascade}}

View File

@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/ViewTemplateTags
tags: $:/tags/ControlPanel/Cascades
caption: {{$:/language/ControlPanel/ViewTemplateTags/Caption}}
\define lingo-base() $:/language/ControlPanel/ViewTemplateTags/
<<lingo Hint>>
{{$:/tags/ViewTemplateTagsFilter||$:/snippets/ListTaggedCascade}}

View File

@ -2,10 +2,4 @@ title: $:/core/ui/ViewTemplate/subtitle
tags: $:/tags/ViewTemplate tags: $:/tags/ViewTemplate
\whitespace trim \whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes"> <$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateSubtitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/subtitle/default]] }}} />
<div class="tc-subtitle">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler">
<$transclude tiddler=<<subtitleTiddler>> mode="inline"/><$list-join>&nbsp;</$list-join>
</$list>
</div>
</$reveal>

View File

@ -0,0 +1,10 @@
title: $:/core/ui/ViewTemplate/subtitle/default
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler">
<$transclude tiddler=<<subtitleTiddler>> mode="inline"/><$list-join>&nbsp;</$list-join>
</$list>
</div>
</$reveal>

View File

@ -2,6 +2,4 @@ title: $:/core/ui/ViewTemplate/tags
tags: $:/tags/ViewTemplate tags: $:/tags/ViewTemplate
\whitespace trim \whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes"> <$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTagsFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/tags/default]] }}} />
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
</$reveal>

View File

@ -0,0 +1,11 @@
title: $:/core/ui/ViewTemplate/tags/default
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper">
<$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Tags]!has[draft.of]]">
<$transclude mode="inline"/>
</$list>
</div>
</$reveal>

View File

@ -236,3 +236,7 @@ ViewTemplateBody/Caption: 查看模板主体
ViewTemplateBody/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的主体。 ViewTemplateBody/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的主体。
ViewTemplateTitle/Caption: 查看模板标题 ViewTemplateTitle/Caption: 查看模板标题
ViewTemplateTitle/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的标题。 ViewTemplateTitle/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的标题。
ViewTemplateSubtitle/Caption: 查看模板副标题
ViewTemplateSubtitle/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的副标题。
ViewTemplateTags/Caption: 查看模板标签区
ViewTemplateTags/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的标签区域。

View File

@ -236,3 +236,7 @@ ViewTemplateBody/Caption: 檢視範本主體
ViewTemplateBody/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的主體。 ViewTemplateBody/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的主體。
ViewTemplateTitle/Caption: 檢視範本標題 ViewTemplateTitle/Caption: 檢視範本標題
ViewTemplateTitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標題。 ViewTemplateTitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標題。
ViewTemplateSubtitle/Caption: 檢視範本副標題
ViewTemplateSubtitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的副標題。
ViewTemplateTags/Caption: 檢視範本標籤
ViewTemplateTags/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標籤。