Working on contest description
This commit is contained in:
parent
7f0819fc81
commit
4965ccf0f9
5 changed files with 48 additions and 4 deletions
|
@ -21,6 +21,7 @@ type Contest struct {
|
|||
|
||||
Name string
|
||||
Category string
|
||||
Description string
|
||||
|
||||
Date time.Time
|
||||
StartTime time.Time
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
{{$options := ` { name: "Name",id: "contest_name",label: "Nome della gara",placeholder: "Inserire il nome della gara",type: "text",required: "true"} `}}
|
||||
{{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
|
||||
|
||||
{{$options := ` { name: "Description",id: "contest_description",label: "Descrizione della gara",placeholder: "Inserire una breve descrizione della gara",type: "text",required: "true"} `}}
|
||||
{{template "textarea" dict "options" ($options|yaml) "value" (.Data|field "Description") "update" $update}}
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
{{$options := ` { name: "Date",id: "contest_date",label: "La gara si svolgerà il giorno",type: "date" } `}}
|
||||
|
|
|
@ -24,6 +24,13 @@
|
|||
|
||||
</dl>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="karmen-relation-header">Descrizione</h2>
|
||||
{{.Data.Description}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
|
14
templates/layout/textarea.html.tpl
Normal file
14
templates/layout/textarea.html.tpl
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{define "textarea"}}
|
||||
<div class="{{if .options.formClass}}{{.options.formClass}}{{else}}form-group{{end}}">
|
||||
<label class="control-label" for="{{.options.id}}">{{.options.label}}</label>
|
||||
<textarea
|
||||
rows="5"
|
||||
name="{{.options.name}}"
|
||||
class="{{if .options.inputClass}}{{.options.inputClass}}{{else}}form-control{{end}}"
|
||||
id="{{.options.id}}"
|
||||
placeholder="{{.options.placeholder}}" {{if .options.otherAttrs}}{{.options.otherAttrs|attr}}{{end}} {{if .options.required}}required{{end}}>
|
||||
{{- if .update -}}{{- .value -}}{{- end -}}
|
||||
</textarea>
|
||||
{{if .options.help}}<small class="form-text text-muted">{{.options.help}}</small>{{end}}
|
||||
</div>
|
||||
{{end}}
|
|
@ -87,7 +87,26 @@
|
|||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if or $isAdmin $isParticipant}}
|
||||
{{if $isParticipant}}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="karmen-relation-header">Prove del partecipante</h2>
|
||||
{{range $response := .Data.Responses}}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{$response}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
||||
<a href="{{$response.ID|show "Response"|html}}" class="btn btn-primary">Apri la prova</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if $isAdmin}}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
|
Loading…
Reference in a new issue