template cleanup

This commit is contained in:
2026-06-04 17:58:42 +00:00
parent 66747fa657
commit 3b1b20b506
15 changed files with 66 additions and 46 deletions
+17 -13
View File
@@ -1,3 +1,4 @@
{{/* <head> common across all pages*/}}
{{define "head"}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -14,18 +15,21 @@
<link rel="stylesheet" href="css/form.css">
{{end}}
{{/* <header> common across all pages*/}}
{{define "header"}}
<h1>{{.global.Organization}}</h1>
<label for="navtoggle">&#9776;</label>
<input type="checkbox" id="navtoggle">
<nav id="navigation">
{{if eq .page "login"}}
<a href="login" aria-current="page">Login</a>
{{else}}
<a href="index" {{if eq .page "index"}} aria-current="page" {{end}}>Instances</a>
<a href="account" {{if eq .page "account"}} aria-current="page" {{end}}>Account</a>
<a href="settings" {{if eq .page "settings"}} aria-current="page" {{end}}>Settings</a>
<a href="login">Logout</a>
{{end}}
</nav>
<header>
<h1>{{.global.Organization}}</h1>
<label for="navtoggle">&#9776;</label>
<input type="checkbox" id="navtoggle">
<nav id="navigation">
{{if eq .page "login"}}
<a href="login" aria-current="page">Login</a>
{{else}}
<a href="index" {{if eq .page "index"}} aria-current="page" {{end}}>Instances</a>
<a href="account" {{if eq .page "account"}} aria-current="page" {{end}}>Account</a>
<a href="settings" {{if eq .page "settings"}} aria-current="page" {{end}}>Settings</a>
<a href="login">Logout</a>
{{end}}
</nav>
</header>
{{end}}
+1 -1
View File
@@ -43,7 +43,7 @@
.hide-large {display: none !important;}
.hide-medium {display:none !important}
}
@media screen and (width <=601px) {
@media screen and (width <=601px) and (width >=440px){
.hide-large {display: none !important;}
.hide-medium {display:none !important}
.hide-small {display:none !important}
+1 -1
View File
@@ -37,7 +37,7 @@
<progress value="{{.Used}}" max="{{.Max}}" id="resource"></progress>
<label id="caption" for="resource">
<span>{{.Name}}</span>
<span>{{printf "%g" .Avail}} {{.Prefix}}{{.Unit}} Avaliable</span>
<span>{{.Avail}} {{.Prefix}}{{.Unit}} Avaliable</span>
</label>
</div>
</template>
+19 -3
View File
@@ -1,11 +1,27 @@
{{/*
Select: generic data driven <select> element template
.ID = (string) select element id & name attribute
.Required = (bool) select element required attribute
.Options = ([]Options) array of Options
*/}}
{{define "select"}}
<select class="w3-select w3-border" id="{{.ID}}" name="{{.ID}}" {{if .Required}}required{{end}}>
{{range .Options}}
{{range .Options}}
{{template "option" .}}
{{end}}
</select>
{{end}}
{{/*
Options: generic data driven <option> element template
.Selected = (bool) option element selected attribute
.Value = (string) option element value attribute
.Display = (string) option element innerText
*/}}
{{define "option"}}
{{if .Selected}}
<option value="{{.Value}}" selected>{{.Display}}</option>
{{else}}
<option value="{{.Value}}">{{.Display}}</option>
{{end}}
{{end}}
</select>
{{end}}