if .This.Namespaces, ui draws dropdown for namespaces
This commit is contained in:
15
server/public/ui/templates/_namespace.ctmpl
Normal file
15
server/public/ui/templates/_namespace.ctmpl
Normal 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 }}
|
||||
@@ -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>
|
||||
|
||||
6
server/public/ui/templates/_topbar.ctmpl
Normal file
6
server/public/ui/templates/_topbar.ctmpl
Normal file
@@ -0,0 +1,6 @@
|
||||
{{ define "_topbar" }}
|
||||
<div class="columns lr_fullscreen">
|
||||
{{ template "_namespace" . }}
|
||||
{{ template "_searchbar" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user