diff --git a/handlers/main_handler.go b/handlers/main_handler.go index f060e3b..19d2cdf 100644 --- a/handlers/main_handler.go +++ b/handlers/main_handler.go @@ -16,7 +16,7 @@ func MainHandler(content embed.FS, monsters *[]model.Monster) http.HandlerFunc { log.Print("MainHandler called") // Parse the templates from the embedded file system - tmpl, err := template.ParseFS(content, "templates/main.html", "templates/monsterForm.html", "templates/monster.html", "templates/monsterTable.html", "templates/base.html") + tmpl, err := template.ParseFS(content, "templates/main.html", "templates/monsterForm.html", "templates/monster.html", "templates/monsterTable.html", "templates/base.html", "templates/skills.html") if err != nil { log.Printf("Template parsing error: %v\n", err) http.Error(w, err.Error(), http.StatusInternalServerError) diff --git a/templates/base.html b/templates/base.html index 7d8e18c..ba46719 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,51 +3,51 @@ - - - {{.Title}} - - - + + + {{.Title}} + + + -
- {{ template "header" . }} -
-
- {{ template "main" . }} -
+
+ {{ template "header" . }} +
+
+ {{ template "main" . }} +
-
- {{ template "footer" . }} -
+
+ {{ template "footer" . }} +
diff --git a/templates/contact.html b/templates/contact.html index ce0085d..c8481f1 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -1,57 +1,58 @@ {{ define "contact" }}
-
-
-
-

Contact Us

-
-
+
+
+
+

Contact Us

+
+
-
-

Our Contact Information

-

You can reach us through the following channels:

-
    -
  • Email: example@example.com
  • -
  • Phone: +123456789
  • -
+
+

Our Contact Information

+

You can reach us through the following channels:

+
    +
  • Email: example@example.com
  • +
  • Phone: +123456789
  • +
+
+ +
+

Contact Form

+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+
- -
-

Contact Form

-
-
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- -
-
-
-
-
-
{{ end }} diff --git a/templates/footer.html b/templates/footer.html index cf8d261..260d84c 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,9 +1,9 @@ {{ define "footer" }} {{ end }} diff --git a/templates/header.html b/templates/header.html index 0efea19..441c7a4 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,81 +1,82 @@ {{ define "header" }}
- -
-
-
-
-
-
- Dungeons-and-Dragons-Banner + + -
+ +
+
+
+
+
+
+ Dungeons-and-Dragons-Banner +
+
+

+ Dungeons and Dragons Monster Generator +

+
+
+
+
+
-
- + // Ändere das Icon basierend auf dem aktuellen Stylesheet + if (link.getAttribute("href") === "/static/darkly_bulmawatch.css") { + link.setAttribute("href", "https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css"); + stylesheetIcon.innerHTML = ''; // Zum Mond-Icon wechseln + } else { + link.setAttribute("href", "/static/darkly_bulmawatch.css"); + stylesheetIcon.innerHTML = ''; // Zum Sonnen-Icon wechseln + } + } + }); +
{{ end }} diff --git a/templates/monster.html b/templates/monster.html index ecd2f58..5c5ad39 100644 --- a/templates/monster.html +++ b/templates/monster.html @@ -1,59 +1,59 @@ {{ define "monster" }} - {{.Name}} - {{.Source}} - {{range .Size}}{{.}}{{end}} - {{.Type}} - {{range .Alignment}}{{.}}{{end}} - {{range .AC}}{{.AC}}{{end}} - {{range .AC}}{{.From}}{{end}} - {{.HP.Average}} - {{.HP.Formula}} - {{.Speed.Walk}} - {{.Speed.Swim}} - {{.Speed.Burrow}} - {{.Speed.Climb}} - {{.Speed.Fly}} - {{.Str}} - {{.Dex}} - {{.Con}} - {{.Int}} - {{.Wis}} - {{.Cha}} - {{.Save.Dex}} - {{.Save.Con}} - {{.Save.Wis}} - {{.Save.Str}} - {{.Save.Int}} - {{.Save.Cha}} - {{.Skill.Perception}} - {{.Skill.Stealth}} - {{.Skill.Acrobatics}} - {{.Skill.AnimalHandling}} - {{.Skill.Arcana}} - {{.Skill.Athletics}} - {{.Skill.Deception}} - {{.Skill.History}} - {{.Skill.Insight}} - {{.Skill.Intimidation}} - {{.Skill.Investigation}} - {{.Skill.Medicine}} - {{.Skill.Nature}} - {{.Skill.Performance}} - {{.Skill.Persuasion}} - {{.Skill.SleightOfHand}} - {{.Skill.Survival}} - {{.Skill.Religion}} - {{range .Resist}}{{.}}{{end}} - {{range .Immune}}{{.}}{{end}} - {{range .Vulnerable}}{{.}}{{end}} - {{range .ConditionImmune}}{{.}}{{end}} - {{range .Senses}}{{.}}{{end}} - {{range .Languages}}{{.}}{{end}} - {{.CR}} - {{range .Traits}}{{.Name}}{{end}} - {{range .Traits}}{{range .Entries}}{{.}}{{end}}{{end}} - {{range .Actions}}{{.Name}}{{end}} - {{range .Actions}}{{range .Entries}}{{.}}{{end}}{{end}} + {{.Name}} + {{.Source}} + {{range .Size}}{{.}}{{end}} + {{.Type}} + {{range .Alignment}}{{.}}{{end}} + {{range .AC}}{{.AC}}{{end}} + {{range .AC}}{{.From}}{{end}} + {{.HP.Average}} + {{.HP.Formula}} + {{.Speed.Walk}} + {{.Speed.Swim}} + {{.Speed.Burrow}} + {{.Speed.Climb}} + {{.Speed.Fly}} + {{.Str}} + {{.Dex}} + {{.Con}} + {{.Int}} + {{.Wis}} + {{.Cha}} + {{.Save.Dex}} + {{.Save.Con}} + {{.Save.Wis}} + {{.Save.Str}} + {{.Save.Int}} + {{.Save.Cha}} + {{.Skill.Perception}} + {{.Skill.Stealth}} + {{.Skill.Acrobatics}} + {{.Skill.AnimalHandling}} + {{.Skill.Arcana}} + {{.Skill.Athletics}} + {{.Skill.Deception}} + {{.Skill.History}} + {{.Skill.Insight}} + {{.Skill.Intimidation}} + {{.Skill.Investigation}} + {{.Skill.Medicine}} + {{.Skill.Nature}} + {{.Skill.Performance}} + {{.Skill.Persuasion}} + {{.Skill.SleightOfHand}} + {{.Skill.Survival}} + {{.Skill.Religion}} + {{range .Resist}}{{.}}{{end}} + {{range .Immune}}{{.}}{{end}} + {{range .Vulnerable}}{{.}}{{end}} + {{range .ConditionImmune}}{{.}}{{end}} + {{range .Senses}}{{.}}{{end}} + {{range .Languages}}{{.}}{{end}} + {{.CR}} + {{range .Traits}}{{.Name}}{{end}} + {{range .Traits}}{{range .Entries}}{{.}}{{end}}{{end}} + {{range .Actions}}{{.Name}}{{end}} + {{range .Actions}}{{range .Entries}}{{.}}{{end}}{{end}} {{ end }} diff --git a/templates/monsterTable.html b/templates/monsterTable.html index d5aef50..0275be1 100644 --- a/templates/monsterTable.html +++ b/templates/monsterTable.html @@ -1,7 +1,7 @@ {{ define "monsterTable" }} - {{ range .Monsters }} - {{ template "monster" . }} + {{ range .Monsters }} + {{ template "monster" . }} {{ end }} {{ end }}