Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed css/.property_display.go.swp
Binary file not shown.
13 changes: 13 additions & 0 deletions htmlhelper/button.go
Original file line number Diff line number Diff line change
@@ -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...),
)
}
9 changes: 9 additions & 0 deletions htmlhelper/email_field.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package htmlhelper

import (
. "github.com/kirillrdy/nadeshiko/html"
)

func EmailField() Node {
return Input().Type("email").Name("email").Placeholder("E-mail")
}
18 changes: 18 additions & 0 deletions htmlhelper/link_to.go
Original file line number Diff line number Diff line change
@@ -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...)
}
9 changes: 9 additions & 0 deletions htmlhelper/password_field.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package htmlhelper

import (
. "github.com/kirillrdy/nadeshiko/html"
)

func PasswordField() Node {
return Input().Type("password").Name("password").Placeholder("Password")
}