Merge pull request 'main' (#24) from main into develop
Reviewed-on: #24
This commit is contained in:
commit
e43ace6679
4 changed files with 19 additions and 6 deletions
|
|
@ -15,6 +15,7 @@ type ContentTableTH struct {
|
|||
}
|
||||
|
||||
type ContentTableTD struct {
|
||||
ID string
|
||||
Value interface{} // string or component struct according ValueType
|
||||
ID string
|
||||
Value interface{} // string or component struct according ValueType
|
||||
ValueClass string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{{- range .AllTD}}<tr scope="row">
|
||||
{{range $index, $item := .}}<td {{ if $item.ID }}id="{{$item.ID}}"{{end}}>
|
||||
{{range $index, $item := .}}<td {{ if $item.ID }}id="{{$item.ID}}"{{end}}{{ if $item.ValueClass }} class="{{$item.ValueClass}}"{{end}}>
|
||||
{{ with $x := index $.AllTH $index }}
|
||||
{{ if eq $x.ValueType "href"}}
|
||||
{{template "content_href" $item.Value}}
|
||||
|
|
@ -16,7 +16,9 @@
|
|||
{{ else if eq $x.ValueType "list"}}
|
||||
{{template "content_list" $item.Value}}
|
||||
{{ else if eq $x.ValueType "checkbox"}}
|
||||
{{template "form_checkbox" $item.Value}}
|
||||
{{template "form_checkbox" $item.Value}}
|
||||
{{ else if eq $x.ValueType "image"}}
|
||||
<img src="{{ $item.Value }}">
|
||||
{{ else }}
|
||||
{{ $item.Value }}
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue