From 8950cb539a7a749c25d2eb8159635060c0a51884 Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Fri, 22 Nov 2024 16:25:06 -0500 Subject: [PATCH 1/4] change to temporary --- core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core.go b/core.go index d449635..df6254a 100644 --- a/core.go +++ b/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) } From 5896e6e6174c2b84d7628822483838c036f207ac Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Fri, 6 Dec 2024 04:55:43 -0500 Subject: [PATCH 2/4] add ID to button --- template/components/form_button.go | 2 ++ template/components/form_button.html | 2 +- template/components/form_input.go | 19 ++++++++++--------- template/components/form_input.html | 3 +++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/template/components/form_button.go b/template/components/form_button.go index 658306e..4b451bf 100644 --- a/template/components/form_button.go +++ b/template/components/form_button.go @@ -1,6 +1,8 @@ package components type FormButton struct { + ID string + Value string Text string Icon string IsSubmit bool diff --git a/template/components/form_button.html b/template/components/form_button.html index 7594613..b58a9ed 100644 --- a/template/components/form_button.html +++ b/template/components/form_button.html @@ -1,5 +1,5 @@ {{define "form_button"}} - diff --git a/template/components/form_input.go b/template/components/form_input.go index e27910f..d1264ec 100644 --- a/template/components/form_input.go +++ b/template/components/form_input.go @@ -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 } diff --git a/template/components/form_input.html b/template/components/form_input.html index 8159896..6103b76 100644 --- a/template/components/form_input.html +++ b/template/components/form_input.html @@ -8,6 +8,9 @@ {{if eq .IsRequired true}} required {{end}} + {{if eq .Autocomplete false}} + autocomplete="off" + {{end}} {{if ne .Value ""}} value="{{.Value}}" {{end}} From 5d737c6b10f642c631499dc732f16bbb8041acc5 Mon Sep 17 00:00:00 2001 From: jacs Date: Sun, 8 Dec 2024 00:24:44 -0500 Subject: [PATCH 3/4] add buffer pdf response --- response.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/response.go b/response.go index 7c03b15..525023a 100644 --- a/response.go +++ b/response.go @@ -27,6 +27,17 @@ type header struct { val string } +// TODO add doc +func (rs *Response) BufferPDF(name string, b bytes.Buffer) *Response { + + if rs.isTerminated == false { + rs.HttpResponseWriter.Header().Add("Content-Type", "application/pdf") + rs.HttpResponseWriter.Header().Add("Content-Disposition", "attachment; filename="+name) + b.WriteTo(rs.HttpResponseWriter) + } + return rs +} + // TODO add doc func (rs *Response) Any(body any) *Response { if rs.isTerminated == false { From 2076b4b35bf00549782d39d8f39a0674d708480a Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Sun, 8 Dec 2024 08:52:35 -0500 Subject: [PATCH 4/4] add ID to dropdown --- template/components/content_dropdown.go | 1 + 1 file changed, 1 insertion(+) diff --git a/template/components/content_dropdown.go b/template/components/content_dropdown.go index 78c41c7..65eb21f 100644 --- a/template/components/content_dropdown.go +++ b/template/components/content_dropdown.go @@ -1,6 +1,7 @@ package components type ContentDropdown struct { + ID string Label string TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, link, outline-primary IsDisabled bool