Pass data to search template

This commit is contained in:
Andrea Fazzi 2020-01-27 15:22:11 +01:00
parent 57e26e351e
commit 605e79e65a
7 changed files with 11 additions and 7 deletions

View file

@ -8,7 +8,7 @@
`}} `}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Answer")}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Answer")}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}

View file

@ -24,7 +24,7 @@
{{if $admin}} {{if $admin}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Contest")}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Contest")}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}

View file

@ -1,7 +1,11 @@
{{define "search_input"}} {{define "search_input"}}
<div class="input-group" style="margin-bottom: 20px"> <div class="input-group" style="margin-bottom: 20px">
{{if .}}
<span class="input-group-addon" id="search-query"><span class="glyphicon glyphicon-search"></span></span> <span class="input-group-addon" id="search-query"><span class="glyphicon glyphicon-search"></span></span>
<input type="text" id="myInput" class="form-control" aria-describedby="search-query"> <input type="text" id="myInput" class="form-control" aria-describedby="search-query">
{{else}}
<p>Non è stato inserito ancora nessun elemento.</p>
{{end}}
</div> </div>
{{end}} {{end}}

View file

@ -22,7 +22,7 @@
{{end}} {{end}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" $modelPath}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" $modelPath}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}

View file

@ -8,7 +8,7 @@
`}} `}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Question")}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Question")}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}

View file

@ -8,7 +8,7 @@
`}} `}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Response")}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "Response")}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}

View file

@ -8,7 +8,7 @@
`}} `}}
{{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "School")}} {{template "read_all_header" dict "options" ($options | yaml) "lengthData" (len .Data) "modelPath" (create "School")}}
{{template "search_input"}} {{template "search_input" .Data}}
{{if not .}} {{if not .}}
{{template "display_no_elements"}} {{template "display_no_elements"}}