forked from goffee/core
Merge pull request 'develop' (#2) from goffee/core:develop into develop
Reviewed-on: #2
This commit is contained in:
commit
05bd3a01ee
2 changed files with 29 additions and 0 deletions
17
template/components/content_table.go
Normal file
17
template/components/content_table.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package components
|
||||||
|
|
||||||
|
type ContentTable struct {
|
||||||
|
ID string
|
||||||
|
AllTH []ContentTableTH
|
||||||
|
AllTD [][]ContentTableTD
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContentTableTH struct {
|
||||||
|
ID string
|
||||||
|
Value string
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContentTableTD struct {
|
||||||
|
ID string
|
||||||
|
Value string
|
||||||
|
}
|
12
template/components/content_table.html
Normal file
12
template/components/content_table.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{{define "content_table"}}
|
||||||
|
<table class="table table-hover" {{ if .ID }}id="{{.ID}}"{{end}}>
|
||||||
|
<thead>
|
||||||
|
<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}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{end}}
|
Loading…
Reference in a new issue