diff --git a/template/components/button.go b/template/components/form_button.go similarity index 83% rename from template/components/button.go rename to template/components/form_button.go index 0c52a38..2cfee00 100644 --- a/template/components/button.go +++ b/template/components/form_button.go @@ -1,6 +1,6 @@ package components -type Button struct { +type FormButton struct { Text string Link string Icon string diff --git a/template/components/button.html b/template/components/form_button.html similarity index 89% rename from template/components/button.html rename to template/components/form_button.html index 6590905..5e1d68c 100644 --- a/template/components/button.html +++ b/template/components/form_button.html @@ -1,7 +1,6 @@ -{{define "button"}} - {{if eq .Icon "gear"}} @@ -17,6 +16,4 @@ {{end}} - - {{end}} \ No newline at end of file diff --git a/template/components/form_input.go b/template/components/form_input.go new file mode 100644 index 0000000..0ce7ce4 --- /dev/null +++ b/template/components/form_input.go @@ -0,0 +1,12 @@ +package components + +type FormInput struct { + ID string + Label string + Type string + Placeholder string + Value string + Hint string + Error string + IsDisabled bool +} diff --git a/template/components/form_input.html b/template/components/form_input.html new file mode 100644 index 0000000..b79ae87 --- /dev/null +++ b/template/components/form_input.html @@ -0,0 +1,15 @@ +{{define "form_input"}} +
+ + + {{if ne .Hint ""}}{{.Hint}}{{end}} + {{if ne .Error ""}}
{{.Error}}
{{end}} +
+{{end}} \ No newline at end of file diff --git a/template/components/page.html b/template/components/page.html deleted file mode 100644 index 636487b..0000000 --- a/template/components/page.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - My Website - - - - -
-

Welcome to My Website

-
- - - \ No newline at end of file diff --git a/template/components/page_card.go b/template/components/page_card.go new file mode 100644 index 0000000..7f9b504 --- /dev/null +++ b/template/components/page_card.go @@ -0,0 +1,8 @@ +package components + +type PageCard struct { + CardTitle string + CardSubTitle string + CardBody string + CardLink string +} diff --git a/template/components/page_card.html b/template/components/page_card.html new file mode 100644 index 0000000..9ef8821 --- /dev/null +++ b/template/components/page_card.html @@ -0,0 +1,11 @@ +{{define "page_card"}} +
+
+ {{if .CardTitle}}
{{.CardTitle}}
{{end}} + {{if .CardSubTitle}}
{{.CardSubTitle}}
{{end}} + {{if .CardBody}}

{{.CardBody}}

{{end}} + {{block "page_card_content" .}}{{end}} + {{if .CardLink}}Card link{{end}} +
+
+{{end}} \ No newline at end of file diff --git a/template/components/page_footer.html b/template/components/page_footer.html new file mode 100644 index 0000000..20b7f38 --- /dev/null +++ b/template/components/page_footer.html @@ -0,0 +1,6 @@ +{{define "page_footer"}} + + +{{end}} \ No newline at end of file diff --git a/template/components/head.html b/template/components/page_head.html similarity index 75% rename from template/components/head.html rename to template/components/page_head.html index 68aaca8..e589e84 100644 --- a/template/components/head.html +++ b/template/components/page_head.html @@ -1,4 +1,4 @@ -{{define "head"}} +{{define "page_head"}} @@ -6,5 +6,6 @@ {{.}} | Goffee + {{end}} \ No newline at end of file diff --git a/template/components/page_page.html b/template/components/page_page.html new file mode 100644 index 0000000..2c83582 --- /dev/null +++ b/template/components/page_page.html @@ -0,0 +1,14 @@ + + + {{template "page_head" "Goffee"}} + +
+ {{block "page_content" .}} +
+

Use this file as base inside cup application

+
+ {{end}} + {{template "page_footer"}} +
+ + \ No newline at end of file diff --git a/template/components/title.go b/template/components/title.go deleted file mode 100644 index 0e68b6a..0000000 --- a/template/components/title.go +++ /dev/null @@ -1,5 +0,0 @@ -package components - -type Title struct { - Label string -} diff --git a/template/components/title.html b/template/components/title.html deleted file mode 100644 index eef5bf3..0000000 --- a/template/components/title.html +++ /dev/null @@ -1,5 +0,0 @@ -{{define "title"}} -
-

{{.Label}}

-
-{{end}} \ No newline at end of file