if .This.Namespaces, ui draws dropdown for namespaces

This commit is contained in:
Bel LaPointe
2022-02-18 07:07:01 -07:00
parent fa499c200e
commit 08dfb715d3
6 changed files with 30 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
{{ define "_namespace" }}
<script>
function setNamespace() {
document.getElementById("namespace").disabled = true
window.location.href = `${window.location.protocol}`+"//"+`${window.location.host}/ui/files/${document.getElementById("namespace").value}`
}
</script>
{{ if .This.Namespaces }}
<select id="namespace" onchange="setNamespace()" style="max-width: 7rem;">
{{ range .This.Namespaces }}
<option>{{ . }}</option>
{{ end }}
</select>
{{ end }}
{{ end }}

View File

@@ -1,5 +1,5 @@
{{ define "_searchbar" }}
<form class="columns" action="/ui/search" method="GET">
<form class="columns thic_flex" action="/ui/search" method="GET">
<input class="thic_flex" type="text" name="q" placeholder="space delimited search regexp"/>
<input class="info lil_btn" type="submit" value="search"/>
</form>

View File

@@ -0,0 +1,6 @@
{{ define "_topbar" }}
<div class="columns lr_fullscreen">
{{ template "_namespace" . }}
{{ template "_searchbar" . }}
</div>
{{ end }}