2024-09-11 00:52:18 +00:00
|
|
|
package pages
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
|
"mhtml/h"
|
|
|
|
|
"mhtml/pages/base"
|
|
|
|
|
"mhtml/partials"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func ListPage(ctx *fiber.Ctx) *h.Page {
|
|
|
|
|
return h.NewPage(base.RootPage(
|
2024-09-11 17:31:40 +00:00
|
|
|
list(ctx),
|
2024-09-11 00:52:18 +00:00
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-11 23:41:21 +00:00
|
|
|
func list(ctx *fiber.Ctx) h.Renderable {
|
2024-09-11 00:52:18 +00:00
|
|
|
return h.Fragment(
|
2024-09-11 17:31:40 +00:00
|
|
|
h.ViewOnLoad(partials.NewsSheet),
|
2024-09-11 00:52:18 +00:00
|
|
|
h.Div(
|
|
|
|
|
h.Class("inline-flex flex-col gap-4 p-4"),
|
|
|
|
|
h.Div(
|
|
|
|
|
h.Class("max-w-md flex flex-col gap-4 "),
|
2024-09-11 17:31:40 +00:00
|
|
|
partials.OpenSheetButton(h.GetQueryParam(ctx, "open") == "true"),
|
2024-09-11 00:52:18 +00:00
|
|
|
),
|
|
|
|
|
h.Div(
|
2024-09-11 17:31:40 +00:00
|
|
|
h.ViewOnLoad(partials.NewsSheetOpenCount),
|
2024-09-11 00:52:18 +00:00
|
|
|
h.Text("you opened sheet 0 times")),
|
|
|
|
|
))
|
|
|
|
|
}
|