diff --git a/handlers/add_monster_handler.go b/handlers/add_monster_handler.go index f2a7e92..3d8e686 100644 --- a/handlers/add_monster_handler.go +++ b/handlers/add_monster_handler.go @@ -102,7 +102,7 @@ func parseMonster(r *http.Request) model.Monster { Con: r.FormValue("saveCon"), Wis: r.FormValue("saveWis"), Str: r.FormValue("saveStr"), - Cha: r.FormValue("saveCha"), + Cha: checkCheckbox("cha", r), Int: r.FormValue("saveInt"), }, Skill: model.Skill{ diff --git a/handlers/skill_calculation_handler.go b/handlers/skill_calculation_handler.go index b7bc109..55ce57b 100644 --- a/handlers/skill_calculation_handler.go +++ b/handlers/skill_calculation_handler.go @@ -68,12 +68,12 @@ func SkillCalculationHandler(content embed.FS) http.HandlerFunc { "sleightOfHand": strconv.Itoa(calcAbilityScore(dex) + crBonus), "stealth": strconv.Itoa(calcAbilityScore(dex) + crBonus), "survival": strconv.Itoa(calcAbilityScore(wis) + crBonus), - "saveStr": strconv.Itoa(calcAbilityScore(str)), - "saveWis": strconv.Itoa(calcAbilityScore(wis)), - "saveCon": strconv.Itoa(calcAbilityScore(con)), - "saveInt": strconv.Itoa(calcAbilityScore(int)), - "saveCha": strconv.Itoa(calcAbilityScore(cha)), - "saveDex": strconv.Itoa(calcAbilityScore(dex)), + "saveStr": strconv.Itoa(calcAbilityScore(str) + crBonus), + "saveWis": strconv.Itoa(calcAbilityScore(wis) + crBonus), + "saveCon": strconv.Itoa(calcAbilityScore(con) + crBonus), + "saveInt": strconv.Itoa(calcAbilityScore(int) + crBonus), + "saveCha": strconv.Itoa(calcAbilityScore(cha) + crBonus), + "saveDex": strconv.Itoa(calcAbilityScore(dex) + crBonus), } // Execute template with skill values. diff --git a/templates/monsterForm.html b/templates/monsterForm.html index 673f386..838ad55 100644 --- a/templates/monsterForm.html +++ b/templates/monsterForm.html @@ -87,60 +87,6 @@ -
-
-

- Speed -

-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
@@ -213,6 +159,63 @@
{{ template "skills" }}
+
+
+
+

+ Speed +

+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
@@ -303,4 +306,4 @@
-{{end}} +{{end}} \ No newline at end of file diff --git a/templates/skills.html b/templates/skills.html index 9512855..4497db6 100644 --- a/templates/skills.html +++ b/templates/skills.html @@ -1,254 +1,265 @@ {{ define "skills" }}
-
-
-

- Save -

-
-
-
+
+
+

+ Save +

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

- Skill -

-
-
-
-
-
-
- -
- +
+

+ Skill +

+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
-
-
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
-
-
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
-
-
-
-
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
-
-
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
-
-
- -
- +
+
+
+ +
+ +
+
-
-
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-{{ end }} +{{ end }} \ No newline at end of file