Do search if querystring is provided
This commit is contained in:
parent
fb78f3f993
commit
93030852b5
2 changed files with 3 additions and 1 deletions
|
@ -43,6 +43,7 @@ class SearchPage(BaseContentMixin, RoutablePageMixin, BasePage): # type: ignore
|
|||
|
||||
def get_context(self, request: HttpRequest) -> dict:
|
||||
context = super().get_context(request)
|
||||
context["search_query"] = request.GET.get("q", "")
|
||||
context["search_url"] = self.reverse_subpage("results")
|
||||
return context
|
||||
|
||||
|
|
|
@ -16,9 +16,10 @@
|
|||
name="q"
|
||||
placeholder="Search"
|
||||
hx-get="{{ search_url }}"
|
||||
hx-trigger="keyup changed delay:300ms, search"
|
||||
hx-trigger="keyup changed delay:300ms, search, revealed"
|
||||
hx-target="#search-results"
|
||||
autocomplete="off"
|
||||
value="{{ search_query }}"
|
||||
>
|
||||
</section>
|
||||
|
||||
|
|
Loading…
Reference in a new issue