From 2020e4705387728145060fcfdb474f9c3ef7c54e Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 13 Sep 2024 12:30:25 -0500 Subject: [PATCH] go is compiling now --- starter-template/go.mod | 4 ++-- starter-template/partials/news.go | 10 ++-------- starter-template/partials/patient/patient.go | 1 + 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/starter-template/go.mod b/starter-template/go.mod index 0497f6d..dd3af3b 100644 --- a/starter-template/go.mod +++ b/starter-template/go.mod @@ -5,8 +5,8 @@ go 1.23.0 require ( github.com/gofiber/fiber/v2 v2.52.5 github.com/google/uuid v1.6.0 - github.com/maddalax/mhtml/framework v0.0.0-20240913172412-f46749837a6f - github.com/maddalax/mhtml/framework-ui v0.0.0-20240913172653-23dd1db77843 + github.com/maddalax/mhtml/framework v0.0.0-20240913172653-23dd1db77843 + github.com/maddalax/mhtml/framework-ui v0.0.0-20240913172832-ad335247426d github.com/redis/go-redis/v9 v9.6.1 ) diff --git a/starter-template/partials/news.go b/starter-template/partials/news.go index 59af725..1517040 100644 --- a/starter-template/partials/news.go +++ b/starter-template/partials/news.go @@ -3,15 +3,13 @@ package partials import ( "fmt" "github.com/gofiber/fiber/v2" + "github.com/maddalax/mhtml/framework-ui/ui" "github.com/maddalax/mhtml/framework/h" "github.com/maddalax/mhtml/starter-template/news" ) func NewsSheet(ctx *fiber.Ctx) *h.Partial { open := h.GetQueryParam(ctx, "open") == "true" - if open { - h.SessionIncr(ctx, "sheet-open-count") - } return h.NewPartialWithHeaders( &map[string]string{ "hx-trigger": "sheetOpened", @@ -26,17 +24,13 @@ func NewsSheet(ctx *fiber.Ctx) *h.Partial { } func NewsSheetOpenCount(ctx *fiber.Ctx) *h.Partial { - rnd := h.SessionGet[int64](ctx, "sheet-open-count") - if rnd == nil { - rnd = new(int64) - } open := h.GetQueryParam(ctx, "open") == "true" return h.NewPartial(h.Div( h.Id("sheet-open-count"), h.IfElse(open, - h.Text(fmt.Sprintf("you opened sheet %d times", *rnd)), + h.Text(fmt.Sprintf("you opened sheet %d times", 1)), h.Text("sheet is not open")), ), ) diff --git a/starter-template/partials/patient/patient.go b/starter-template/partials/patient/patient.go index 1e858a3..e18537e 100644 --- a/starter-template/partials/patient/patient.go +++ b/starter-template/partials/patient/patient.go @@ -2,6 +2,7 @@ package patient import ( "github.com/gofiber/fiber/v2" + "github.com/maddalax/mhtml/framework-ui/ui" "github.com/maddalax/mhtml/framework/h" "github.com/maddalax/mhtml/starter-template/features/patient" "github.com/maddalax/mhtml/starter-template/partials/sheet"