2013-11-15 22:55:32 +00:00
|
|
|
title: $:/core/ui/EditTemplate/fields
|
|
|
|
tags: $:/tags/EditTemplate
|
2013-06-08 16:34:51 +00:00
|
|
|
|
2014-02-16 09:46:43 +00:00
|
|
|
\define lingo-base() $:/language/EditTemplate/
|
2014-08-01 16:03:53 +00:00
|
|
|
\define config-title()
|
|
|
|
$:/config/EditTemplateFields/Visibility/$(currentField)$
|
|
|
|
\end
|
2014-12-04 09:39:14 +00:00
|
|
|
|
2014-08-10 08:13:56 +00:00
|
|
|
\define config-filter()
|
|
|
|
[[hide]] -[title{$(config-title)$}]
|
|
|
|
\end
|
2014-12-04 09:39:14 +00:00
|
|
|
|
2019-10-14 13:31:57 +00:00
|
|
|
\define current-tiddler-new-field-selector()
|
2020-07-31 13:49:09 +00:00
|
|
|
[data-tiddler-title="$(currentTiddlerCSSescaped)$"] .tc-edit-field-add-name-wrapper input
|
2019-10-14 13:31:57 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
\define new-field-actions()
|
|
|
|
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldValueTiddler>get[text]] }}}/>
|
|
|
|
<$action-deletetiddler $tiddler=<<newFieldNameTiddler>>/>
|
|
|
|
<$action-deletetiddler $tiddler=<<newFieldValueTiddler>>/>
|
|
|
|
<$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/>
|
|
|
|
\end
|
|
|
|
|
2018-04-24 21:03:59 +00:00
|
|
|
\define new-field()
|
2019-10-14 13:31:57 +00:00
|
|
|
<$vars name={{{ [<newFieldNameTiddler>get[text]] }}}>
|
2015-04-03 08:06:57 +00:00
|
|
|
<$reveal type="nomatch" text="" default=<<name>>>
|
2019-10-12 13:10:06 +00:00
|
|
|
<$button tooltip=<<lingo Fields/Add/Button/Hint>>>
|
2018-04-24 21:03:59 +00:00
|
|
|
<$action-sendmessage $message="tm-add-field"
|
|
|
|
$name=<<name>>
|
2019-10-14 13:31:57 +00:00
|
|
|
$value={{{ [<newFieldValueTiddler>get[text]] }}}/>
|
|
|
|
<$action-deletetiddler $tiddler=<<newFieldNameTiddler>>/>
|
|
|
|
<$action-deletetiddler $tiddler=<<newFieldValueTiddler>>/>
|
2014-12-04 09:39:14 +00:00
|
|
|
<<lingo Fields/Add/Button>>
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
2015-04-03 08:06:57 +00:00
|
|
|
<$reveal type="match" text="" default=<<name>>>
|
2014-12-04 09:39:14 +00:00
|
|
|
<$button>
|
|
|
|
<<lingo Fields/Add/Button>>
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
2018-04-24 21:03:59 +00:00
|
|
|
</$vars>
|
2015-04-03 08:06:57 +00:00
|
|
|
\end
|
2019-08-02 14:05:30 +00:00
|
|
|
\whitespace trim
|
2015-04-03 08:06:57 +00:00
|
|
|
|
2014-08-28 17:47:21 +00:00
|
|
|
<div class="tc-edit-fields">
|
|
|
|
<table class="tc-edit-fields">
|
2014-04-06 21:49:59 +00:00
|
|
|
<tbody>
|
2019-08-02 14:05:30 +00:00
|
|
|
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">
|
2014-08-10 08:13:56 +00:00
|
|
|
<$list filter=<<config-filter>> variable="temp">
|
2014-08-28 17:47:21 +00:00
|
|
|
<tr class="tc-edit-field">
|
|
|
|
<td class="tc-edit-field-name">
|
2014-04-06 21:49:59 +00:00
|
|
|
<$text text=<<currentField>>/>:</td>
|
2014-08-28 17:47:21 +00:00
|
|
|
<td class="tc-edit-field-value">
|
2020-06-11 10:41:35 +00:00
|
|
|
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/>
|
2014-04-06 21:49:59 +00:00
|
|
|
</td>
|
2014-08-28 17:47:21 +00:00
|
|
|
<td class="tc-edit-field-remove">
|
2014-11-07 21:15:21 +00:00
|
|
|
<$button class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Field/Remove/Hint}} aria-label={{$:/language/EditTemplate/Field/Remove/Caption}}>
|
2014-11-06 18:32:11 +00:00
|
|
|
<$action-deletefield $field=<<currentField>>/>
|
|
|
|
{{$:/core/images/delete-button}}
|
|
|
|
</$button>
|
2014-04-06 21:49:59 +00:00
|
|
|
</td>
|
2013-10-21 22:10:20 +00:00
|
|
|
</tr>
|
2014-08-10 08:13:56 +00:00
|
|
|
</$list>
|
2013-10-21 22:10:20 +00:00
|
|
|
</$list>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2013-06-08 16:34:51 +00:00
|
|
|
</div>
|
|
|
|
|
2014-12-04 09:39:14 +00:00
|
|
|
<$fieldmangler>
|
2014-08-28 17:47:21 +00:00
|
|
|
<div class="tc-edit-field-add">
|
|
|
|
<em class="tc-edit">
|
2020-01-30 15:39:38 +00:00
|
|
|
<<lingo Fields/Add/Prompt>>
|
2014-11-06 18:24:33 +00:00
|
|
|
</em>
|
2020-06-11 11:18:31 +00:00
|
|
|
<div class="tc-edit-field-add-name-wrapper">
|
2020-06-11 10:41:35 +00:00
|
|
|
<$edit-text tiddler=<<newFieldNameTiddler>> tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} focusPopup=<<qualify "$:/state/popup/field-dropdown">> class="tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[fields]then[true]] ~[[false]] }}} cancelPopups="yes"/>
|
2020-06-11 11:18:31 +00:00
|
|
|
|
2019-09-02 17:07:45 +00:00
|
|
|
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>
|
2015-06-29 17:45:41 +00:00
|
|
|
<$reveal state=<<qualify "$:/state/popup/field-dropdown">> type="nomatch" text="" default="">
|
|
|
|
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
2018-11-24 15:53:39 +00:00
|
|
|
<$set name="tv-show-missing-links" value="yes">
|
2019-10-14 13:31:57 +00:00
|
|
|
<$linkcatcher to=<<newFieldNameTiddler>>>
|
2015-06-29 17:45:41 +00:00
|
|
|
<div class="tc-dropdown-item">
|
2015-07-01 14:58:49 +00:00
|
|
|
<<lingo Fields/Add/Dropdown/User>>
|
|
|
|
</div>
|
2019-10-14 13:31:57 +00:00
|
|
|
<$set name="newFieldName" value={{{ [<newFieldNameTiddler>get[text]] }}}>
|
|
|
|
<$list filter="[!is[shadow]!is[system]fields[]search:title<newFieldName>sort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type" variable="currentField">
|
2015-06-29 17:45:41 +00:00
|
|
|
<$link to=<<currentField>>>
|
2019-08-30 09:44:23 +00:00
|
|
|
<$text text=<<currentField>>/>
|
2015-06-29 17:45:41 +00:00
|
|
|
</$link>
|
|
|
|
</$list>
|
2015-07-01 14:58:49 +00:00
|
|
|
<div class="tc-dropdown-item">
|
|
|
|
<<lingo Fields/Add/Dropdown/System>>
|
|
|
|
</div>
|
2019-10-14 13:31:57 +00:00
|
|
|
<$list filter="[fields[]search:title<newFieldName>sort[]] -[!is[shadow]!is[system]fields[]]" variable="currentField">
|
2015-06-29 17:45:41 +00:00
|
|
|
<$link to=<<currentField>>>
|
2019-08-30 09:44:23 +00:00
|
|
|
<$text text=<<currentField>>/>
|
2015-06-29 17:45:41 +00:00
|
|
|
</$link>
|
|
|
|
</$list>
|
2019-10-14 13:31:57 +00:00
|
|
|
</$set>
|
2015-06-29 17:45:41 +00:00
|
|
|
</$linkcatcher>
|
2018-11-24 13:36:48 +00:00
|
|
|
</$set>
|
2015-06-29 17:45:41 +00:00
|
|
|
</div>
|
|
|
|
</$reveal>
|
2020-06-11 11:18:31 +00:00
|
|
|
</div>
|
2014-11-06 18:24:33 +00:00
|
|
|
<span class="tc-edit-field-add-value">
|
2019-10-14 13:31:57 +00:00
|
|
|
<$set name="currentTiddlerCSSescaped" value={{{ [<currentTiddler>escapecss[]] }}}>
|
|
|
|
<$keyboard key="((add-field))" actions=<<new-field-actions>>>
|
2020-06-11 10:41:35 +00:00
|
|
|
<$edit-text tiddler=<<newFieldValueTiddler>> tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor" tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/>
|
2019-10-14 13:31:57 +00:00
|
|
|
</$keyboard>
|
|
|
|
</$set>
|
2019-09-02 17:07:45 +00:00
|
|
|
</span>
|
2014-11-06 18:24:33 +00:00
|
|
|
<span class="tc-edit-field-add-button">
|
2015-04-03 08:06:57 +00:00
|
|
|
<$macrocall $name="new-field"/>
|
2014-04-06 21:49:59 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
2014-12-04 09:39:14 +00:00
|
|
|
</$fieldmangler>
|