add search page, results template

master
Bel LaPointe 2022-02-15 15:01:46 -07:00
parent 9809948778
commit 2a09ad730c
3 changed files with 43 additions and 0 deletions

View File

@ -83,6 +83,15 @@ newlines
`, `,
}, },
"Results": []struct {
Title string
ID string
}{
{Title: "title id00", ID: "id00"},
{Title: "title id07", ID: "id07"},
{Title: "title id00 / title id10", ID: "id00/id10/id10"},
{Title: "title id00 / title id10 / title id20", ID: "id00/id10/id20"},
},
"Tree": `{ "Tree": `{
"Leaf": {"Title": ""}, "Leaf": {"Title": ""},
"Branches": { "Branches": {

View File

@ -0,0 +1,20 @@
{{ define "search" }}
<!DOCTYPE html>
<html>
<header>
<title>{{ .This.Title }}</title>
{{ template "_import" }}
</header>
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
<div class="rows" style="height: inherit;">
{{ template "_searchbar" }}
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
{{ template "_filetree" . }}
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
{{ template "_results" . }}
</div>
</div>
</div>
</body>
</html>
{{ end }}

View File

@ -0,0 +1,14 @@
{{ define "_results" }}
<style>
</style>
</script>
<div class="fullscreen tb_fullscreen">
<ul id="results">
{{ range .Results }}
<li>
<a href="/ui/files/{{ .ID }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}