Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
templates
/
front
/
blocks
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/templates/front/blocks/navbar-search.html.twig
{% set random = random(100) %} <div id="navbar-search"> {{ form_start(form) }} {{ form_row(form.search, { "label" : false, id : "search_product_search" ~ random }) }} {{ form_end(form) }} <div class="btn btn-red rounded-pill" id="search-button{{ random }}"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewbox="0 0 16 16"> <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/> </svg> </div> </div> <script> let searchBar{{ random }} = document.getElementById("search_product_search{{ random }}"); let searchBtn{{ random }} = document.getElementById("search-button{{ random }}"); let opened{{ random }} = false; searchBtn{{ random }}.addEventListener("click", (e) => { e.preventDefault(); if(!opened{{ random }} && innerWidth > 768){ searchBar{{ random }}.focus(); opened{{ random }} = true; } else { searchBar{{ random }}.focus(); let search = searchBar{{ random }}.value; if(search.length > 0){ location.href = `{{ path('product_all') }}?search_product[search]=${search}`; } } }) searchBar{{ random }}.addEventListener("keydown", (e) => { if(e.key === "Enter"){ e.preventDefault(); let search = searchBar{{ random }}.value; if(search.length > 0){ location.href = `{{ path('product_all') }}?search_product[search]=${search}`; } } }) searchBar{{ random }}.addEventListener("focusout", () => { setTimeout(() => { opened{{ random }} = false; }, 100); }) </script>