109 lines
3.3 KiB
Smarty
109 lines
3.3 KiB
Smarty
{{ define "content" }}
|
|
|
|
{{$isAdmin := .Claims|isAdmin}}
|
|
{{$isSchool := .Claims|isSchool}}
|
|
{{$isParticipant := .Claims|isParticipant}}
|
|
|
|
<div class="container">
|
|
|
|
|
|
{{if not $isParticipant}}
|
|
{{template "breadcrumb" toSlice "Partecipanti" (all "Participant") (.Data|string) "current"}}
|
|
{{template "show_header" dict "title" (.Data|string) "updatePath" (.Data.ID|update "Participant") "deletePath" (.Data.ID|delete "Participant")}}
|
|
{{end}}
|
|
|
|
<h2 class="karmen-relation-header">Informazioni generali</h2>
|
|
<dl class="row">
|
|
<dt class="col-sm-3">Username</dt>
|
|
<dd class="col-sm-9"><span class="text-monospace">{{.Data.User.Username}}</span></dd>
|
|
<dt class="col-sm-3">Password</dt>
|
|
<dd class="col-sm-9"><span class="text-monospace">{{.Data.User.Password}}</span></dd>
|
|
<dt class="col-sm-3">Categoria</dt>
|
|
<dd class="col-sm-9">{{.Data.Category}}</dd>
|
|
|
|
{{if $isAdmin}}
|
|
{{if $creatorUser:=.Data.CreatedBy}}
|
|
<dt class="col-sm-3">Creato da</dt>
|
|
<dd class="col-sm-9">{{$creatorUser.Username}}[{{$creatorUser.Role}}] {{$.Data.CreatedAt|prettyDateTime}}</dd>
|
|
<dt class="col-sm-3">IP di chi ha creato il partecipante</dt>
|
|
<dd class="col-sm-9">{{.Data.CreatorIP}}</dd>
|
|
{{end}}
|
|
{{if $updaterUser:=.Data.UpdatedBy}}
|
|
<dt class="col-sm-3">Modificato da</dt>
|
|
<dd class="col-sm-9">{{$updaterUser.Username}}[{{$updaterUser.Role}}] {{$.Data.UpdatedAt|prettyDateTime}}</dd>
|
|
<dt class="col-sm-3">IP di chi ha modificato il partecipante</dt>
|
|
<dd class="col-sm-9">{{.Data.UpdaterIP}}</dd>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
</dl>
|
|
|
|
{{if or $isAdmin $isSchool}}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
{{$options := `
|
|
title: "Scuola di appartenenza del partecipante"
|
|
model: "School"
|
|
icon: "fa fa-school"
|
|
`}}
|
|
|
|
{{$noElements := "Il partecipante non appartiene ad alcuna scuola."}}
|
|
{{template "relation_list" dict "options" ($options|yaml) "data" .Data.School "noElements" $noElements}}
|
|
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if $isAdmin}}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
{{$options := `
|
|
title: "Categoria del partecipante"
|
|
model: "Category"
|
|
icon: "fa fa-object-group"
|
|
`}}
|
|
|
|
{{$noElements := "Il partecipante non appartiene ad alcuna categoria."}}
|
|
{{template "relation_list" dict "options" ($options|yaml) "data" .Data.Category "noElements" $noElements}}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
{{$options := `
|
|
title: "Gare a cui il partecipante è iscritto"
|
|
model: "Contest"
|
|
icon: "fa fa-hourglass-start"
|
|
`}}
|
|
|
|
{{$noElements := "Il partecipante non è iscritto ad alcuna gara."}}
|
|
{{template "relation_list" dict "options" ($options|yaml) "data" .Data.Contests "noElements" $noElements}}
|
|
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if or $isAdmin $isParticipant}}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
{{$options := `
|
|
title: "Prove del partecipante"
|
|
model: "Response"
|
|
icon: "fa fa-hourglass-start"
|
|
`}}
|
|
|
|
{{$noElements := "Al partecipante non è associata alcuna risposta."}}
|
|
{{template "relation_list" dict "options" ($options|yaml) "data" .Data.Responses "noElements" $noElements}}
|
|
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|