diff --git a/handlers/Volunteers.go b/handlers/Volunteers.go new file mode 100644 index 0000000..f8bbe62 --- /dev/null +++ b/handlers/Volunteers.go @@ -0,0 +1,25 @@ + +package handlers + +import ( + "log/slog" + "net/http" + + "jirku.sk/mcmamina/template/components" + "jirku.sk/mcmamina/template/pages" +) + +func Volunteers(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( + "Volunteers", + "Dobrovoľníci", + cssPath, + pages.VolunteersPage(), + )).Render(r.Context(), w) + } +} diff --git a/main.go b/main.go index 4384a49..91799ca 100644 --- a/main.go +++ b/main.go @@ -91,6 +91,7 @@ func setupWebserver(log *slog.Logger, calendarService *services.CalendarService) 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)) + router.HandleFunc("/podpora/dobrovolnici", handlers.Volunteers(log, cssService)) router.HandleFunc("/podpora", handlers.SupportedUs(log, cssService, sponsorService)) router.HandleFunc("/aktivity", handlers.Activities(log, cssService)) router.HandleFunc("/aktivity/kalendar", handlers.Calendar(log, cssService)) @@ -151,4 +152,4 @@ func middlwareLog(log *slog.Logger, name string) *slog.Logger { func serviceLog(log *slog.Logger, name string) *slog.Logger { return log.With(slog.String("type", "service"), slog.String("name", name)) -} \ No newline at end of file +} diff --git a/template/pages/Volunteers.css b/template/pages/Volunteers.css new file mode 100644 index 0000000..ddb2ab6 --- /dev/null +++ b/template/pages/Volunteers.css @@ -0,0 +1,4 @@ + +.volunteers { + background-image: url("@assets/images/crayons-1445053_640.jpg"); +} diff --git a/template/pages/Volunteers.templ b/template/pages/Volunteers.templ new file mode 100644 index 0000000..bffb8b0 --- /dev/null +++ b/template/pages/Volunteers.templ @@ -0,0 +1,35 @@ + +package pages + +import ( + "jirku.sk/mcmamina/template/layout" + "jirku.sk/mcmamina/template/components" +) + +templ VolunteersPage() { + @layout.Layout(templ.CSSClasses{"volunteers w-full bg-cover bg-center text-indigo-800 font-light"}, func(link string) bool { return link == "/podpora"}) { + @SupportedUsSubmenu(func(link string) bool { return link == "/podpora/dobrovolnici" }) + @components.FullWidthCard(components.NewFullWidthCard().Margin("mt-4")) { + @components.CardContent("") { +
+ Toto sú oblasti, v ktorých by sme privítali Vašu pomoc: +
++ Máš skúsenosti z iných oblastí oblastí a chces ich využiť? +
++ Taktiež, veľmi rady, privítame pomoc šikovných oteckov pri menších opravách a údržbe zariadenia v interiéri a vonkajších priestoroch. +
+ } + } + } +} diff --git a/template/pages/Volunteers.ts b/template/pages/Volunteers.ts new file mode 100644 index 0000000..444bc9e --- /dev/null +++ b/template/pages/Volunteers.ts @@ -0,0 +1,2 @@ + +import "./Volunteers.css" diff --git a/vite.config.ts b/vite.config.ts index 8141bb6..8fb18b6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,6 +47,7 @@ export default defineConfig({ "template/pages/SupportedUs.ts", "template/pages/Calendar.ts", // -> MCMAMINA - GENERATE PAGE + "template/pages/Volunteers.ts", "template/pages/Marketplace.ts", "template/pages/SupportGroups.ts", "template/pages/BabyDeliveryCourse.ts",