Download this file
| 1 | {{define "title"}}Edit {{.Field.Label}} · Fichas{{end}} |
| 2 | {{define "content"}} |
| 3 | <header fichas-appbar> |
| 4 | <h1 fichas-appbar-title>Edit {{.Field.Label}} <span>{{.Type.Plural}}</span></h1> |
| 5 | </header> |
| 6 | <form method="post" action="/fields/{{.Field.Def.Key}}" fichas-form rst-stack> |
| 7 | {{template "field" (dict "ID" "label" "Name" "label" "Label" "Field name" "Value" .Label "Required" true "Error" (errFor .Errors "label"))}} |
| 8 | {{if eq .Field.Def.Kind "enum"}} |
| 9 | {{template "field-textarea" (dict "Name" "options" "Label" "Options" "Value" .Options "Rows" 6 "Hint" "one per line" "Error" (errFor .Errors "options"))}} |
| 10 | <p fichas-meta>Removing an option doesn't change cards that already have it — they keep showing their value.</p> |
| 11 | {{end}} |
| 12 | {{template "detail-list" (dict "Items" (list |
| 13 | (dict "Label" "Kind" "Value" .KindWords) |
| 14 | (dict "Label" "Findable by exact match" "Value" (yesNo (eq (printf "%s" .Field.Def.Tier) "print")))))}} |
| 15 | <p fichas-meta>Kind and findability are fixed once a field exists: both describe how its values are stored.</p> |
| 16 | {{template "form-foot" (dict "Submit" "Save" "CancelHref" (printf "/t/%s/fields" .TypeKey) "CancelLabel" "Cancel")}} |
| 17 | </form> |
| 18 | {{end}} |
| 19 | |