Skip to content

Commit

Permalink
volunteering page
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjirku committed Dec 19, 2023
1 parent 45842ab commit 6319fe0
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
25 changes: 25 additions & 0 deletions handlers/Volunteers.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
}
}
4 changes: 4 additions & 0 deletions template/pages/Volunteers.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.volunteers {
background-image: url("@assets/images/crayons-1445053_640.jpg");
}
35 changes: 35 additions & 0 deletions template/pages/Volunteers.templ
Original file line number Diff line number Diff line change
@@ -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("") {
<h1 class="text-2xl font-semibold pb-3">Hľadáme dobrovoľníkov, lektorov, animátorov!</h1>
<p class="pb-3">
Toto sú oblasti, v ktorých by sme privítali Vašu pomoc:
</p>
<ul class="list-inside list-disc pl-5 pt-5">
<li>Cvičenie pre ženy v období materstva</li>
<li>organizovanie prednášok, besied na rôzne témy spojené s rodičovstvom, výchovou, zdravím... (samotné vedenie alebo vyhľadávanie prednášajúcich)</li>
<li>cvičenia pre mamičky (aerobic, zumba, pilates, joga...)</li>
<li>hudobno=pohybové aktivity pre deti</li>
<li>aktivity pre rodičov s deťmi zamerané na varenie, zdravý životný štýl</li>
<li>aktivity pre rodičov s deťmi zamerané na objavovanie zákonov chémie, fyziky a rôznych pokusov</li>
</ul>
<p class="pb-3">
Máš skúsenosti z iných oblastí oblastí a chces ich využiť?
</p>
<p class="pb-3">
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.
</p>
}
}
}
}
2 changes: 2 additions & 0 deletions template/pages/Volunteers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

import "./Volunteers.css"
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6319fe0

Please sign in to comment.