forked from goffee/core
Compare commits
No commits in common. "main" and "main" have entirely different histories.
3 changed files with 0 additions and 62 deletions
20
response.go
20
response.go
|
|
@ -9,13 +9,10 @@ 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
|
||||
|
|
@ -147,23 +144,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
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
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
{{ define "form_color_opacity"}}
|
||||
<div class="input-container">
|
||||
<script src="/public/jscolor.js"></script>
|
||||
<label class="form-label" for="{{.ColorID}}">{{.Label}}</label><br>
|
||||
<input id="{{ .ColorID }}" data-jscolor="{alphaElement:'#{{ .OpacityID }}'}" value="{{ .ColorHexValue }}" name="{{ .ColorID }}"
|
||||
{{if eq .IsDisabled true}}
|
||||
disabled
|
||||
{{end}}
|
||||
{{if eq .IsRequired true}}
|
||||
required
|
||||
{{end}}
|
||||
>
|
||||
{{if eq .HasOpacity true}}
|
||||
opacity: <input id="{{ .OpacityID }}" value="{{ .OpacityValue }}" name="{{ .OpacityID }}" size="5"
|
||||
{{if eq .IsDisabled true}}
|
||||
disabled
|
||||
{{end}}
|
||||
{{if eq .IsRequired true}}
|
||||
required
|
||||
{{end}}
|
||||
>
|
||||
{{if ne .Hint ""}}<small id="{{.ID}}Help" class="form-text text-muted">{{.Hint}}</small>{{end}}
|
||||
{{if ne .Error ""}}<div class="error">{{.Error}}</div>{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
<input type="text" id="name" name="name" placeholder class="form-control" required autocomplete="off" value="Plaza estrella" aria-describedby="nameHelp">
|
||||
Loading…
Add table
Add a link
Reference in a new issue