forked from goffee/core
WIP pull #1
5 changed files with 17 additions and 11 deletions
2
core.go
2
core.go
|
@ -245,7 +245,7 @@ func (app *App) makeHTTPRouterHandlerFunc(h Controller, ms []Hook) httprouter.Ha
|
|||
w.WriteHeader(ctx.Response.statusCode)
|
||||
}
|
||||
if ctx.Response.redirectTo != "" {
|
||||
http.Redirect(w, r, ctx.Response.redirectTo, http.StatusPermanentRedirect)
|
||||
http.Redirect(w, r, ctx.Response.redirectTo, http.StatusTemporaryRedirect)
|
||||
} else {
|
||||
w.Write(ctx.Response.body)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package components
|
||||
|
||||
type FormButton struct {
|
||||
ID string
|
||||
Value string
|
||||
Text string
|
||||
Icon string
|
||||
IsSubmit bool
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{define "form_button"}}
|
||||
<button class="btn btn-{{.TypeClass}}" {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}>
|
||||
<button {{if .ID }}id="{{.ID}}" name="{{.ID}}"{{end}} {{if .Value }}value="{{.Value}}" name="{{.ID}}"{{end}} class="btn btn-{{.TypeClass}}" {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}>
|
||||
{{.Text}}
|
||||
</button>
|
||||
<!-- tailwind heroicons -->
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package components
|
||||
|
||||
type FormInput struct {
|
||||
ID string
|
||||
Label string
|
||||
Type string
|
||||
Placeholder string
|
||||
Value string
|
||||
Hint string
|
||||
Error string
|
||||
IsDisabled bool
|
||||
IsRequired bool
|
||||
ID string
|
||||
Label string
|
||||
Type string
|
||||
Placeholder string
|
||||
Value string
|
||||
Hint string
|
||||
Error string
|
||||
IsDisabled bool
|
||||
Autocomplete bool
|
||||
IsRequired bool
|
||||
}
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
{{if eq .IsRequired true}}
|
||||
required
|
||||
{{end}}
|
||||
{{if eq .Autocomplete false}}
|
||||
autocomplete="off"
|
||||
{{end}}
|
||||
{{if ne .Value ""}}
|
||||
value="{{.Value}}"
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in a new issue