oef/templates/contests.html.tpl

76 lines
1.7 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
2019-11-22 11:16:27 +01:00
{{if $admin}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Contest")}}
2020-01-27 15:22:11 +01:00
{{template "search_input" .Data}}
2019-11-14 12:55:22 +01:00
{{if not .}}
{{template "display_no_elements"}}
{{else}}
<div class="list-group" id="myUL">
2019-11-18 17:04:07 +01:00
{{range $element := .Data}}
<a class="list-group-item list-group-item-action" href={{$element.ID|show "Contest"}}>
2019-11-22 11:16:27 +01:00
<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>
{{else}}
{{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">
{{range $element := .Data}}
<a class="list-group-item list-group-item-action" href={{$element.ID|show "Contest"}}>
<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}}
2019-11-18 17:04:07 +01:00
</div>
2019-11-22 11:16:27 +01:00
{{end}}
2019-11-18 17:04:07 +01:00
2019-11-14 12:55:22 +01:00
</div>
{{ end }}