From 7073cd1c21913816445c2fc9a6e0294a5429122c Mon Sep 17 00:00:00 2001 From: Diana Date: Sat, 12 Oct 2024 13:01:52 -0500 Subject: [PATCH] components: buttons, dropdown, href, nav --- template/components/form_button.go | 3 +-- template/components/form_button.html | 35 +++++++++++++------------- template/components/form_dropdown.go | 15 +++++++++++ template/components/form_dropdown.html | 16 ++++++++++++ template/components/form_href.go | 10 ++++++++ template/components/form_href.html | 6 +++++ template/components/page_footer.html | 1 + template/components/page_nav.go | 16 ++++++++++++ template/components/page_nav.html | 23 +++++++++++++++++ 9 files changed, 106 insertions(+), 19 deletions(-) create mode 100644 template/components/form_dropdown.go create mode 100644 template/components/form_dropdown.html create mode 100644 template/components/form_href.go create mode 100644 template/components/form_href.html create mode 100644 template/components/page_nav.go create mode 100644 template/components/page_nav.html diff --git a/template/components/form_button.go b/template/components/form_button.go index 2cfee00..658306e 100644 --- a/template/components/form_button.go +++ b/template/components/form_button.go @@ -2,9 +2,8 @@ package components type FormButton struct { Text string - Link string Icon string IsSubmit bool - IsPrimary bool + TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, link, outline-primary IsDisabled bool } diff --git a/template/components/form_button.html b/template/components/form_button.html index 5e1d68c..7594613 100644 --- a/template/components/form_button.html +++ b/template/components/form_button.html @@ -1,19 +1,20 @@ {{define "form_button"}} - - - {{if eq .Icon "gear"}} - - - - - {{else if eq .Icon "arrow-right"}} - - - - {{else if eq .Icon "plus"}} - - - - {{end}} + + + {{if eq .Icon "gear"}} + + + + + {{else if eq .Icon "arrow-right"}} + + + + {{else if eq .Icon "plus"}} + + + + {{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/form_dropdown.html b/template/components/form_dropdown.html new file mode 100644 index 0000000..2c6827b --- /dev/null +++ b/template/components/form_dropdown.html @@ -0,0 +1,16 @@ +{{define "form_dropdown_item"}} +
  • {{.Text}}
  • +{{end}} + +{{define "form_dropdown"}} + +{{end}} \ No newline at end of file diff --git a/template/components/form_href.go b/template/components/form_href.go new file mode 100644 index 0000000..25dbee3 --- /dev/null +++ b/template/components/form_href.go @@ -0,0 +1,10 @@ +package components + +type FormHref struct { + Text string + Link string + Icon string + IsButton bool + TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, link + IsDisabled bool +} diff --git a/template/components/form_href.html b/template/components/form_href.html new file mode 100644 index 0000000..dc9adb3 --- /dev/null +++ b/template/components/form_href.html @@ -0,0 +1,6 @@ +{{define "form_href"}} + + {{.Text}} + +{{end}} \ No newline at end of file diff --git a/template/components/page_footer.html b/template/components/page_footer.html index 20b7f38..6421f3e 100644 --- a/template/components/page_footer.html +++ b/template/components/page_footer.html @@ -2,5 +2,6 @@ + {{end}} \ No newline at end of file diff --git a/template/components/page_nav.go b/template/components/page_nav.go new file mode 100644 index 0000000..2ed9319 --- /dev/null +++ b/template/components/page_nav.go @@ -0,0 +1,16 @@ +package components + +type PageNav struct { + NavClass string // nav-pills + NavItems []PageNavItem + IsVertical bool + IsTab bool +} + +type PageNavItem struct { + Text string + Link string + IsDisabled bool + IsActive bool + ChildItems []PageNavItem +} diff --git a/template/components/page_nav.html b/template/components/page_nav.html new file mode 100644 index 0000000..5bb0b83 --- /dev/null +++ b/template/components/page_nav.html @@ -0,0 +1,23 @@ +{{define "page_nav"}} + +{{end}}