diff --git a/css/.property_display.go.swp b/css/.property_display.go.swp deleted file mode 100644 index 413ac00..0000000 Binary files a/css/.property_display.go.swp and /dev/null differ diff --git a/htmlhelper/button.go b/htmlhelper/button.go new file mode 100644 index 0000000..f7e75a1 --- /dev/null +++ b/htmlhelper/button.go @@ -0,0 +1,13 @@ +package htmlhelper + +import ( + . "github.com/kirillrdy/nadeshiko/html" + "github.com/sparkymat/webdsl/css" +) + +func SubmitButton(text string, iconClasses ...css.Class) Node { + return Button().Type("submit").Children( + Span().Text(text), + I().Class(iconClasses...), + ) +} diff --git a/htmlhelper/email_field.go b/htmlhelper/email_field.go new file mode 100644 index 0000000..3241b41 --- /dev/null +++ b/htmlhelper/email_field.go @@ -0,0 +1,9 @@ +package htmlhelper + +import ( + . "github.com/kirillrdy/nadeshiko/html" +) + +func EmailField() Node { + return Input().Type("email").Name("email").Placeholder("E-mail") +} diff --git a/htmlhelper/link_to.go b/htmlhelper/link_to.go new file mode 100644 index 0000000..a40d323 --- /dev/null +++ b/htmlhelper/link_to.go @@ -0,0 +1,18 @@ +package htmlhelper + +import ( + . "github.com/kirillrdy/nadeshiko/html" + "github.com/sparkymat/webdsl/http" +) + +func ButtonLink(url string, method http.Method, text string) Node { + return Form().Action(url).Method(string(method)).Children( + Button().Type("submit").Children( + Span().Text(text), + ), + ) +} + +func ContainerLink(url string, innerNodes ...Node) Node { + return A().Href(url).Children(innerNodes...) +} diff --git a/htmlhelper/password_field.go b/htmlhelper/password_field.go new file mode 100644 index 0000000..7db2cec --- /dev/null +++ b/htmlhelper/password_field.go @@ -0,0 +1,9 @@ +package htmlhelper + +import ( + . "github.com/kirillrdy/nadeshiko/html" +) + +func PasswordField() Node { + return Input().Type("password").Name("password").Placeholder("Password") +}