configui/templates/components/menu.tmpl

51 lines
1.3 KiB
Cheetah

{{define "components/menu"}}
<section class="is-large">
<aside class="menu">
<p class="menu-label">
Files
</p>
<ul class="menu-list">
{{ range .Files }}
<li>
<a class="has-tooltip-arrow {{if eq $.File.Name .Name }}is-active{{end}}"
data-tooltip="{{.Path}}"
href="{{$.BaseUrl}}?name={{.Name}}"
>{{ .Name }}</a>
</li>
{{ end }}
</ul>
{{if .Onitachi}}
<p class="menu-label">
Programs
</p>
<ul class="menu-list">
{{- range $key, $value := .Onitachi -}}
<li>
<a class="has-tooltip-arrow" data-tooltip="{{$value.Cmd}}" href="{{$.BaseUrl}}program?name={{.Name}}">
<div class="level">
<span>{{$key}}</span>
<div class="tags has-addons">
<span class="tag">State</span>
<span class="tag {{$value.State|state_class}}">{{$value.State}}</span>
</div>
</div>
</a>
</li>
{{- end -}}
</ul>
{{end}}
{{if not .HideConfig}}
<p class="menu-label">
System
</p>
<ul class="menu-list">
<li>
<a class="has-tooltip-arrow {{if eq .File.Name .AppName }}is-active{{end}}"
data-tooltip="Configuration"
href="{{.BaseUrl}}"
>Config</a></li>
</ul>
{{end}}
</aside>
</section>
{{end}}