-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tup-cms): make search field required input (#235)
- Loading branch information
1 parent
5273783
commit 8ca4297
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
apps/tup-cms/src/taccsite_cms/templates/nav_search.raw.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{# TODO: Migrate to Core #} | ||
{# FAQ: The difference is the addition of `required` to the <input> field #} | ||
|
||
{# COPIED FROM CORE #} | ||
{# https://github.com/TACC/Core-CMS/blob/f0bad55/taccsite_cms/templates/nav_search.raw.html#L1-L31 #} | ||
{# @var settings #} | ||
|
||
{% load static %} | ||
<!-- FAQ: This template loads independently at a unique url (see `urls.py`) | ||
so Portal and User Guide can render this markup into their markup. --> | ||
|
||
<style type="text/css"> | ||
/* SEE: https://github.com/TACC/Core-Styles/blob/main/source/_imports/elements/tacc-search-bar.md */ | ||
:host { visibility: hidden; height: 0; } | ||
</style> | ||
<link rel="stylesheet" href="{% static 'site_cms/css/build/site.tacc-search-bar.css' %}"> | ||
|
||
<form part="form" method="get" action="/search"> | ||
<label for="header-search" class="u-hide--visually" part="label"> | ||
Search | ||
</label> | ||
|
||
<input part="input" | ||
id="header-search" | ||
type="search" | ||
name="{{ settings.SEARCH_QUERY_PARAM_NAME }}" | ||
placeholder="Search" | ||
data-testid="input" | ||
autocomplete="off" minlength="3" required | ||
value="" /> | ||
<input type="hidden" name="page" value="1" /> | ||
|
||
<button part="button" type="submit" class="icon icon-search"> | ||
<span class="u-hide--visually">Search</span> | ||
</button> | ||
</form> |