if .This.Namespaces, ui draws dropdown for namespaces
parent
fa499c200e
commit
08dfb715d3
|
|
@ -7,7 +7,7 @@
|
||||||
</header>
|
</header>
|
||||||
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
||||||
<div class="rows" style="height: inherit;">
|
<div class="rows" style="height: inherit;">
|
||||||
{{ template "_searchbar" }}
|
{{ template "_topbar" . }}
|
||||||
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
||||||
{{ template "_filetree" . }}
|
{{ template "_filetree" . }}
|
||||||
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,12 @@ func main() {
|
||||||
}
|
}
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"This": map[string]interface{}{
|
"This": map[string]interface{}{
|
||||||
"ID": "id00/id11",
|
"Namespaces": []string{"datastore", "dp-orchestration"},
|
||||||
"Title": "title id11",
|
"ID": "id00/id11",
|
||||||
"ReadOnly": false,
|
"Title": "title id11",
|
||||||
"PID": "id00",
|
"ReadOnly": false,
|
||||||
"PTitle": "title id00",
|
"PID": "id00",
|
||||||
|
"PTitle": "title id00",
|
||||||
"Content": `# hello
|
"Content": `# hello
|
||||||
|
|
||||||
## world
|
## world
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</header>
|
</header>
|
||||||
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
||||||
<div class="rows" style="height: inherit;">
|
<div class="rows" style="height: inherit;">
|
||||||
{{ template "_searchbar" }}
|
{{ template "_topbar" . }}
|
||||||
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
||||||
{{ template "_filetree" . }}
|
{{ template "_filetree" . }}
|
||||||
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
||||||
|
|
|
||||||
|
|
@ -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" }}
|
{{ 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="thic_flex" type="text" name="q" placeholder="space delimited search regexp"/>
|
||||||
<input class="info lil_btn" type="submit" value="search"/>
|
<input class="info lil_btn" type="submit" value="search"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{{ define "_topbar" }}
|
||||||
|
<div class="columns lr_fullscreen">
|
||||||
|
{{ template "_namespace" . }}
|
||||||
|
{{ template "_searchbar" . }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
Loading…
Reference in New Issue