dorfylegends/backend/templates/entities.html

59 lines
1.9 KiB
HTML
Raw Permalink Normal View History

2022-04-27 22:44:39 +03:00
{{template "layout.html" .}}
{{define "title"}}Entities{{end}}
{{define "content"}}
<h3>Entities</h3>
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
{{- range $t, $v := .}}
2022-05-11 10:45:17 +03:00
<a class="nav-link{{ ifFirst $ $t " active" }}" data-bs-toggle="tab" data-bs-target="#nav-{{kebab $t}}" type="button"
role="tab">{{$t}} ({{ len $v }})</a>
2022-04-27 22:44:39 +03:00
{{- end}}
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
{{- range $t, $v := . }}
2022-04-28 22:24:55 +03:00
<div class="tab-pane{{ ifFirst $ $t " active" }}" id="nav-{{kebab $t}}" role="tabpanel" aria-labelledby="nav-home-tab">
2022-04-30 10:45:31 +03:00
<table class="table table-hover table-sm table-borderless object-table">
2022-04-27 22:44:39 +03:00
<tr>
2022-05-06 14:11:12 +03:00
<th>Name</th>
<th>
{{- if eq $t "guild" }}
Profession
{{- else if eq $t "religion" }}
Worshpipping
{{- else }}
Race
{{- end }}
</th>
{{- if eq $t "militaryunit" }}
<th width="50%">Worshpipping</th>
<th width="50%">Weapons</th>
{{- end }}
2022-04-27 22:44:39 +03:00
</tr>
{{- range $v }}{{- if not (eq .Name "") }}
<tr>
<td>{{ entity .Id }}</td>
2022-05-06 14:11:12 +03:00
<td>
{{- if eq $t "guild" }}
{{ .Profession }}s
{{- else if eq $t "religion" }}
{{ hfList .WorshipId }}
{{- else }}
{{ .Race }}
{{- end }}
</td>
{{- if eq $t "militaryunit" }}
<td style="white-space: normal;">{{ hfList .WorshipId }}</td>
<td style="white-space: normal;">{{ andList .Weapons }}</td>
{{- end }}
2022-04-27 22:44:39 +03:00
</tr>
{{- end}}{{- end}}
</table>
</div>
{{- end}}
</div>
{{- end }}