dorfylegends/backend/templates/entity.html

114 lines
3.7 KiB
HTML
Raw Normal View History

2022-04-16 23:12:23 +03:00
{{template "layout.html" .}}
{{define "title"}}{{ title .Name }}{{end}}
{{define "content"}}
2022-05-05 17:55:57 +03:00
<h3>{{ title .Name }}</h3>
<p>
{{ .Race }} {{ .Type }}
{{- if gt (len .WorshipId) 0 }}
centered around the worship of {{ hfList .WorshipId }}
2022-04-29 16:28:08 +03:00
{{- end }}
2022-05-05 17:55:57 +03:00
</p>
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
{{- if gt (len .Sites) 0 }}
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#nav-sites" type="button" role="tab">Sites</button>
{{- end}}
{{- if gt (len .HistfigId) 0 }}
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#nav-members" type="button" role="tab">Members</button>
{{- end}}
{{- if gt (len .Child) 0 }}
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#nav-children" type="button" role="tab">Groups</button>
{{- end}}
{{- if gt (len .Wars) 0 }}
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#nav-wars" type="button" role="tab">Wars</button>
{{- end}}
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
{{- if gt (len .Sites) 0 }}
<div class="tab-pane active" id="nav-sites" role="tabpanel">
<table class="table table-hover table-sm table-borderless">
<tr>
<th>Name</th>
<th width="100%">History</th>
</tr>
{{- range .Sites }}
<tr>
<td class="object" style="vertical-align: top;"> {{ site . }}</td>
<td> {{ template "events.html" events (history .) }}</td>
</tr>
{{- end}}
</table>
</div>
{{- end}}
{{- if gt (len .HistfigId) 0 }}
<div class="tab-pane" id="nav-members" role="tabpanel">
<table class="table table-hover table-sm table-borderless object-table">
<tr>
<th width="100%">Type</th>
</tr>
{{- range .HistfigId }}
<tr>
<td>{{ hf .}}</td>
</tr>
{{- end}}
</table>
</div>
{{- end}}
{{- if gt (len .Child) 0 }}
<div class="tab-pane" id="nav-children" role="tabpanel">
<table class="table table-hover table-sm table-borderless object-table">
<tr>
<th width="100%">Type</th>
</tr>
{{- range .Child }}
<tr>
<td>{{ entity .}}</td>
</tr>
{{- end}}
</table>
</div>
{{- end}}
{{- if gt (len .Wars) 0 }}
<div class="tab-pane" id="nav-wars" role="tabpanel">
<table class="table table-hover table-sm table-borderless object-table">
<tr>
<th>Year</th>
<th>Name</th>
<th width="100%">Enemy</th>
</tr>
{{- range .Wars }}
<tr>
<td>
{{- if eq .StartYear .EndYear}}
In {{ .StartYear }}
{{- else if eq .EndYear -1 }}
Since {{ .StartYear }}
{{- else }}
From {{ .StartYear }} till {{ .EndYear }}
{{- end }}
</td>
<td>{{ collection .Id}}</td>
<td>
{{- if eq $.Id .Details.AggressorEntId}}
attacking {{ entity .Details.DefenderEntId }}
{{- else }}
defending against {{ entity .Details.AggressorEntId }}
{{- end}}
</td>
</tr>
{{- end}}
</table>
</div>
{{- end}}
</div>
2022-04-29 16:28:08 +03:00
2022-05-05 17:55:57 +03:00
<h5>Events</h5>
2022-04-18 11:36:29 +03:00
2022-04-19 18:46:11 +03:00
{{ template "events.html" events . }}
2022-04-18 11:36:29 +03:00
<p>{{ json . }}</p>
2022-04-16 23:12:23 +03:00
{{- end }}