1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-30 20:10:28 +00:00
TiddlyWiki5/core/ui/EditTemplate/fields.tid
Jermolene d357e1706c Allow visible edit fields to be configured
Create a tiddler “$:/config/EditTemplateFields/Visibility/fieldname”
with the text “hide” to hide a particular field
2014-08-01 17:03:53 +01:00

43 lines
1.4 KiB
Plaintext

title: $:/core/ui/EditTemplate/fields
tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/
\define config-title()
$:/config/EditTemplateFields/Visibility/$(currentField)$
\end
<$fieldmangler>
<div class="tw-edit-fields">
<table class="tw-edit-fields">
<tbody>
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField">
<$reveal type="nomatch" state=<<config-title>> text="hide">
<tr class="tw-edit-field">
<td class="tw-edit-field-name">
<$text text=<<currentField>>/>:</td>
<td class="tw-edit-field-value">
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>
</td>
<td class="tw-edit-field-remove">
<$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button>
</td>
</tr>
</$reveal>
</$list>
</tbody>
</table>
</div>
<div class="tw-edit-field-add">
<em class="tw-edit">
<<lingo Fields/Add/Prompt>>
</em> <span class="tw-edit-field-add-name">
<$edit-text tiddler="$:/temp/newfieldname" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} class="tw-edit-texteditor"/>
</span> <span class="tw-edit-field-add-button">
<$button message="tw-add-field" param={{$:/temp/newfieldname}} set="$:/temp/newfieldname" setTo="" class="">
<<lingo Fields/Add/Button>>
</$button>
</span>
</div>
</$fieldmangler>