From 892ab6406439956d0110f3e5ba97f821e2e794d2 Mon Sep 17 00:00:00 2001 From: Erika Harker Date: Thu, 18 Dec 2025 10:59:21 -0500 Subject: [PATCH 1/3] Manage message in url param --- response.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/response.go b/response.go index d6202c7..6beb36e 100644 --- a/response.go +++ b/response.go @@ -9,10 +9,13 @@ import ( "bytes" "fmt" "net/http" + "strings" ) // Response represents an HTTP response to be sent to the client, including headers, body, status code, and metadata. type Response struct { + FlashMessage string + MsgType string headers []header body []byte statusCode int @@ -144,6 +147,23 @@ func (rs *Response) Redirect(url string) *Response { }, map[string]interface{}{ "url": "url", }) + + if rs.FlashMessage != "" || rs.MsgType != "" { + if !strings.Contains(url, "?") { + url += "?" + } else { + url += "&" + } + if rs.FlashMessage != "" { + url += "flash_message=" + rs.FlashMessage + } + if rs.MsgType != "" { + if rs.FlashMessage != "" { + url += "&" + } + url += "msg_type=" + rs.MsgType + } + } if v.Failed() { if url[0:1] != "/" { rs.redirectTo = "/" + url From 9d83eed4f37290bf78b0f9645417697ef5ad1099 Mon Sep 17 00:00:00 2001 From: Erika Harker Date: Thu, 18 Dec 2025 16:50:00 -0500 Subject: [PATCH 2/3] Color Picker to form --- template/components/form_color_opacity.go | 14 +++++++++++ template/components/form_color_opacity.html | 28 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 template/components/form_color_opacity.go create mode 100644 template/components/form_color_opacity.html diff --git a/template/components/form_color_opacity.go b/template/components/form_color_opacity.go new file mode 100644 index 0000000..1998386 --- /dev/null +++ b/template/components/form_color_opacity.go @@ -0,0 +1,14 @@ +package components + +type FormColorOpacity struct { + ColorID string + OpacityID string + Label string + ColorHexValue string + OpacityValue string + Hint string + Error string + IsDisabled bool + IsRequired bool + HasOpacity bool +} diff --git a/template/components/form_color_opacity.html b/template/components/form_color_opacity.html new file mode 100644 index 0000000..b429d55 --- /dev/null +++ b/template/components/form_color_opacity.html @@ -0,0 +1,28 @@ +{{ define "form_color_opacity"}} +
+ +
+ + {{if eq .HasOpacity true}} + opacity: + {{if ne .Hint ""}}{{.Hint}}{{end}} + {{if ne .Error ""}}
{{.Error}}
{{end}} + {{end}} +
+ +{{end}} + \ No newline at end of file From 3d4b3651f2227b24630cb7e97cf50f27f641d50a Mon Sep 17 00:00:00 2001 From: Erika Harker Date: Fri, 20 Mar 2026 18:21:49 -0500 Subject: [PATCH 3/3] PDF --- context.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/context.go b/context.go index 9015159..157ad4e 100644 --- a/context.go +++ b/context.go @@ -89,6 +89,22 @@ func (c *Context) GetRequesBodyMap() map[string]interface{} { return dat } +// get raw data for file binary +func (c *Context) GetRawBody() ([]byte, error) { + if c.Request.httpRequest.Body == nil { + return nil, errors.New("empty body") + } + + defer c.Request.httpRequest.Body.Close() + + data, err := io.ReadAll(c.Request.httpRequest.Body) + if err != nil { + return nil, err + } + + return data, nil +} + // get json body and bind to dest interface func (c *Context) GetRequesBodyStruct(dest interface{}) error { body := c.Request.httpRequest.Body