Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| e32d8e768e |
14 changed files with 1360 additions and 82 deletions
2
.env-dev
2
.env-dev
|
|
@ -14,8 +14,6 @@ App_HTTPS_HOSTS=example.com, www.example.com
|
|||
App_REDIRECT_HTTP_TO_HTTPS=false
|
||||
App_CERT_FILE_PATH=tls/server.crt
|
||||
App_KEY_FILE_PATH=tls/server.key
|
||||
LOG_STDOUT_ENABLE=true
|
||||
LOG_LEVEL=debug
|
||||
|
||||
#######################################
|
||||
###### TEMPLATES ######
|
||||
|
|
|
|||
52
controllers/queuesample.go
Normal file
52
controllers/queuesample.go
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2025 Zeni Kim <zenik@smarteching.com>
|
||||
// Use of this source code is governed by MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/goffee/core"
|
||||
"git.smarteching.com/goffee/cup/workers"
|
||||
"github.com/hibiken/asynq"
|
||||
)
|
||||
|
||||
// Make samples queues
|
||||
func Queuesample(c *core.Context) *core.Response {
|
||||
|
||||
// Get client queue asynq
|
||||
client := c.GetQueueClient()
|
||||
|
||||
// Create a task with typename and payload.
|
||||
payload, err := json.Marshal(workers.EmailTaskPayload{UserID: 42})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
t1 := asynq.NewTask(workers.TypeWelcomeEmail, payload)
|
||||
|
||||
t2 := asynq.NewTask(workers.TypeReminderEmail, payload)
|
||||
|
||||
// Process the task immediately.
|
||||
info, err := client.Enqueue(t1)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf(" [*] Successfully enqueued task: %+v", info)
|
||||
|
||||
// Process 2 task 1 min later.
|
||||
for i := 1; i < 3; i++ {
|
||||
info, err = client.Enqueue(t2, asynq.ProcessIn(1*time.Minute))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf(" [*] Successfully enqueued task: %+v", info)
|
||||
}
|
||||
|
||||
message := "{\"message\": \"Task queued\"}"
|
||||
return c.Response.Json(message)
|
||||
|
||||
}
|
||||
149
controllers/sample.go
Normal file
149
controllers/sample.go
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
|
||||
// Use of this source code is governed by MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.smarteching.com/goffee/core"
|
||||
"git.smarteching.com/goffee/core/template/components"
|
||||
"git.smarteching.com/goffee/cup/utils"
|
||||
)
|
||||
|
||||
// Show basic template
|
||||
func Sample(c *core.Context) *core.Response {
|
||||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
PageCard components.PageCard
|
||||
}
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
PageCard: components.PageCard{
|
||||
CardTitle: "Framework Goffee",
|
||||
CardBody: "Powered by Golang",
|
||||
},
|
||||
}
|
||||
|
||||
return c.Response.Template("basic.html", tmplData)
|
||||
|
||||
}
|
||||
|
||||
// Show basic app login
|
||||
func AppLogin(c *core.Context) *core.Response {
|
||||
|
||||
// first, include all compoments
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
PageCard components.PageCard
|
||||
}
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
PageCard: components.PageCard{
|
||||
CardTitle: "Card title",
|
||||
CardBody: "Loerm ipsum at deim",
|
||||
},
|
||||
}
|
||||
return c.Response.Template("login.html", tmplData)
|
||||
}
|
||||
|
||||
// Show basic app login
|
||||
func AppSession(c *core.Context) *core.Response {
|
||||
|
||||
var session = new(utils.SessionUser)
|
||||
|
||||
// true if session is active
|
||||
hassession := session.Init(c)
|
||||
|
||||
//session.Set("numberdos", 66)
|
||||
|
||||
type templateData struct {
|
||||
PageCard components.PageCard
|
||||
}
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{}
|
||||
|
||||
if hassession {
|
||||
|
||||
sesiondata := ""
|
||||
cardtitle := fmt.Sprintf("Session user id: %v", session.GetUserID())
|
||||
numberdos, ok := session.Get("numberdos")
|
||||
|
||||
if numberdos != nil {
|
||||
numberdos = numberdos.(float64) + 10
|
||||
} else {
|
||||
numberdos = 10
|
||||
}
|
||||
|
||||
session.Set("numberdos", numberdos)
|
||||
|
||||
if ok {
|
||||
sesiondata = fmt.Sprintf("OK, Session numberdos has %v", numberdos)
|
||||
} else {
|
||||
sesiondata = fmt.Sprintf("No ok, session numberdos has %v", numberdos)
|
||||
}
|
||||
|
||||
// delete single
|
||||
//session.Delete("numberdos")
|
||||
|
||||
// delete all data
|
||||
//session.Flush()
|
||||
|
||||
tmplData = templateData{
|
||||
PageCard: components.PageCard{
|
||||
CardTitle: cardtitle,
|
||||
CardBody: sesiondata,
|
||||
},
|
||||
}
|
||||
|
||||
return c.Response.Template("appsession.html", tmplData)
|
||||
|
||||
} else {
|
||||
|
||||
return c.Response.Template("login.html", tmplData)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Show basic app sample
|
||||
func AppSample(c *core.Context) *core.Response {
|
||||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
PageCard components.PageCard
|
||||
ContentDropdown components.ContentDropdown
|
||||
}
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
PageCard: components.PageCard{
|
||||
CardTitle: "Protected page",
|
||||
CardBody: "If you can see this page, your are loggedin",
|
||||
},
|
||||
ContentDropdown: components.ContentDropdown{
|
||||
Label: "dropdown",
|
||||
Items: []components.ContentDropdownItem{
|
||||
{
|
||||
Text: "Signout",
|
||||
Link: "#",
|
||||
ID: "signout",
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
//fmt.Printf("Outside cookie user is: %s", user.Email)
|
||||
|
||||
return c.Response.Template("app.html", tmplData)
|
||||
|
||||
}
|
||||
863
controllers/themedemo.go
Normal file
863
controllers/themedemo.go
Normal file
|
|
@ -0,0 +1,863 @@
|
|||
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
|
||||
// Use of this source code is governed by MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand/v2"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"git.smarteching.com/goffee/core"
|
||||
"git.smarteching.com/goffee/core/template/components"
|
||||
)
|
||||
|
||||
// Show home page
|
||||
func Themedemo(c *core.Context) *core.Response {
|
||||
|
||||
// check if template engine is enabled
|
||||
TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE")
|
||||
if TemplateEnableStr == "" {
|
||||
TemplateEnableStr = "false"
|
||||
}
|
||||
TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr)
|
||||
|
||||
if TemplateEnable {
|
||||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
PageCard components.PageCard
|
||||
}
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
PageCard: components.PageCard{
|
||||
CardTitle: "Card title",
|
||||
CardBody: "Loerm ipsum at deim",
|
||||
},
|
||||
}
|
||||
|
||||
return c.Response.Template("custom_theme_base.html", tmplData)
|
||||
|
||||
} else {
|
||||
|
||||
message := "{\"message\": \"Error, template not enabled\"}"
|
||||
return c.Response.Json(message)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Show form element page
|
||||
func Themeform(c *core.Context) *core.Response {
|
||||
|
||||
// check if template engine is enabled
|
||||
TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE")
|
||||
if TemplateEnableStr == "" {
|
||||
TemplateEnableStr = "false"
|
||||
}
|
||||
TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr)
|
||||
|
||||
if TemplateEnable {
|
||||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
FormText components.FormInput
|
||||
FormEmail components.FormInput
|
||||
FormButton components.FormButton
|
||||
FormSelectCity components.FormSelect
|
||||
FormTextarea components.FormTextarea
|
||||
FormRadio components.FormRadio
|
||||
FormCheckbox components.FormCheckbox
|
||||
}
|
||||
|
||||
// for select options
|
||||
var allOptions []components.FormSelectOption
|
||||
var option components.FormSelectOption
|
||||
option.Value = "ch"
|
||||
option.Caption = "China"
|
||||
allOptions = append(allOptions, option)
|
||||
option.Value = "ba"
|
||||
option.Caption = "Buenos Aires"
|
||||
allOptions = append(allOptions, option)
|
||||
option.Value = "fr"
|
||||
option.Caption = "France"
|
||||
selectedOption := option
|
||||
allOptions = append(allOptions, option)
|
||||
|
||||
// for radio options
|
||||
var allOptionsr []components.FormRadioItem
|
||||
var optionr components.FormRadioItem
|
||||
optionr.ID = "citysch"
|
||||
optionr.Name = "citys"
|
||||
optionr.Value = "china"
|
||||
optionr.Label = "China"
|
||||
allOptionsr = append(allOptionsr, optionr)
|
||||
optionr.ID = "citysba"
|
||||
optionr.Name = "citys"
|
||||
optionr.Value = "buenosaires"
|
||||
optionr.Label = "Buenos Aires"
|
||||
//optionr.IsDisabled = true
|
||||
allOptionsr = append(allOptionsr, optionr)
|
||||
|
||||
// for radio options
|
||||
var allOptionsc []components.FormCheckboxItem
|
||||
var optionc components.FormCheckboxItem
|
||||
optionc.ID = "citysch"
|
||||
optionc.Name = "citys"
|
||||
optionc.Value = "china"
|
||||
optionc.Label = "China"
|
||||
allOptionsc = append(allOptionsc, optionc)
|
||||
optionc.ID = "citysba"
|
||||
optionc.Name = "citys"
|
||||
optionc.Value = "buenosaires"
|
||||
optionc.Label = "Buenos Aires"
|
||||
allOptionsc = append(allOptionsc, optionc)
|
||||
optionc.ID = "london"
|
||||
optionc.Name = "london"
|
||||
optionc.Value = "london"
|
||||
optionc.Label = "London"
|
||||
//optionc.IsChecked = true
|
||||
allOptionsc = append(allOptionsc, optionc)
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
FormText: components.FormInput{
|
||||
ID: "text",
|
||||
Label: "Name",
|
||||
Type: "text",
|
||||
Hint: "This is sample hint",
|
||||
Placeholder: "Enter your name",
|
||||
},
|
||||
FormEmail: components.FormInput{
|
||||
ID: "email",
|
||||
Label: "Email",
|
||||
Type: "email",
|
||||
IsRequired: true,
|
||||
Placeholder: "Enter your email address",
|
||||
},
|
||||
FormButton: components.FormButton{
|
||||
Text: "Login",
|
||||
IsSubmit: true,
|
||||
TypeClass: "primary",
|
||||
},
|
||||
FormSelectCity: components.FormSelect{
|
||||
ID: "city",
|
||||
Label: "Select city",
|
||||
AllOptions: allOptions,
|
||||
SelectedOption: selectedOption,
|
||||
},
|
||||
FormTextarea: components.FormTextarea{
|
||||
ID: "text",
|
||||
Label: "Example textarea",
|
||||
},
|
||||
FormRadio: components.FormRadio{
|
||||
Label: "Radio buttons",
|
||||
AllRadios: allOptionsr,
|
||||
},
|
||||
FormCheckbox: components.FormCheckbox{
|
||||
Label: "Checkbox options",
|
||||
AllCheckbox: allOptionsc,
|
||||
},
|
||||
}
|
||||
return c.Response.Template("custom_theme_formpage.html", tmplData)
|
||||
|
||||
} else {
|
||||
|
||||
message := "{\"message\": \"Error, template not enabled\"}"
|
||||
return c.Response.Json(message)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func ThemeElements(c *core.Context) *core.Response {
|
||||
// check if template engine is enabled
|
||||
TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE")
|
||||
if TemplateEnableStr == "" {
|
||||
TemplateEnableStr = "false"
|
||||
}
|
||||
TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr)
|
||||
|
||||
if TemplateEnable {
|
||||
type templateData struct {
|
||||
Buttons []components.FormButton
|
||||
Hrefs []components.ContentHref
|
||||
Badges []components.ContentBadge
|
||||
Dropdowns []components.ContentDropdown
|
||||
Lists []components.ContentList
|
||||
Menus []components.PageNav
|
||||
}
|
||||
buttons := []components.FormButton{
|
||||
{
|
||||
Text: "primary",
|
||||
TypeClass: "primary",
|
||||
},
|
||||
{
|
||||
Text: "secondary",
|
||||
TypeClass: "secondary",
|
||||
},
|
||||
{
|
||||
Text: "success",
|
||||
TypeClass: "success",
|
||||
},
|
||||
{
|
||||
Text: "danger",
|
||||
TypeClass: "danger",
|
||||
},
|
||||
{
|
||||
Text: "warning",
|
||||
TypeClass: "warning",
|
||||
},
|
||||
{
|
||||
Text: "info",
|
||||
TypeClass: "info",
|
||||
},
|
||||
{
|
||||
Text: "light",
|
||||
TypeClass: "light",
|
||||
},
|
||||
{
|
||||
Text: "dark",
|
||||
TypeClass: "dark",
|
||||
},
|
||||
{
|
||||
Text: "link",
|
||||
TypeClass: "link",
|
||||
},
|
||||
{
|
||||
Text: "disabled",
|
||||
TypeClass: "primary",
|
||||
IsDisabled: true,
|
||||
},
|
||||
{
|
||||
Text: "outline-primary",
|
||||
TypeClass: "outline-primary",
|
||||
},
|
||||
{
|
||||
Text: "outline-secondary",
|
||||
TypeClass: "outline-secondary",
|
||||
},
|
||||
{
|
||||
Text: "outline-success",
|
||||
TypeClass: "outline-success",
|
||||
},
|
||||
{
|
||||
Text: "outline-danger",
|
||||
TypeClass: "outline-danger",
|
||||
},
|
||||
{
|
||||
Text: "outline-warning",
|
||||
TypeClass: "outline-warning",
|
||||
},
|
||||
{
|
||||
Text: "outline-info",
|
||||
TypeClass: "outline-info",
|
||||
},
|
||||
{
|
||||
Text: "outline-light",
|
||||
TypeClass: "outline-light",
|
||||
},
|
||||
{
|
||||
Text: "outline-dark",
|
||||
TypeClass: "outline-dark",
|
||||
},
|
||||
}
|
||||
hrefs := []components.ContentHref{
|
||||
{
|
||||
Text: "href",
|
||||
Link: "#",
|
||||
IsButton: false,
|
||||
},
|
||||
{
|
||||
Text: "link",
|
||||
Link: "#",
|
||||
IsButton: false,
|
||||
TypeClass: "link",
|
||||
},
|
||||
{
|
||||
Text: "button",
|
||||
Link: "#",
|
||||
IsButton: true,
|
||||
TypeClass: "primary",
|
||||
},
|
||||
{
|
||||
Text: "href disabled",
|
||||
Link: "#",
|
||||
IsButton: false,
|
||||
IsDisabled: true,
|
||||
},
|
||||
{
|
||||
Text: "link disabled",
|
||||
Link: "#",
|
||||
TypeClass: "link",
|
||||
IsDisabled: true,
|
||||
},
|
||||
{
|
||||
Text: "button disabled",
|
||||
Link: "#",
|
||||
IsButton: true,
|
||||
TypeClass: "primary",
|
||||
IsDisabled: true,
|
||||
},
|
||||
}
|
||||
badges := []components.ContentBadge{
|
||||
{
|
||||
Text: "primary",
|
||||
TypeClass: "primary",
|
||||
},
|
||||
{
|
||||
Text: "secondary",
|
||||
TypeClass: "secondary",
|
||||
},
|
||||
{
|
||||
Text: "success",
|
||||
TypeClass: "success",
|
||||
},
|
||||
{
|
||||
Text: "danger",
|
||||
TypeClass: "danger",
|
||||
},
|
||||
{
|
||||
Text: "warning",
|
||||
TypeClass: "warning",
|
||||
},
|
||||
{
|
||||
Text: "info",
|
||||
TypeClass: "info",
|
||||
},
|
||||
{
|
||||
Text: "light",
|
||||
TypeClass: "light",
|
||||
},
|
||||
{
|
||||
Text: "dark",
|
||||
TypeClass: "dark",
|
||||
},
|
||||
{
|
||||
Text: "outline",
|
||||
TypeClass: "primary",
|
||||
IsOutline: true,
|
||||
},
|
||||
{
|
||||
Text: "outline",
|
||||
TypeClass: "success",
|
||||
IsOutline: true,
|
||||
},
|
||||
{
|
||||
Text: "outline",
|
||||
TypeClass: "danger",
|
||||
IsOutline: true,
|
||||
},
|
||||
{
|
||||
Text: "outline",
|
||||
TypeClass: "warning",
|
||||
IsOutline: true,
|
||||
},
|
||||
}
|
||||
dropdowns := []components.ContentDropdown{
|
||||
// dropdown
|
||||
{
|
||||
Label: "dropdown",
|
||||
Items: []components.ContentDropdownItem{
|
||||
{
|
||||
Text: "item ",
|
||||
Link: "#",
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// dropdown
|
||||
{
|
||||
Label: "primary",
|
||||
TypeClass: "primary",
|
||||
Items: []components.ContentDropdownItem{
|
||||
{
|
||||
Text: "item ",
|
||||
Link: "#",
|
||||
},
|
||||
{
|
||||
Text: "item ",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// dropdown
|
||||
{
|
||||
Label: "outline",
|
||||
TypeClass: "outline-primary",
|
||||
Items: []components.ContentDropdownItem{
|
||||
{
|
||||
Text: "item ",
|
||||
Link: "#",
|
||||
},
|
||||
},
|
||||
},
|
||||
// dropdown
|
||||
{
|
||||
Label: "disabled",
|
||||
TypeClass: "primary",
|
||||
IsDisabled: true,
|
||||
// items
|
||||
},
|
||||
}
|
||||
list := []components.ContentList{
|
||||
// basic list
|
||||
{
|
||||
Items: []components.ContentListItem{
|
||||
{
|
||||
Text: "item 1",
|
||||
},
|
||||
{
|
||||
Text: "item 2",
|
||||
EndElement: "end text",
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// description list
|
||||
{
|
||||
Items: []components.ContentListItem{
|
||||
{
|
||||
Text: "item 1",
|
||||
Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. ",
|
||||
},
|
||||
{
|
||||
Text: "item 2",
|
||||
Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// list with class
|
||||
{
|
||||
Items: []components.ContentListItem{
|
||||
{
|
||||
Text: "class primary",
|
||||
TypeClass: "primary",
|
||||
},
|
||||
{
|
||||
Text: "class success",
|
||||
TypeClass: "success",
|
||||
},
|
||||
{
|
||||
Text: "class danger",
|
||||
TypeClass: "danger",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
menus := []components.PageNav{
|
||||
// nav
|
||||
{
|
||||
NavClass: "nav-pills",
|
||||
NavItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "item active",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
ChildItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "item ",
|
||||
Link: "#",
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// nav
|
||||
{
|
||||
NavClass: "",
|
||||
NavItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "item active",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// nav underline
|
||||
{
|
||||
NavClass: "nav-underline",
|
||||
NavItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "item active",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// nav tabs
|
||||
{
|
||||
NavClass: "",
|
||||
IsTab: true,
|
||||
NavItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "tab active",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "tab",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "tab",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "tab disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// nav vertical
|
||||
{
|
||||
NavClass: "",
|
||||
IsVertical: true,
|
||||
NavItems: []components.PageNavItem{
|
||||
{
|
||||
Text: "item active",
|
||||
Link: "#",
|
||||
IsActive: true,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item",
|
||||
Link: "#",
|
||||
IsActive: false,
|
||||
},
|
||||
{
|
||||
Text: "item disabled",
|
||||
Link: "#",
|
||||
IsDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
tmplData := templateData{
|
||||
Buttons: buttons,
|
||||
Hrefs: hrefs,
|
||||
Badges: badges,
|
||||
Dropdowns: dropdowns,
|
||||
Lists: list,
|
||||
Menus: menus,
|
||||
}
|
||||
return c.Response.Template("custom_theme_elements.html", tmplData)
|
||||
|
||||
} else {
|
||||
|
||||
message := "{\"message\": \"Error, template not enabled\"}"
|
||||
return c.Response.Json(message)
|
||||
}
|
||||
}
|
||||
|
||||
// Show form element page
|
||||
func Themecontent(c *core.Context) *core.Response {
|
||||
|
||||
// check if template engine is enabled
|
||||
TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE")
|
||||
if TemplateEnableStr == "" {
|
||||
TemplateEnableStr = "false"
|
||||
}
|
||||
TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr)
|
||||
|
||||
if TemplateEnable {
|
||||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
ContentTable components.ContentTable
|
||||
ContentTabledetail components.ContentTabledetail
|
||||
ContentGraph components.ContentGraph
|
||||
FieldText components.FormInput
|
||||
FormSelectCityM components.FormSelect
|
||||
Pagination components.ContentPagination
|
||||
ShouldShowPagination bool
|
||||
}
|
||||
|
||||
// for select options
|
||||
var allOptions []components.FormSelectOption
|
||||
var option components.FormSelectOption
|
||||
option.Value = "ch"
|
||||
option.Caption = "China"
|
||||
allOptions = append(allOptions, option)
|
||||
option.Value = "ba"
|
||||
option.Caption = "Buenos Aires"
|
||||
allOptions = append(allOptions, option)
|
||||
option.Value = "fr"
|
||||
option.Caption = "France"
|
||||
selectedOption := option
|
||||
allOptions = append(allOptions, option)
|
||||
option.Value = "kr"
|
||||
option.Caption = "Korea"
|
||||
allOptions = append(allOptions, option)
|
||||
|
||||
// for custom attributes in form
|
||||
var customAtt []components.CustomAtt
|
||||
var attribute components.CustomAtt
|
||||
attribute.AttName = "code"
|
||||
attribute.AttValue = "five"
|
||||
customAtt = append(customAtt, attribute)
|
||||
attribute.AttName = "mytag"
|
||||
attribute.AttValue = "My value"
|
||||
customAtt = append(customAtt, attribute)
|
||||
|
||||
// TABLES
|
||||
// for th head
|
||||
var allTh []components.ContentTableTH
|
||||
var th components.ContentTableTH
|
||||
th.Value = "Column heading 1"
|
||||
allTh = append(allTh, th)
|
||||
th.Value = "Column heading 2"
|
||||
allTh = append(allTh, th)
|
||||
th.ID = "ba"
|
||||
th.Value = "Column heading 3"
|
||||
allTh = append(allTh, th)
|
||||
th.Value = "Column badge"
|
||||
th.ValueType = "badge" // column type badge
|
||||
allTh = append(allTh, th)
|
||||
th.Value = "Column action"
|
||||
th.ValueType = "href" // column type href
|
||||
allTh = append(allTh, th)
|
||||
|
||||
// for td items
|
||||
var allTd [][]components.ContentTableTD
|
||||
//var vals []components.ContentTableTD
|
||||
// rows
|
||||
for i := 1; i <= 28; i++ {
|
||||
vals := make([]components.ContentTableTD, len(allTh))
|
||||
for b := 0; b < len(allTh)-2; b++ {
|
||||
vals[b].Value = fmt.Sprintf("%s%d%d", "TD data: ", i, b)
|
||||
vals[b].ID = fmt.Sprintf("%s%d%d", "idtd_", i, b)
|
||||
}
|
||||
// column badge
|
||||
vals[len(allTh)-2].Value = components.ContentBadge{
|
||||
Text: "success",
|
||||
TypeClass: "success",
|
||||
}
|
||||
// last column href
|
||||
vals[len(allTh)-1].Value = components.ContentHref{
|
||||
Text: "edit",
|
||||
Link: "#",
|
||||
}
|
||||
allTd = append(allTd, vals)
|
||||
}
|
||||
|
||||
// Pagination demo
|
||||
// start config
|
||||
limit := 10
|
||||
shouldShowPagination := false
|
||||
pageViewTableOffset := 0
|
||||
// Get the length of AllOptions
|
||||
totalrecords := len(allTd)
|
||||
// get current table offset
|
||||
tpage := c.RequestParamExists("tpage")
|
||||
if tpage {
|
||||
pageViewTableOffset, _ = strconv.Atoi(c.GetRequestParam("tpage").(string))
|
||||
}
|
||||
|
||||
// start default option paginator
|
||||
var pagination components.ContentPagination
|
||||
pagination.PageStartRecord = pageViewTableOffset + 1
|
||||
pagination.PageEndRecord = 0
|
||||
pagination.TotalRecords = 0
|
||||
pagination.PrevLink = ""
|
||||
pagination.NextLink = ""
|
||||
|
||||
// check current page
|
||||
// fake function to emulate a query offset
|
||||
newTd := getPaginatedPageViews(allTd, limit, pageViewTableOffset)
|
||||
|
||||
if len(newTd) > 0 {
|
||||
pagination.TotalRecords = totalrecords
|
||||
pagination.PageStartRecord = pageViewTableOffset + 1
|
||||
pagination.PageEndRecord = pageViewTableOffset + len(newTd)
|
||||
shouldShowPagination = totalrecords > limit
|
||||
}
|
||||
|
||||
if shouldShowPagination && pageViewTableOffset != 0 {
|
||||
pagination.PrevLink = fmt.Sprintf("/themecontent?tpage=%d", pageViewTableOffset-limit)
|
||||
}
|
||||
|
||||
if shouldShowPagination && pageViewTableOffset+limit < totalrecords {
|
||||
pagination.NextLink = fmt.Sprintf("/themecontent?tpage=%d", pageViewTableOffset+limit)
|
||||
}
|
||||
|
||||
// for td items in table detail
|
||||
var allTdetail []components.ContentTabledetailTD
|
||||
// table detail
|
||||
var thd components.ContentTabledetailTD
|
||||
thd.Caption = "Continent"
|
||||
thd.Value = "Asia"
|
||||
allTdetail = append(allTdetail, thd)
|
||||
thd.Caption = "Country"
|
||||
thd.Value = "South Korea"
|
||||
allTdetail = append(allTdetail, thd)
|
||||
thd.Caption = "Capital"
|
||||
thd.Value = "Seoul"
|
||||
allTdetail = append(allTdetail, thd)
|
||||
thd.Caption = "Details"
|
||||
thd.ValueType = "href" // column type href
|
||||
thd.Value = components.ContentHref{
|
||||
Text: "edit",
|
||||
Link: "#",
|
||||
}
|
||||
allTdetail = append(allTdetail, thd)
|
||||
thd.Caption = "Notifications"
|
||||
thd.ValueType = "badge" // column type href
|
||||
thd.Value = components.ContentBadge{
|
||||
Text: "success",
|
||||
TypeClass: "success",
|
||||
}
|
||||
allTdetail = append(allTdetail, thd)
|
||||
|
||||
// random values for pie
|
||||
one := rand.IntN(50)
|
||||
two := rand.IntN(50)
|
||||
three := rand.IntN(50)
|
||||
valuesgraph := fmt.Sprintf("%d|%d|%d", one, two, three)
|
||||
|
||||
// now fill data of the components
|
||||
tmplData := templateData{
|
||||
FormSelectCityM: components.FormSelect{
|
||||
ID: "city",
|
||||
Label: "Select city",
|
||||
AllOptions: allOptions,
|
||||
SelectedOption: selectedOption,
|
||||
IsMultiple: true,
|
||||
},
|
||||
FieldText: components.FormInput{
|
||||
ID: "text",
|
||||
Label: "Name",
|
||||
Type: "text",
|
||||
Hint: "This is sample hint",
|
||||
Placeholder: "Enter your name",
|
||||
CustomAtt: customAtt,
|
||||
},
|
||||
ContentTable: components.ContentTable{
|
||||
ID: "table_demo",
|
||||
AllTH: allTh,
|
||||
AllTD: newTd,
|
||||
},
|
||||
ContentTabledetail: components.ContentTabledetail{
|
||||
ID: "table_demodetail",
|
||||
Title: "Sample table detail",
|
||||
HeadClass: "table-warning",
|
||||
AllTD: allTdetail,
|
||||
},
|
||||
ContentGraph: components.ContentGraph{
|
||||
Graph: "pie",
|
||||
Labels: "Berlin|Paris|Venecia",
|
||||
Values: valuesgraph,
|
||||
},
|
||||
Pagination: pagination,
|
||||
ShouldShowPagination: shouldShowPagination,
|
||||
}
|
||||
|
||||
return c.Response.Template("custom_theme_contentpage.html", tmplData)
|
||||
|
||||
} else {
|
||||
|
||||
message := "{\"message\": \"Error, template not enabled\"}"
|
||||
return c.Response.Json(message)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func getPaginatedPageViews(values [][]components.ContentTableTD, limit int, offset int) [][]components.ContentTableTD {
|
||||
|
||||
// Validate the offset and adjust if necessary
|
||||
if offset < 0 {
|
||||
offset = 0 // Ensure offset is not negative
|
||||
} else if offset >= len(values) {
|
||||
var emptytd [][]components.ContentTableTD
|
||||
return emptytd
|
||||
}
|
||||
|
||||
// Calculate the end index (limit the slice to the size of the array)
|
||||
end := offset + limit
|
||||
if end > len(values) {
|
||||
end = len(values) // Ensure end doesn't exceed the length of the array
|
||||
}
|
||||
|
||||
return values[offset:end] // Slice the array
|
||||
|
||||
}
|
||||
47
go.mod
47
go.mod
|
|
@ -7,58 +7,57 @@ replace (
|
|||
git.smarteching.com/goffee/cup/models => ./models
|
||||
)
|
||||
|
||||
go 1.25.0
|
||||
go 1.24.1
|
||||
|
||||
require (
|
||||
git.smarteching.com/goffee/core v1.9.6
|
||||
git.smarteching.com/goffee/core v1.9.5
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/hibiken/asynq v0.26.0
|
||||
github.com/hibiken/asynq v0.25.1
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/julienschmidt/httprouter v1.3.0
|
||||
gorm.io/gorm v1.31.1
|
||||
gorm.io/gorm v1.30.0
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.2.0 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
git.smarteching.com/zeni/go-chart/v2 v2.1.4 // indirect
|
||||
git.smarteching.com/zeni/go-charts/v2 v2.6.11 // indirect
|
||||
github.com/SparkPost/gosparkpost v0.2.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/go-chi/chi/v5 v5.2.5 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/go-chi/chi/v5 v5.2.2 // indirect
|
||||
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible // indirect
|
||||
github.com/go-sql-driver/mysql v1.10.0 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
|
||||
github.com/go-sql-driver/mysql v1.9.3 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.3 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/harranali/mailing v1.2.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgx/v5 v5.9.2 // indirect
|
||||
github.com/jackc/pgx/v5 v5.7.5 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailgun/errors v0.5.0 // indirect
|
||||
github.com/mailgun/errors v0.4.0 // indirect
|
||||
github.com/mailgun/mailgun-go/v4 v4.23.0 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.44 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/redis/go-redis/v9 v9.19.0 // indirect
|
||||
github.com/redis/go-redis/v9 v9.11.0 // indirect
|
||||
github.com/robfig/cron/v3 v3.0.1 // indirect
|
||||
github.com/sendgrid/rest v2.6.9+incompatible // indirect
|
||||
github.com/sendgrid/sendgrid-go v3.16.1+incompatible // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.50.0 // indirect
|
||||
golang.org/x/image v0.39.0 // indirect
|
||||
golang.org/x/net v0.53.0 // indirect
|
||||
golang.org/x/sync v0.20.0 // indirect
|
||||
golang.org/x/sys v0.43.0 // indirect
|
||||
golang.org/x/text v0.36.0 // indirect
|
||||
golang.org/x/time v0.15.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/spf13/cast v1.9.2 // indirect
|
||||
golang.org/x/crypto v0.40.0 // indirect
|
||||
golang.org/x/image v0.29.0 // indirect
|
||||
golang.org/x/net v0.42.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
golang.org/x/text v0.27.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gorm.io/driver/mysql v1.6.0 // indirect
|
||||
gorm.io/driver/postgres v1.6.0 // indirect
|
||||
gorm.io/driver/sqlite v1.6.0 // indirect
|
||||
|
|
|
|||
145
go.sum
145
go.sum
|
|
@ -1,11 +1,11 @@
|
|||
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
|
||||
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
|
||||
git.smarteching.com/goffee/core v1.9.6 h1:GY1EXqbmBEWZAVrl3q22Izb6aXhQzFVQBv2hWhK/So8=
|
||||
git.smarteching.com/goffee/core v1.9.6/go.mod h1:ifiBgTOR4zCMzdGsabNrEO792EHny2o149NGe3TSlms=
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
git.smarteching.com/goffee/core v1.9.2 h1:SpLAhsTxssPItgkBYLN3UxMH5s+q8qVtbvmRom3WKh8=
|
||||
git.smarteching.com/goffee/core v1.9.2/go.mod h1:L9a+kL1RVHRHzp+DzCS1apwVLyZAvGE6B94UlyIMhIg=
|
||||
git.smarteching.com/goffee/core v1.9.5 h1:rq6vI4WSUMGQNzJvhNWmtY2ycC7UszEvXpQ7uUR8sZY=
|
||||
git.smarteching.com/goffee/core v1.9.5/go.mod h1:ifiBgTOR4zCMzdGsabNrEO792EHny2o149NGe3TSlms=
|
||||
git.smarteching.com/zeni/go-chart/v2 v2.1.4 h1:pF06+F6eqJLIG8uMiTVPR5TygPGMjM/FHMzTxmu5V/Q=
|
||||
git.smarteching.com/zeni/go-chart/v2 v2.1.4/go.mod h1:b3ueW9h3pGGXyhkormZAvilHaG4+mQti+bMNPdQBeOQ=
|
||||
git.smarteching.com/zeni/go-charts/v2 v2.6.11 h1:9udzlv3uxGXszpplfkL5IaTUrgkNj++KwhbaN1vVEqI=
|
||||
git.smarteching.com/zeni/go-charts/v2 v2.6.11/go.mod h1:3OpRPSXg7Qx4zcgsmwsC9ZFB9/wAkGSbnXf1wIbHYCg=
|
||||
github.com/SparkPost/gosparkpost v0.2.0 h1:yzhHQT7cE+rqzd5tANNC74j+2x3lrPznqPJrxC1yR8s=
|
||||
github.com/SparkPost/gosparkpost v0.2.0/go.mod h1:S9WKcGeou7cbPpx0kTIgo8Q69WZvUmVeVzbD+djalJ4=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
|
|
@ -23,37 +23,46 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
|
||||
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
|
||||
github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
|
||||
github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
||||
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
|
||||
github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
||||
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible h1:msy24VGS42fKO9K1vLz82/GeYW1cILu7Nuuj1N3BBkE=
|
||||
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU=
|
||||
github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw=
|
||||
github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
|
||||
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
|
||||
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
|
||||
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.3/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/harranali/mailing v1.2.0 h1:ihIyJwB8hyRVcdk+v465wk1PHMrSrgJqo/kMd+gZClY=
|
||||
github.com/harranali/mailing v1.2.0/go.mod h1:4a5N3yG98pZKluMpmcYlTtll7bisvOfGQEMIng3VQk4=
|
||||
github.com/hibiken/asynq v0.26.0 h1:1Zxr92MlDnb1Zt/QR5g2vSCqUS03i95lUfqx5X7/wrw=
|
||||
github.com/hibiken/asynq v0.26.0/go.mod h1:Qk4e57bTnWDoyJ67VkchuV6VzSM9IQW2nPvAGuDyw58=
|
||||
github.com/hibiken/asynq v0.25.1 h1:phj028N0nm15n8O2ims+IvJ2gz4k2auvermngh9JhTw=
|
||||
github.com/hibiken/asynq v0.25.1/go.mod h1:pazWNOLBu0FEynQRBvHA26qdIKRSmfdIfUm4HdsLmXg=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||
github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw=
|
||||
github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
|
||||
github.com/jackc/pgx/v5 v5.7.2 h1:mLoDLV6sonKlvjIEsV56SkWNCnuNv531l94GaIzO+XI=
|
||||
github.com/jackc/pgx/v5 v5.7.2/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=
|
||||
github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=
|
||||
github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
|
||||
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
|
||||
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||
github.com/jaytaylor/html2text v0.0.0-20190408195923-01ec452cbe43/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk=
|
||||
|
|
@ -68,21 +77,21 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
|
|||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/mailgun/errors v0.5.0 h1:pLQo8uhAdORsjN69mGixSr0pGs46z/BW/FQXd8HG1VM=
|
||||
github.com/mailgun/errors v0.5.0/go.mod h1:+2nrgY77E0vDkG4ErehpcpbSkMLkseJzKbrva89WeSs=
|
||||
github.com/mailgun/errors v0.4.0 h1:6LFBvod6VIW83CMIOT9sYNp28TCX0NejFPP4dSX++i8=
|
||||
github.com/mailgun/errors v0.4.0/go.mod h1:xGBaaKdEdQT0/FhwvoXv4oBaqqmVZz9P1XEnvD/onc0=
|
||||
github.com/mailgun/mailgun-go/v4 v4.23.0 h1:jPEMJzzin2s7lvehcfv/0UkyBu18GvcURPr2+xtZRbk=
|
||||
github.com/mailgun/mailgun-go/v4 v4.23.0/go.mod h1:imTtizoFtpfZqPqGP8vltVBB6q9yWcv6llBhfFeElZU=
|
||||
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-sqlite3 v1.14.44 h1:3VSe+xafpbzsLbdr2AWlAZk9yRHiBhTBakioXaCKTF8=
|
||||
github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ=
|
||||
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
|
||||
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
|
||||
github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
|
|
@ -94,8 +103,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
|||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/redis/go-redis/v9 v9.19.0 h1:XPVaaPSnG6RhYf7p+rmSa9zZfeVAnWsH5h3lxthOm/k=
|
||||
github.com/redis/go-redis/v9 v9.19.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA=
|
||||
github.com/redis/go-redis/v9 v9.7.1 h1:4LhKRCIduqXqtvCUlaq9c8bdHOkICjDMrr1+Zb3osAc=
|
||||
github.com/redis/go-redis/v9 v9.7.1/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
||||
github.com/redis/go-redis/v9 v9.11.0 h1:E3S08Gl/nJNn5vkxd2i78wZxWAPNZgUNTp8WIJUAiIs=
|
||||
github.com/redis/go-redis/v9 v9.11.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
|
|
@ -103,55 +114,81 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
|
|||
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
|
||||
github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekueiEMJ7NEoxJo0=
|
||||
github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE=
|
||||
github.com/sendgrid/sendgrid-go v3.16.0+incompatible h1:i8eE6IMkiCy7vusSdacHHSBUpXyTcTXy/Rl9N9aZ/Qw=
|
||||
github.com/sendgrid/sendgrid-go v3.16.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
|
||||
github.com/sendgrid/sendgrid-go v3.16.1+incompatible h1:zWhTmB0Y8XCDzeWIm2/BIt1GjJohAA0p6hVEaDtHWWs=
|
||||
github.com/sendgrid/sendgrid-go v3.16.1+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
|
||||
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
||||
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
|
||||
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
|
||||
github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
|
||||
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
|
||||
golang.org/x/image v0.39.0 h1:skVYidAEVKgn8lZ602XO75asgXBgLj9G/FE3RbuPFww=
|
||||
golang.org/x/image v0.39.0/go.mod h1:sIbmppfU+xFLPIG0FoVUTvyBMmgng1/XAMhQ2ft0hpA=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
||||
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
||||
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
|
||||
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
|
||||
golang.org/x/image v0.29.0 h1:HcdsyR4Gsuys/Axh0rDEmlBmB68rW1U9BUdB3UVHsas=
|
||||
golang.org/x/image v0.29.0/go.mod h1:RVJROnf3SLK8d26OW91j4FrIHGbsJ8QnbEocVTOWQDA=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
|
||||
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
|
||||
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
|
||||
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
|
||||
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
|
||||
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
|
||||
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
|
||||
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
||||
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
|
||||
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
|
||||
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
|
||||
gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
|
||||
gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg=
|
||||
gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo=
|
||||
gorm.io/driver/postgres v1.5.11 h1:ubBVAfbKEUld/twyKZ0IYn9rSQh448EdelLYk9Mv314=
|
||||
gorm.io/driver/postgres v1.5.11/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI=
|
||||
gorm.io/driver/postgres v1.6.0 h1:2dxzU8xJ+ivvqTRph34QX+WrRaJlmfyPqXmoGVjMBa4=
|
||||
gorm.io/driver/postgres v1.6.0/go.mod h1:vUw0mrGgrTK+uPHEhAdV4sfFELrByKVGnaVRkXDhtWo=
|
||||
gorm.io/driver/sqlite v1.5.7 h1:8NvsrhP0ifM7LX9G4zPB97NwovUakUxc+2V2uuf3Z1I=
|
||||
gorm.io/driver/sqlite v1.5.7/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4=
|
||||
gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
|
||||
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
||||
gorm.io/gorm v1.31.1 h1:7CA8FTFz/gRfgqgpeKIBcervUn3xSyPUmr6B2WXJ7kg=
|
||||
gorm.io/gorm v1.31.1/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
|
||||
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
|
||||
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
|
||||
gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs=
|
||||
gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
||||
|
|
|
|||
26
routes.go
26
routes.go
|
|
@ -8,6 +8,7 @@ package main
|
|||
import (
|
||||
"git.smarteching.com/goffee/core"
|
||||
"git.smarteching.com/goffee/cup/controllers"
|
||||
"git.smarteching.com/goffee/cup/hooks"
|
||||
)
|
||||
|
||||
// Register the app controllers
|
||||
|
|
@ -19,8 +20,15 @@ func registerRoutes() {
|
|||
|
||||
// Define your routes here...
|
||||
controller.Get("/", controllers.WelcomeHome)
|
||||
|
||||
// Uncomment the lines below to enable authentication API
|
||||
// Uncomment the lines below to enable theme demo
|
||||
controller.Get("/themebase", controllers.Themedemo)
|
||||
controller.Get("/themeform", controllers.Themeform)
|
||||
controller.Get("/themecontent", controllers.Themecontent)
|
||||
controller.Get("/themepanel", controllers.Themedemo)
|
||||
controller.Get("/themeelements", controllers.ThemeElements)
|
||||
controller.Get("/queuesample", controllers.Queuesample)
|
||||
|
||||
// Uncomment the lines below to enable authentication
|
||||
controller.Post("/signup", controllers.Signup)
|
||||
controller.Post("/signin", controllers.Signin)
|
||||
controller.Post("/signout", controllers.Signout)
|
||||
|
|
@ -36,6 +44,20 @@ func registerRoutes() {
|
|||
controller.Post("/admin/users/edit/:id", controllers.AdminUsersEdit)
|
||||
controller.Post("/admin/users/delete", controllers.AdminUsersDelete)
|
||||
controller.Post("/admin/users/deleteconfirm", controllers.AdminUsersDelConfirm)
|
||||
//controller.Get("/admin/users/roles", controllers.Signout)
|
||||
//controller.Get("/admin/users/permissions", controllers.ResetPasswordRequest)
|
||||
|
||||
controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)
|
||||
|
||||
// templates demos
|
||||
controller.Get("/signout", controllers.Signout)
|
||||
|
||||
controller.Get("/appsample", controllers.AppSample, hooks.AuthCheck)
|
||||
controller.Post("/appsample", controllers.AppSample, hooks.AuthCheck)
|
||||
|
||||
controller.Get("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
|
||||
controller.Post("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
|
||||
|
||||
controller.Get("/appsession", controllers.AppSession)
|
||||
controller.Post("/appsession", controllers.AppSession)
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
17
storage/templates/app.html
Normal file
17
storage/templates/app.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Sample page"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{{template "content_dropdown" .ContentDropdown}}
|
||||
{{template "page_card" .PageCard}}
|
||||
{{ define "page_card_content" }}
|
||||
|
||||
<img class="goffeelogo"src="/public/img/goffee.png" alt="Goffee logo" />
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
12
storage/templates/appsession.html
Normal file
12
storage/templates/appsession.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Sample page test session vars"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{{template "page_card" .PageCard}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
10
storage/templates/custom_theme_base.html
Normal file
10
storage/templates/custom_theme_base.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Goffee"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
{{template "page_card" .PageCard}}
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
30
storage/templates/custom_theme_contentpage.html
Normal file
30
storage/templates/custom_theme_contentpage.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Goffee"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
<fieldset>
|
||||
<legend>Content demos</legend>
|
||||
<div class="row">
|
||||
{{template "content_table" .ContentTable}}
|
||||
{{if .ShouldShowPagination}}
|
||||
{{template "content_pagination" .Pagination}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<h2>Pie chart</h2>
|
||||
{{template "content_graph" .ContentGraph}}
|
||||
<hr>
|
||||
{{template "form_input" .FieldText}}
|
||||
{{template "form_select" .FormSelectCityM}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{template "content_tabledetail" .ContentTabledetail}}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
66
storage/templates/custom_theme_elements.html
Normal file
66
storage/templates/custom_theme_elements.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Goffee"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos buttons</legend>
|
||||
<div class="container border rounded-3 p-2">
|
||||
{{range .Buttons}}
|
||||
{{template "form_button" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos href</legend>
|
||||
<div class="container d-flex justify-content-between border rounded-3 p-2">
|
||||
{{range .Hrefs}}
|
||||
{{template "content_href" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos Badges</legend>
|
||||
<div class="container d-flex justify-content-between border rounded-3 p-2">
|
||||
{{range .Badges}}
|
||||
{{template "content_badge" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos dropdown</legend>
|
||||
<div class="container d-flex justify-content-between border rounded-3 p-2">
|
||||
{{range .Dropdowns}}
|
||||
{{template "content_dropdown" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos List</legend>
|
||||
<div class="container d-flex justify-content-between border rounded-3 p-2">
|
||||
{{range .Lists}}
|
||||
{{template "content_list" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-3">
|
||||
<legend>Demos nav</legend>
|
||||
<div class="container border rounded-3 p-2 ">
|
||||
{{range .Menus}}
|
||||
<div class="container border rounded-3 p-2 mb-2">
|
||||
{{template "page_nav" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
23
storage/templates/custom_theme_formpage.html
Normal file
23
storage/templates/custom_theme_formpage.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{template "page_head" "Goffee"}}
|
||||
<body>
|
||||
<div class="container">
|
||||
<form>
|
||||
<fieldset>
|
||||
<legend>form demos</legend>
|
||||
<div class="row">
|
||||
{{template "form_input" .FormText}}
|
||||
{{template "form_input" .FormEmail}}
|
||||
{{template "form_select" .FormSelectCity}}
|
||||
{{template "form_textarea" .FormTextarea}}
|
||||
{{template "form_radio" .FormRadio}}
|
||||
{{template "form_checkbox" .FormCheckbox}}
|
||||
</div>
|
||||
</fieldset>
|
||||
{{template "form_button" .FormButton}}
|
||||
</form>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue