Improve participant contest view

This commit is contained in:
Andrea Fazzi 2019-12-19 07:38:10 +01:00
parent ab683dca42
commit 560ba79ab8
4 changed files with 10 additions and 5 deletions

View file

@ -6,7 +6,7 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="btn-group float-right" role="group"> <div class="btn-group float-right" role="group">
{{template "update_button" dict "modelPath" .updatePath}} {{template "update_button" dict "updateButtonTitle" .options.updateButtonTitle "modelPath" .updatePath}}
{{if .deletePath}} {{if .deletePath}}
{{template "delete_button" dict "modelPath" .deletePath}} {{template "delete_button" dict "modelPath" .deletePath}}
{{end}} {{end}}

View file

@ -1,6 +1,6 @@
{{define "update_button"}} {{define "update_button"}}
<a href="{{.modelPath}}" class="btn btn-primary"> <a href="{{.modelPath}}" class="btn btn-primary">
<span class="fa fa-edit" aria-hidden="true"></span> <span class="fa fa-edit" aria-hidden="true"></span>
Modifica {{if .updateButtonTitle}}{{.updateButtonTitle}}{{else}}Modifica{{end}}
</a> </a>
{{end}} {{end}}

View file

@ -15,8 +15,12 @@
{{end}} {{end}}
{{end}} {{end}}
{{template "add_update_header" dict "update" $update "addTitle" "Rispondi al questionario" "updateTitle" (printf "Aggiorna le tue risposte %s" (.Data|string))}} {{if $isAdmin}}
{{template "add_update_header" dict "update" $update "addTitle" "Rispondi al questionario" "updateTitle" (printf "Aggiorna %s" (.Data|string))}}
{{else}}
{{template "add_update_header" dict "update" $update "addTitle" "Rispondi al questionario" "updateTitle" (.Data|string)}}
{{end}}
{{$form := "form_add_update"}} {{$form := "form_add_update"}}
<form <form
class="needs-validation" class="needs-validation"

View file

@ -11,7 +11,8 @@
{{end}} {{end}}
{{if $isParticipant}} {{if $isParticipant}}
{{template "show_header" dict "title" (.Data|string) "updatePath" (.Data.ID|update "Response")}} {{$options := `{updateButtonTitle: "Vai alla gara!"}`}}
{{template "show_header" dict "options" ($options|yaml) "title" (.Data|string) "updatePath" (.Data.ID|update "Response")}}
{{end}} {{end}}
<h2 class="karmen-relation-header">Informazioni generali</h2> <h2 class="karmen-relation-header">Informazioni generali</h2>