Compare commits

...

2 commits

Author SHA1 Message Date
6233298feb id form button, redirect 2024-11-02 20:23:48 -05:00
e7cc41672d Merge pull request 'develop' (#5) from goffee/core:develop into develop
Reviewed-on: diana/core#5
2024-11-02 21:10:40 -04:00
3 changed files with 3 additions and 2 deletions

View file

@ -245,7 +245,7 @@ func (app *App) makeHTTPRouterHandlerFunc(h Controller, ms []Hook) httprouter.Ha
w.WriteHeader(ctx.Response.statusCode) w.WriteHeader(ctx.Response.statusCode)
} }
if ctx.Response.redirectTo != "" { if ctx.Response.redirectTo != "" {
http.Redirect(w, r, ctx.Response.redirectTo, http.StatusPermanentRedirect) http.Redirect(w, r, ctx.Response.redirectTo, http.StatusTemporaryRedirect)
} else { } else {
w.Write(ctx.Response.body) w.Write(ctx.Response.body)
} }

View file

@ -1,6 +1,7 @@
package components package components
type FormButton struct { type FormButton struct {
ID string
Text string Text string
Icon string Icon string
IsSubmit bool IsSubmit bool

View file

@ -1,5 +1,5 @@
{{define "form_button"}} {{define "form_button"}}
<button class="btn btn-{{.TypeClass}}" {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}> <button class="btn btn-{{.TypeClass}}" {{ if .ID }}id="{{.ID}}"{{end}} {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}>
{{.Text}} {{.Text}}
</button> </button>
<!-- tailwind heroicons --> <!-- tailwind heroicons -->