1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
TiddlyWiki5/core/ui/ImportListing.tid
saqimtiaz 9605d94b6c
Import rename (#4928)
* Add UI for renaming tiddlers before import in the import listing

* Removed spurious whitespace
2020-10-28 16:03:04 +00:00

87 lines
3.3 KiB
Plaintext

title: $:/core/ui/ImportListing
\define lingo-base() $:/language/Import/
\define messageField()
message-$(payloadTiddler)$
\end
\define selectionField()
selection-$(payloadTiddler)$
\end
\define renameField()
rename-$(payloadTiddler)$
\end
\define newImportTitleTiddler() $:/temp/NewImportTitle-$(payloadTiddler)$
\define previewPopupState()
$(currentTiddler)$!!popup-$(payloadTiddler)$
\end
\define renameFieldState()
$:/state/import-rename-$(payloadTiddler)$
\end
\define select-all-actions()
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
<$action-setfield $field={{{ [<payloadTiddler>addprefix[selection-]] }}} $value={{$:/state/import/select-all}}/>
</$list>
\end
<table class="tc-import-table">
<tbody>
<tr>
<th align="left">
<$checkbox tiddler="$:/state/import/select-all" field="text" checked="checked" unchecked="unchecked" default="checked" actions=<<select-all-actions>>>
<<lingo Listing/Select/Caption>>
</$checkbox>
</th>
<th>
<<lingo Listing/Title/Caption>>
</th>
<th>
<<lingo Listing/Status/Caption>>
</th>
</tr>
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
<tr>
<td>
<$checkbox field=<<selectionField>> checked="checked" unchecked="unchecked" default="checked"/>
</td>
<td>
<$reveal type="nomatch" stateTitle=<<renameFieldState>> text="yes" tag="div">
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="yes">
{{$:/core/images/right-arrow}}<span class="tc-small-gap-left"><$text text={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}}/></span>
</$button>
<$button class="tc-btn-invisible" setTitle=<<renameFieldState>> setTo="yes" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}}</$button>
</$reveal>
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
{{$:/core/images/down-arrow}}<span class="tc-small-gap-left"><$text text=<<payloadTiddler>>/></span>
</$button>
</$reveal>
</$reveal>
<$reveal type="match" stateTitle=<<renameFieldState>> text="yes" tag="div">
<$edit-text tiddler=<<newImportTitleTiddler>> default=<<payloadTiddler>> tag="input" class="tc-import-rename"/><$button class="tc-btn-invisible" setTitle=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>&nbsp;<$button class="tc-btn-invisible" setTitle=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>
</$reveal>
</td>
<td>
<$view field=<<messageField>>/>
</td>
</tr>
<tr>
<td colspan="3">
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
<$transclude tiddler={{$:/state/importpreviewtype}}/>
</$list>
</$reveal>
</td>
</tr>
</$list>
</tbody>
</table>