oef/templates/contests.html.tpl

51 lines
1.1 KiB
Smarty
Raw Normal View History

2019-11-14 12:55:22 +01:00
{{ define "content" }}
<div class="container">
2019-11-18 17:04:07 +01:00
{{$admin := (.Claims|isAdmin)}}
{{$options := ""}}
{{if $admin}}
{{$options = `
2019-11-14 12:55:22 +01:00
title: "Gare"
buttonTitle: "Crea nuova gara"
2019-11-18 17:04:07 +01:00
`}}
{{else}}
{{$options = `
title: "Gare a cui sei iscritto"
`}}
{{end}}
2019-11-14 12:55:22 +01:00
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Contest")}}
{{template "search_input"}}
{{if not .}}
{{template "display_no_elements"}}
{{else}}
<div class="list-group" id="myUL">
2019-11-18 17:04:07 +01:00
{{range $element := .Data}}
{{if $admin}}
<a class="list-group-item list-group-item-action" href={{$element.ID|show "Contest"}}>
{{else}}
<a class="list-group-item list-group-item-action" href={{create "Response"}}{{"&contest_id="}}{{$element.ID}}>
{{end}}
<span class="fa fa-hourglass-start"></span>
{{$element|string}}
<div class="text-right">
{{$options := `noElements: "nessuna data"`}}
{{template "small" dict "options" ($options | yaml) "data" ($element.Date|prettyDate)}}
</div>
</a>
{{end}}
{{end}}
</div>
2019-11-14 12:55:22 +01:00
</div>
{{ end }}