From 9536561aa89d89d6430fc3a69b276255c3a55bc3 Mon Sep 17 00:00:00 2001 From: Pieter Lambrecht Date: Wed, 16 Mar 2022 00:07:22 +0100 Subject: [PATCH] Focus on searchbar #7839 --- netbox/templates/base/layout.html | 4 ++-- netbox/utilities/templatetags/search.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/netbox/templates/base/layout.html b/netbox/templates/base/layout.html index da2d10c65..0def1c90e 100644 --- a/netbox/templates/base/layout.html +++ b/netbox/templates/base/layout.html @@ -33,7 +33,7 @@
- {% search_options %} + {% search_options request %}
@@ -45,7 +45,7 @@ {# Search bar #}
- {% search_options %} + {% search_options request %}
{# Proflie/login button #} diff --git a/netbox/utilities/templatetags/search.py b/netbox/utilities/templatetags/search.py index aad533e7e..5726ae5d5 100644 --- a/netbox/utilities/templatetags/search.py +++ b/netbox/utilities/templatetags/search.py @@ -8,6 +8,9 @@ search_form = SearchForm() @register.inclusion_tag("search/searchbar.html") -def search_options() -> Dict: +def search_options(request) -> Dict: """Provide search options to template.""" - return {"options": search_form.options} + return { + 'options': search_form.options, + 'request': request, + }