From cc7dfe584ad54fd9e27a301544c3529c04d942a0 Mon Sep 17 00:00:00 2001 From: Robert Janetzko Date: Fri, 6 May 2022 14:17:50 +0000 Subject: [PATCH] more details --- backend/model/extensions.go | 8 ++++++ backend/templates/hf.html | 45 +++++++++++++++++++++++---------- backend/templates/mountain.html | 11 +++++--- backend/templates/region.html | 8 +++++- 4 files changed, 53 insertions(+), 19 deletions(-) diff --git a/backend/model/extensions.go b/backend/model/extensions.go index 5c4f812..50bb8fb 100644 --- a/backend/model/extensions.go +++ b/backend/model/extensions.go @@ -149,6 +149,14 @@ func (hf *HistoricalFigure) FirstName() string { return strings.Split(hf.Name_, " ")[0] } +func (hf *HistoricalFigure) Goals() string { + return andList(util.Map(hf.Goal, func(g HistoricalFigureGoal) string { return g.String() })) +} + +func (hf *HistoricalFigure) Pets() string { + return andList(util.Map(hf.JourneyPet, func(g string) string { return articled(strings.ToLower(g)) })) +} + func (x *Honor) Requirement() string { var list []string if x.RequiresAnyMeleeOrRangedSkill { diff --git a/backend/templates/hf.html b/backend/templates/hf.html index 753e8c0..06f95b0 100644 --- a/backend/templates/hf.html +++ b/backend/templates/hf.html @@ -4,20 +4,37 @@ {{define "content"}}

{{ title .Name }}

-{{if .Female }} - -{{else}} - -{{end}} -{{ .Race }} -{{ if .Deity}}deity{{end}} -{{ if .Force}}force{{end}} -{{ if .Vampire}}vampire{{end}} -{{ if .Werebeast}}werebeast{{end}} -{{ if .Necromancer}}necromancer{{end}} -{{ if not (or .Deity .Force)}} -(*{{ .BirthYear }}{{ if ge .DeathYear 0 }} †{{ .DeathYear }}{{ end }}) -{{ end }} +

+ {{if .Female }} + + {{else}} + + {{end}} + {{ .Race }} + {{ if .Deity}}deity{{end}} + {{ if .Force}}force{{end}} + {{ if .Vampire}}vampire{{end}} + {{ if .Werebeast}}werebeast{{end}} + {{ if .Necromancer}}necromancer{{end}} + {{ if not (or .Deity .Force)}} + (*{{ .BirthYear }}{{ if ge .DeathYear 0 }} †{{ .DeathYear }}{{ end }}) + {{ end }} +

+ +
+ {{- if gt (len .Sphere) 0 -}} +
Spheres
+
{{ andList .Sphere }}
+ {{- end -}} + {{- if gt (len .Goal) 0 -}} +
Goals
+
{{ .Goals }}
+ {{- end -}} + {{- if gt (len .JourneyPet) 0 -}} +
Pets
+
{{ .Pets }}
+ {{- end -}} +
diff --git a/backend/templates/mountain.html b/backend/templates/mountain.html index 26b96da..09c5313 100644 --- a/backend/templates/mountain.html +++ b/backend/templates/mountain.html @@ -3,12 +3,15 @@ {{define "title"}}{{ title .Name }}{{end}} {{define "content"}} -

{{ title .Name }}

+

{{ title .Name }}

{{ if .IsVolcano }}volcano{{else}}mountain{{end}}

+
+
Height
+
{{ .Height }}
+
+
Events
+{{ template "events.html" events . }}

{{ json . }}

-{{ template "events.html" events . }} - -

{{ json . }}

{{- end }} \ No newline at end of file diff --git a/backend/templates/region.html b/backend/templates/region.html index df2a541..8a21970 100644 --- a/backend/templates/region.html +++ b/backend/templates/region.html @@ -6,8 +6,14 @@

{{ title .Name }}

{{ .Type }}

-
Events
+{{- if ne .ForceId -1 -}} +
+
Force
+
{{ hf .ForceId }}
+
+{{- end -}} +
Events
{{ template "events.html" events . }}

{{ json . }}