forked from goffee/core
Input required, table (class, href, badge)
This commit is contained in:
parent
f398ebb02d
commit
458ad520ca
6 changed files with 31 additions and 11 deletions
|
|
@ -1,12 +1,25 @@
|
|||
{{define "content_table"}}
|
||||
<table class="table table-hover" {{ if .ID }}id="{{.ID}}"{{end}}>
|
||||
<thead>
|
||||
<table class="table table-hover {{.TableClass}}" {{ if .ID }}id="{{.ID}}"{{end}}>
|
||||
<thead class="{{.HeadClass}}">
|
||||
<tr>
|
||||
{{range $index, $col := .AllTH}}<th {{ if .ID }}id="{{.ID}}"{{end}} scope="col">{{ $col.Value }}</th>{{end}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .AllTD}}<tr scope="row">{{range .}}<td {{ if .ID }}id="{{.ID}}"{{end}}>{{ .Value }}</td>{{end}}</tr>{{end}}
|
||||
{{range .AllTD}}<tr scope="row">
|
||||
{{range $index, $item := .}}<td {{ if $item.ID }}id="{{$item.ID}}"{{end}}>
|
||||
{{ with $x := index $.AllTH $index }}
|
||||
{{ if eq $x.ValueType "href"}}
|
||||
{{template "content_href" $item.Value}}
|
||||
{{ else if eq $x.ValueType "badge"}}
|
||||
{{template "content_badge" $item.Value}}
|
||||
{{ else }}
|
||||
{{ $item.Value }}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
{{end}}</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue