Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions netbox/templates/base/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</button>
</div>
<div class="d-flex my-1 flex-grow-1 justify-content-center w-100">
{% search_options %}
{% search_options request %}
</div>
</div>

Expand All @@ -45,7 +45,7 @@

{# Search bar #}
<div class="col-6 d-flex flex-grow-1 justify-content-center">
{% search_options %}
{% search_options request %}
</div>

{# Proflie/login button #}
Expand Down
2 changes: 1 addition & 1 deletion netbox/utilities/templates/search/searchbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
aria-label="Search"
placeholder="Search"
class="form-control"
value="{{ request.GET.q }}"
value="{{ request.GET.q|escape }}"
/>

<input name="obj_type" hidden type="text" class="search-obj-type" />
Expand Down
7 changes: 5 additions & 2 deletions netbox/utilities/templatetags/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@


@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,
}