core/template/components/content_tabledetail.html

30 lines
805 B
HTML
Raw Normal View History

2024-10-27 13:54:34 -04:00
{{define "content_tabledetail"}}
<table class="table table-hover" {{ if .ID }}id="{{.ID}}"{{end}}>
{{$stylecell := "table-success"}}
{{if .HeadClass }}{{$stylecell = .HeadClass}}{{end}}
{{if .Title }}
<thead class="{{.HeadClass}}">
<tr>
<th colspan="2" class="{{$stylecell}}">{{ .Title }}</th>
</tr>
</thead>
{{end}}
<tbody>
{{range $item := .AllTD}}
<tr scope="row" {{ if $item.ID }}id="{{$item.ID}}"{{end}}>
<td class="{{$stylecell}}">{{ $item.Caption }}</td>
<td>
{{ if eq $item.ValueType "href"}}
{{template "content_href" $item.Value}}
{{ else if eq $item.ValueType "badge"}}
{{template "content_badge" $item.Value}}
{{ else }}
{{ $item.Value }}
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}