diff --git a/template/components/content_badge.go b/template/components/content_badge.go deleted file mode 100644 index 7da7147..0000000 --- a/template/components/content_badge.go +++ /dev/null @@ -1,7 +0,0 @@ -package components - -type ContentBadge struct { - Text string - TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, (default secondary) - IsOutline bool -} diff --git a/template/components/content_badge.html b/template/components/content_badge.html deleted file mode 100644 index 6f72cf7..0000000 --- a/template/components/content_badge.html +++ /dev/null @@ -1,7 +0,0 @@ -{{define "content_badge"}} - {{.Text}} -{{end}} \ No newline at end of file diff --git a/template/components/content_dropdown.go b/template/components/content_dropdown.go deleted file mode 100644 index 1040060..0000000 --- a/template/components/content_dropdown.go +++ /dev/null @@ -1,15 +0,0 @@ -package components - -type ContentDropdown struct { - Label string - TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, link, outline-primary - IsDisabled bool - Items []ContentDropdownItem -} - -type ContentDropdownItem struct { - Text string - Link string - IsDisabled bool - IsActive bool -} diff --git a/template/components/content_list.go b/template/components/content_list.go deleted file mode 100644 index 34bfb49..0000000 --- a/template/components/content_list.go +++ /dev/null @@ -1,19 +0,0 @@ -package components - -type ContentList struct { - Items []ContentListItem -} - -type ContentListItem struct { - Text string - Description string - EndElement string - //Link string - TypeClass string // primary, secondary, success, danger, warning, info, light, dark - IsDisabled bool - //IsActive bool -} - -//link -//border -// badge diff --git a/template/components/content_list.html b/template/components/content_list.html deleted file mode 100644 index 31af60b..0000000 --- a/template/components/content_list.html +++ /dev/null @@ -1,14 +0,0 @@ -{{define "content_list"}} - - - - -{{end}} \ No newline at end of file diff --git a/template/components/content_table.go b/template/components/content_table.go index 1cb7024..66c7e1f 100644 --- a/template/components/content_table.go +++ b/template/components/content_table.go @@ -1,20 +1,17 @@ package components type ContentTable struct { - ID string - TableClass string // table-primary, table-secondary,.. table-striped table-bordered - HeadClass string // table-dark table-light - AllTH []ContentTableTH - AllTD [][]ContentTableTD + ID string + AllTH []ContentTableTH + AllTD [][]ContentTableTD } type ContentTableTH struct { - ID string - ValueType string // -> default string, href, badge - Value string + ID string + Value string } type ContentTableTD struct { ID string - Value interface{} // string or component struct according ValueType + Value string } diff --git a/template/components/content_table.html b/template/components/content_table.html index 2bf559d..f7c2f89 100644 --- a/template/components/content_table.html +++ b/template/components/content_table.html @@ -1,25 +1,12 @@ {{define "content_table"}} - - +
+ {{range $index, $col := .AllTH}}{{end}} - {{- range .AllTD}} - {{range $index, $item := .}} - {{end}} - {{- end}} +{{- range .AllTD}}{{range .}}{{end}}{{- end}}
{{ $col.Value }}
- {{ 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}} -
{{ .Value }}
-{{end}} +{{end}} \ No newline at end of file diff --git a/template/components/form_dropdown.go b/template/components/form_dropdown.go new file mode 100644 index 0000000..b80d8f1 --- /dev/null +++ b/template/components/form_dropdown.go @@ -0,0 +1,15 @@ +package components + +type FormDropdown struct { + Label string + TypeClass string + IsDisabled bool + Items []FormDropdownItem +} + +type FormDropdownItem struct { + Text string + Link string + IsDisabled bool + IsActive bool +} diff --git a/template/components/content_dropdown.html b/template/components/form_dropdown.html similarity index 79% rename from template/components/content_dropdown.html rename to template/components/form_dropdown.html index ce83a26..2c6827b 100644 --- a/template/components/content_dropdown.html +++ b/template/components/form_dropdown.html @@ -1,15 +1,15 @@ -{{define "content_dropdown_item"}} +{{define "form_dropdown_item"}}
  • {{.Text}}
  • {{end}} -{{define "content_dropdown"}} +{{define "form_dropdown"}} diff --git a/template/components/content_href.go b/template/components/form_href.go similarity index 88% rename from template/components/content_href.go rename to template/components/form_href.go index 143ca80..25dbee3 100644 --- a/template/components/content_href.go +++ b/template/components/form_href.go @@ -1,6 +1,6 @@ package components -type ContentHref struct { +type FormHref struct { Text string Link string Icon string diff --git a/template/components/content_href.html b/template/components/form_href.html similarity index 88% rename from template/components/content_href.html rename to template/components/form_href.html index f4980ac..dc9adb3 100644 --- a/template/components/content_href.html +++ b/template/components/form_href.html @@ -1,4 +1,4 @@ -{{define "content_href"}} +{{define "form_href"}} {{.Text}} diff --git a/template/components/form_input.go b/template/components/form_input.go index e27910f..0ce7ce4 100644 --- a/template/components/form_input.go +++ b/template/components/form_input.go @@ -9,5 +9,4 @@ type FormInput struct { Hint string Error string IsDisabled bool - IsRequired bool } diff --git a/template/components/form_input.html b/template/components/form_input.html index 8159896..b79ae87 100644 --- a/template/components/form_input.html +++ b/template/components/form_input.html @@ -5,9 +5,6 @@ {{if eq .IsDisabled true}} disabled {{end}} - {{if eq .IsRequired true}} - required - {{end}} {{if ne .Value ""}} value="{{.Value}}" {{end}} diff --git a/template/components/page_nav.go b/template/components/page_nav.go index 862d1c8..2ed9319 100644 --- a/template/components/page_nav.go +++ b/template/components/page_nav.go @@ -1,7 +1,7 @@ package components type PageNav struct { - NavClass string // nav-pills, nav-underline + NavClass string // nav-pills NavItems []PageNavItem IsVertical bool IsTab bool diff --git a/template/components/page_nav.html b/template/components/page_nav.html index 08faaf4..5bb0b83 100644 --- a/template/components/page_nav.html +++ b/template/components/page_nav.html @@ -8,7 +8,7 @@ class="nav-link dropdown-toggle {{if eq .IsActive true}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}">{{$item.Text}}