1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-17 19:09:55 +00:00

Show backlinks on rename (#3534)

* List backlinks when renaming tiddler

* List references inplace

* TiddlerInfo/References accepting specific tiddler

If `operandTitle` is set, it will show its references instead of current
tiddler's.

It's purpose is to prevent code duplication (the references are listed
when renaming tiddler).

* Don't use variable for References template, use <$tiddler>

Set the `current` to desired title with `<$tiddler>` widget.

* List references in a separate block

* Rename state tiddler

* Use qualified state
This commit is contained in:
Bimba Laszlo 2018-11-15 16:18:38 +01:00 committed by Jeremy Ruston
parent 0ff96f9caf
commit 88664f0286
3 changed files with 20 additions and 3 deletions

View File

@ -22,6 +22,7 @@ Tags/Dropdown/Hint: Show tag list
Title/BadCharacterWarning: Warning: avoid using any of the characters <<bad-chars>> in tiddler titles
Title/Exists/Prompt: Target tiddler already exists
Title/Relink/Prompt: Update ''<$text text=<<fromTitle>>/>'' to ''<$text text=<<toTitle>>/>'' in the //tags// and //list// fields of other tiddlers
Title/References/Prompt: The following manual links to this tiddler will not be automatically updated
Type/Dropdown/Caption: content type list
Type/Dropdown/Hint: Show content type list
Type/Delete/Caption: delete content type

View File

@ -35,10 +35,26 @@ tags: $:/tags/EditTemplate
<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no"> {{$:/language/EditTemplate/Title/Relink/Prompt}}</$checkbox>
<$vars stateTiddler=<<qualify "$:/state/edit/references">> >
<$reveal type="nomatch" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="show" class="tc-btn-invisible tc-tiddlylink">{{$:/core/images/down-arrow}}</$button>
</$reveal>
<$reveal type="match" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="hide" class="tc-btn-invisible tc-tiddlylink">{{$:/core/images/up-arrow}}</$button>
</$reveal>
<<lingo EditTemplate/Title/References/Prompt>>:
<$reveal type="match" state=<<stateTiddler>> text="show">
<$tiddler tiddler=<<fromTitle>> >
<$transclude tiddler="$:/core/ui/TiddlerInfo/References"/>
</$tiddler>
</$reveal>
</$vars>
</$vars>
</$list>
</$reveal>

View File

@ -4,4 +4,4 @@ caption: {{$:/language/TiddlerInfo/References/Caption}}
\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
</$list>
</$list>