{{ define "content" }} {{$isAdmin := .Claims|isAdmin}} {{$isParticipant := .Claims|isParticipant}} {{$update := .Options.Get "update"}}
{{if $isAdmin}} {{if $update}} {{template "breadcrumb" toSlice "Prove" (all "Response") (.Data|string) (.Data.ID|show "Response") "Aggiorna" "current"}} {{else}} {{template "breadcrumb" toSlice "Prove" (all "Response") "Aggiungi" "current"}} {{end}} {{end}} {{template "add_update_header" dict "update" $update "addTitle" "Rispondi al questionario" "updateTitle" (printf "Aggiorna le tue risposte %s" (.Data|string))}} {{$form := "form_add_update"}}
{{range $id,$question := .Data.Questions}}

{{$question.Text}}

{{range $answer := $question.Answers}}
{{$checked := false}} {{if isResponseIn $answer.ID $.Data.AnswersIDs}} {{$checked = true}} {{end}}
{{end}}
{{end}} {{if $isAdmin}} {{$options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Response" } `}} {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}} {{else}} {{$options := ` { saveTitle: "Invia le risposte", model: "Response" } `}} {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}} {{end}}
{{ end }}