Skip to content

Commit

Permalink
add predporodny kurz page
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjirku committed Dec 18, 2023
1 parent eef822b commit 2561b32
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/generate/GeneratePage.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func GeneratePage(c *cli.Context) error {
}

printBox("👉 updates vite.config.ts")
injectCode("vite.config.ts", " // -> MCMAMINA - GENERATE PAGE", fmt.Sprintf(" \"%s\",\n", params.PageTsPath()))
injectCode("vite.config.ts", " // -> MCMAMINA - GENERATE PAGE", fmt.Sprintf(" \"%s\",", params.PageTsPath()))
printBox("👉 updates ./cmd/web/main.go")
injectCode("./main.go", " // MCMAMINA -->> GENERATED CODE", fmt.Sprintf(" router.HandleFunc(\"%s\", handlers.%s(log, cssService))\n", params.Path, params.Name))
injectCode("./main.go", " // MCMAMINA -->> GENERATED CODE", fmt.Sprintf(" router.HandleFunc(\"%s\", handlers.%s(log, cssService))", params.Path, params.Name))

return nil
}
Expand Down
24 changes: 24 additions & 0 deletions handlers/BabyDeliveryCourse.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package handlers

import (
"log/slog"
"net/http"

"jirku.sk/mcmamina/template/components"
"jirku.sk/mcmamina/template/pages"
)

func BabyDeliveryCourse(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(
"BabyDeliveryCourse",
"Predpôrodný kurz",
cssPath,
pages.BabyDeliveryCoursePage(),
)).Render(r.Context(), w)
}
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/predporodny-kurz", handlers.BabyDeliveryCourse(log, cssService))
router.HandleFunc("/podpora/2-percenta-z-dane", handlers.TaxBonus(log, cssService))
router.HandleFunc("/podpora", handlers.SupportedUs(log, cssService, sponsorService))
router.HandleFunc("/aktivity", handlers.Activities(log, cssService))
Expand Down
4 changes: 4 additions & 0 deletions template/pages/BabyDeliveryCourse.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.baby-delivery-course {
background-image: url("@assets/images/crayons-1445053_640.jpg");
}
37 changes: 37 additions & 0 deletions template/pages/BabyDeliveryCourse.templ
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

package pages

import (
"jirku.sk/mcmamina/template/layout"
"jirku.sk/mcmamina/template/components"
)

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.CardContent("") {
<h1 class="text-2xl font-bold pb-4">Predpôrodný kurz</h1>
<p class="text-base text-justify pb-4">
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 <a class="underline" href="mailto:[email protected]">[email protected]</a>.
</p>
<p class="text-base text-justify pb-4">
<b class="font-bold">Náplň kurzu:</b>Kurz pozostáva zo 6 dvojhodinových prednášok: o tehotenstve, pôrode, šestonedelí a starostlivosti o dieťatko budú 4 prednášky s pôrodnou asistentkou, a o dojčení busú 2 prednášky s laktačnou poradkyňou. Prednáškami Vás prevediePhDr. Bibiana Chovancová – pôrodná asistentka (1. - 4. prednáška)MUDr. Mária Bohunčáková - laktačná poradkyňa (5. - 6. prednáška) Prečítajte si o nich viac.
</p>
<p class="text-base text-justify pb-4">
<b class="font-bold">Príspevok za kurz:</b>Príspevok na celý kurz je 49 € (6 stretnutí po 2 hodiny), kurzovné sa platí vopred prevodom na účet. Peniažky budú použité na činnosť občianskeho združenia Materské centrum Mamina. Partneri za účasť na lekciách neplatia.
</p>
<p class="text-base text-justify"><b class="font-bold">Termíny začiatkov kurzov:</b></p>
<ul class="list-disc ml-5 text-base pb-4">
<li>11.01.2024 - 15.02.2024</li>
<li>22.02.2024 - 28.03.2024</li>
<li>04.04.2024 - 09.05.2024</li>
<li>16.05.2024 - 20.06.2024</li>
</ul>
<p class="text-base text-justify pb-4">
<b class="font-bold">Čas a miesto konania kurzov:</b> Vždy vo štvrtok v čase 17:00 – 19:00.Prednášky aj cvičenia sa konajú v Materskom centre Mamina, Tatranská 10 (budova bývalej ZŠ). Najbližšia autobusová zastávka je Starohorská rázcestie (linky 26 a 28). Počet miest na kurze je obmedzený. V prípade záujmu sa, prosím, prihláste kliknutím na odkaz pod textom.
</p>
}
}
}
}
2 changes: 2 additions & 0 deletions template/pages/BabyDeliveryCourse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

import "./BabyDeliveryCourse.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/BabyDeliveryCourse.ts",
"template/pages/Activities.ts",
"template/pages/TaxBonus.ts",
],
Expand Down

0 comments on commit 2561b32

Please sign in to comment.