Mark the searchbar as a required input. This avoids <Enter> on an empty searchbar to send a "POST /$PROJECT/$VERSION/ident" with empty value, which triggers an error. This is made more frequent by the fact that the searchbar is automatically focused. It also avoids implementing logic on the backend to redirect to the previous page if an empty search was submitted. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
<header class="topbar">
|
|
<div class="breadcrumb">
|
|
<a href="#menu" class="open-menu icon-menu screenreader" title="Open Menu">Open Menu</a>
|
|
<a class="project" href="{{ source_base_url }}">/</a>
|
|
{% for name, url in breadcrumb_links %}
|
|
<a href="{{ url }}">{{ name }}</a>
|
|
{{ '/' if not loop.last else '' }}
|
|
{% endfor %}
|
|
</div>
|
|
<div class="search">
|
|
<form method="post" action="{{ ident_base_url }}" id="search-form">
|
|
<select name="f" title="Restricts search to specific file families">
|
|
{% for id, description in topbar_families.items() %}
|
|
<option value="{{ id }}" {{ 'selected' if (current_family == id or current_family is not defined) else '' }}>
|
|
{{ description }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
|
|
<input placeholder="Search Identifier" type="text" id="search-input" name="i"
|
|
value="{{ searched_ident|default('')|e }}" autofocus required />
|
|
<button class="icon-search"><span class="screenreader">Go get it</span></button>
|
|
</form>
|
|
</div>
|
|
</header>
|