about summary refs log tree commit diff stats
path: root/frontend/templates/blocks/search.gotmpl
diff options
context:
space:
mode:
authorAlan Pearce2024-05-07 18:54:45 +0200
committerAlan Pearce2024-05-07 18:54:45 +0200
commit771ef706d7c70f583dad956077eaf79fc4fdc093 (patch)
treee5940f27bcec96607dfd024b00dc2d34ee9df19e /frontend/templates/blocks/search.gotmpl
parentc15b142b18dcdc7f5ab6d5f1afca8ae1696692cc (diff)
downloadsearchix-771ef706d7c70f583dad956077eaf79fc4fdc093.tar.lz
searchix-771ef706d7c70f583dad956077eaf79fc4fdc093.tar.zst
searchix-771ef706d7c70f583dad956077eaf79fc4fdc093.zip
style: split homepage and search page
Diffstat (limited to 'frontend/templates/blocks/search.gotmpl')
-rw-r--r--frontend/templates/blocks/search.gotmpl17
1 files changed, 17 insertions, 0 deletions
diff --git a/frontend/templates/blocks/search.gotmpl b/frontend/templates/blocks/search.gotmpl
new file mode 100644
index 0000000..5482e6b
--- /dev/null
+++ b/frontend/templates/blocks/search.gotmpl
@@ -0,0 +1,17 @@
+{{- template "main" . }}
+{{- template "js" . }}
+
+{{- define "main" }}
+  <label for="query">Search</label>
+  <form id="search" action="/options/results">
+    <input id="query" name="query" type="search" value="{{ .Query }}" />
+    <button>Search</button>
+  </form>
+  {{- with .Results }}
+    {{ block "results" . }}{{ end }}
+  {{- end }}
+{{- end }}
+
+{{- define "js" }}
+  <script src="/static/search.js" defer></script>
+{{- end }}