morffix/tmpl/stats.tmpl
Samuel Lorch a5fc856764
All checks were successful
/ release (push) Successful in 48s
Saved Stat
2025-03-19 23:07:11 +01:00

69 lines
1.8 KiB
Cheetah

{{template "head"}}
<script src="/static/js/library_filter.js"></script>
<h2>Stats</h2>
<label for="library">Library:</label>
<select id="library" name="library" onchange="setLibrary(this.value)" class="short-button">
<option {{if eq .SelectedLibrary "-1" }} selected {{end}}value="-1">ALL</option>
{{range $l := $.Libraries}}
<option {{if eq $.SelectedLibrary $l.ID }} selected {{end}}value="{{$l.ID}}">{{$l.Name}}</option>
{{end}}
</select>
<h4>Size</h4>
<div class="counter">
{{ $l := len .Size }}
{{range $i, $c := .Size}}
<img class="counter-image" alt="{{$c}}" src="/static/counter/{{$c}}.gif">
{{ $n := sub $l $i }}
{{ if eq $n 4 }}
KB
{{ else if eq $n 7 }}
MB
{{ else if eq $n 10 }}
GB
{{ else if eq $n 13 }}
TB
{{end}}
{{end}}
</div>
<h4>Files</h4>
<div class="counter">
{{ $l := len .Count }}
{{range $i, $c := .Count}}
<img class="counter-image" alt="{{$c}}" src="/static/counter/{{$c}}.gif">
{{ $n := sub $l $i }}
{{ if eq $n 4 }}
.
{{ else if eq $n 7 }}
.
{{ else if eq $n 10 }}
.
{{ else if eq $n 13 }}
.
{{end}}
{{end}}
</div>
<h4>Saved</h4>
<div class="counter">
{{ $l := len .Saved }}
{{range $i, $c := .Saved}}
<img class="counter-image" alt="{{$c}}" src="/static/counter/{{$c}}.gif">
{{ $n := sub $l $i }}
{{ if eq $n 4 }}
KB
{{ else if eq $n 7 }}
MB
{{ else if eq $n 10 }}
GB
{{ else if eq $n 13 }}
TB
{{end}}
{{end}}
</div>
<div class="stats">
{{range $c := .Charts}}
{{$c.Element}} {{$c.Script}}
{{end}}
</div>
{{template "tail"}}