From 45842ab41d0047ee9a3e6c91d9536e981dbc33a3 Mon Sep 17 00:00:00 2001 From: Martin Jirku Date: Mon, 18 Dec 2023 22:14:05 +0100 Subject: [PATCH] burzy --- handlers/Marketplace.go | 25 +++++++++++++++ main.go | 1 + template/pages/BabyDeliveryCourse.templ | 4 +-- template/pages/Calendar.templ | 3 +- template/pages/Marketplace.css | 4 +++ template/pages/Marketplace.templ | 42 +++++++++++++++++++++++++ template/pages/Marketplace.ts | 2 ++ template/pages/SupportGroups.templ | 12 +++---- vite.config.ts | 1 + 9 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 handlers/Marketplace.go create mode 100644 template/pages/Marketplace.css create mode 100644 template/pages/Marketplace.templ create mode 100644 template/pages/Marketplace.ts diff --git a/handlers/Marketplace.go b/handlers/Marketplace.go new file mode 100644 index 0000000..7b7d291 --- /dev/null +++ b/handlers/Marketplace.go @@ -0,0 +1,25 @@ + +package handlers + +import ( + "log/slog" + "net/http" + + "jirku.sk/mcmamina/template/components" + "jirku.sk/mcmamina/template/pages" +) + +func Marketplace(Log *slog.Logger, cssPathGetter CSSPathGetter) func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + Log.Info("request", slog.String("method", r.Method), slog.String("path", r.URL.Path)) + w.Header().Set("Content-Type", "text/html; charset=utf-8") + cssPath, _ := cssPathGetter.GetCssPath() + // TODO: handle GET + components.Page(components.NewPage( + "Marketplace", + "Burzy", + cssPath, + pages.MarketplacePage(), + )).Render(r.Context(), w) + } +} diff --git a/main.go b/main.go index 6bb94a2..4384a49 100644 --- a/main.go +++ b/main.go @@ -87,6 +87,7 @@ func setupWebserver(log *slog.Logger, calendarService *services.CalendarService) router.HandleFunc("/", handlers.NewIndexHandler(log, calendarService, cssService).ServeHTTP) router.HandleFunc("/o-nas", handlers.AboutUs(log, cssService)) // MCMAMINA -->> GENERATED CODE + router.HandleFunc("/aktivity/burzy", handlers.Marketplace(log, cssService)) router.HandleFunc("/aktivity/podporne-skupiny", handlers.SupportGroups(log, cssService)) router.HandleFunc("/aktivity/predporodny-kurz", handlers.BabyDeliveryCourse(log, cssService)) router.HandleFunc("/podpora/2-percenta-z-dane", handlers.TaxBonus(log, cssService)) diff --git a/template/pages/BabyDeliveryCourse.templ b/template/pages/BabyDeliveryCourse.templ index 8c6a3b9..b4106cc 100644 --- a/template/pages/BabyDeliveryCourse.templ +++ b/template/pages/BabyDeliveryCourse.templ @@ -9,9 +9,9 @@ import ( templ BabyDeliveryCoursePage() { @layout.Layout(templ.CSSClasses{"baby-delivery-course w-full bg-cover bg-center text-indigo-800 font-light"}, func(link string) bool { return link == "/aktivity"}) { @ActivitySubmenu(func(link string) bool { return link == "/aktivity/predporodny-kurz" }) - @components.FullWidthCard(components.NewFullWidthCard().Class("text-base").Margin("mb-0")) { + @components.FullWidthCard(components.NewFullWidthCard().Class("text-base").Margin("mb-0").Padding("py-10 px-5 md:py-10 xl:py-16")) { @components.CardContent("") { -

Predpôrodný kurz

+

Predpôrodný kurz

Tento kurz pozostáva z teoretických prednášok a praktických rád. Trvá 6 týždňov. Prihlásiť sa môžete vyplnením online prihlášky alebo zaslaním emailu na adresu predporodnykurz@mcmamina.sk.

diff --git a/template/pages/Calendar.templ b/template/pages/Calendar.templ index 2ad5629..12ddc38 100644 --- a/template/pages/Calendar.templ +++ b/template/pages/Calendar.templ @@ -9,8 +9,9 @@ import ( templ CalendarPage() { @layout.Layout(templ.CSSClasses{"calendar w-full bg-cover bg-center text-indigo-800 font-light"}, func(link string) bool { return link == "/aktivity"}) { @ActivitySubmenu(func(link string) bool { return link == "/aktivity/kalendar" }) - @components.FullWidthCard(components.NewFullWidthCard().Margin("mt-8")) { + @components.FullWidthCard(components.NewFullWidthCard().Margin("mb-0").Padding("py-10 px-5 md:py-10 xl:py-16")) { @components.CardContent("leading-normal") { +

Kalendár