htmgo/starter-template/partials/load/generated.go

45 lines
1.4 KiB
Go
Raw Normal View History

2024-09-11 00:52:18 +00:00
// Package partials THIS FILE IS GENERATED. DO NOT EDIT.
package load
2024-09-11 00:52:18 +00:00
2024-09-14 00:05:55 +00:00
import "github.com/maddalax/htmgo/framework/h"
2024-09-13 18:29:02 +00:00
import "github.com/gofiber/fiber/v2"
2024-09-13 21:33:50 +00:00
import "starter-template/partials"
import "starter-template/partials/patient"
import "starter-template/partials/sheet"
2024-09-11 00:52:18 +00:00
func GetPartialFromContext(ctx *fiber.Ctx) *h.Partial {
path := ctx.Path()
2024-09-13 21:45:12 +00:00
if path == "NewsSheet" || path == "/starter-template/partials.NewsSheet" {
return partials.NewsSheet(ctx)
2024-09-11 00:52:18 +00:00
}
2024-09-13 21:45:12 +00:00
if path == "NewsSheetOpenCount" || path == "/starter-template/partials.NewsSheetOpenCount" {
return partials.NewsSheetOpenCount(ctx)
2024-09-11 17:31:40 +00:00
}
2024-09-13 21:45:12 +00:00
if path == "Create" || path == "/starter-template/partials/patient.Create" {
2024-09-11 21:08:35 +00:00
return patient.Create(ctx)
2024-09-11 17:31:40 +00:00
}
2024-09-13 21:45:12 +00:00
if path == "List" || path == "/starter-template/partials/patient.List" {
2024-09-11 21:08:35 +00:00
return patient.List(ctx)
}
2024-09-13 21:45:12 +00:00
if path == "AddPatientSheetPartial" || path == "/starter-template/partials/patient.AddPatientSheetPartial" {
2024-09-12 02:06:34 +00:00
return patient.AddPatientSheetPartial(ctx)
2024-09-11 17:31:40 +00:00
}
2024-09-13 21:45:12 +00:00
if path == "ValidateForm" || path == "/starter-template/partials/patient.ValidateForm" {
return patient.ValidateForm(ctx)
}
2024-09-13 21:45:12 +00:00
if path == "Close" || path == "/starter-template/partials/sheet.Close" {
2024-09-11 17:31:40 +00:00
return sheet.Close(ctx)
2024-09-11 00:52:18 +00:00
}
return nil
}
2024-09-13 18:29:02 +00:00
func RegisterPartials(f *fiber.App) {
2024-09-13 21:33:50 +00:00
f.All("starter-template/partials*", func(ctx *fiber.Ctx) error {
2024-09-13 18:29:02 +00:00
partial := GetPartialFromContext(ctx)
if partial == nil {
return ctx.SendStatus(404)
}
return h.PartialView(ctx, partial)
})
}