oef/templates/questions_add_update.html.tpl

29 lines
977 B
Smarty
Raw Normal View History

2019-11-04 15:00:46 +01:00
{{ define "content" }}
<div class="container">
2019-11-13 12:06:29 +01:00
{{$update := .Options.Get "update"}}
2019-11-04 15:00:46 +01:00
2019-11-13 12:06:29 +01:00
{{if $update}}
2019-11-04 15:00:46 +01:00
2019-11-13 12:06:29 +01:00
{{template "breadcrumb" toSlice "Questions" (all "Question") (.Data|string) (.Data.ID|show "Question") "Aggiorna" "current"}}
{{else}}
{{template "breadcrumb" toSlice "Questions" (all "Question") "Aggiungi" "current"}}
{{end}}
2019-11-04 15:00:46 +01:00
2019-11-13 12:06:29 +01:00
{{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo ELEMENTO" "updateTitle" (printf "Aggiorna ELEMENTO %s" (.Data|string))}}
{{$form := "form_add_update"}}
<form
class="needs-validation"
action="{{if $update}}{{.Data.ID|update "Question"}}{{else}}{{create "Question"}}{{end}}"
method="POST"
role="form"
id={{$form}}>
2019-11-04 15:00:46 +01:00
2019-11-13 12:06:29 +01:00
{{$options := ` { name: "Text",id: "question_text",label: "Testo della domanda",placeholder: "Inserire il testo della domanda",type: "text",required: "true"} `}}
{{template "input" dict "options" ($options|yaml) "value" (.Data|field "Text") "update" $update}}
2019-11-04 15:00:46 +01:00
2019-11-13 12:06:29 +01:00
</form>
</div>
2019-11-04 15:00:46 +01:00
{{ end }}