oef/templates/answers.html.tpl
2020-01-27 15:22:11 +01:00

36 lines
930 B
Smarty

{{ define "content" }}
<div class="container">
{{$options := `
title: "Risposte"
buttonTitle: "Crea nuova risposta"
`}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Answer")}}
{{template "search_input" .Data}}
{{if not .}}
{{template "display_no_elements"}}
{{else}}
<div class="list-group" id="myUL">
{{range $element := .Data}}
<a class="list-group-item list-group-item-action" href={{$element.ID|show "Answer"}}>
<span class="fa fa-reply"></span>
{{$element|string}}
<div class="text-right">
{{$options := `noElements: "nessuna domanda"`}}
{{template "small" dict "options" ($options | yaml) "data" $element.Question}}
{{if $element.Correct}}
{{template "small" dict "options" ($options | yaml) "data" "corretta"}}
{{end}}
</div>
</a>
{{end}}
{{end}}
</div>
</div>
{{ end }}