about summary refs log tree commit diff stats
path: root/frontend/templates/index.gotmpl
diff options
context:
space:
mode:
authorAlan Pearce2024-05-17 23:10:04 +0200
committerAlan Pearce2024-05-17 23:10:04 +0200
commit6ea953b1c9f9c352a9619e42a6f0ce80d183d7f8 (patch)
tree9cd4c3408e01a7d93bda9ca437ea79bf5c6adc32 /frontend/templates/index.gotmpl
parent934a0693213df901078cd1bc75a5b7e1b5c87555 (diff)
downloadsearchix-6ea953b1c9f9c352a9619e42a6f0ce80d183d7f8.tar.lz
searchix-6ea953b1c9f9c352a9619e42a6f0ce80d183d7f8.tar.zst
searchix-6ea953b1c9f9c352a9619e42a6f0ce80d183d7f8.zip
feat(ui): enable resetting form by clicking current source link
Diffstat (limited to 'frontend/templates/index.gotmpl')
-rw-r--r--frontend/templates/index.gotmpl4
1 files changed, 3 insertions, 1 deletions
diff --git a/frontend/templates/index.gotmpl b/frontend/templates/index.gotmpl
index 0211a5b..ee37c0f 100644
--- a/frontend/templates/index.gotmpl
+++ b/frontend/templates/index.gotmpl
@@ -25,7 +25,9 @@
         {{- range $key, $value := .Sources }}
           <a
             {{ if eq $.Source.Name $value.Name }}class="current"{{ end }}
-            href="/{{ .Importer }}/{{ $key }}/search{{ and $.Query (printf "?query=%s" $.Query) }}"
+            href="/{{ .Importer }}/{{ $key }}/search{{ if and (ne $.Source.Name $value.Name) $.Query }}
+              {{- printf "?query=%s" $.Query -}}
+            {{ end }}"
           >
             {{- $value.Name -}}
           </a>