{% load i18n static cms_tags sekizai_tags %}{% spaceless %}

{% page_url 'shop-search-product' as search_product_url %}
{% if search_product_url or search_autocomplete %}

	{% addtoblock "js" %}<script src="{% static 'shop/js/utils.js' %}" type="text/javascript"></script>{% endaddtoblock %}
	{% addtoblock "js" %}<script src="{% static 'shop/js/search-form.js' %}" type="text/javascript"></script>{% endaddtoblock %}
	{% add_data "ng-requires" "django.shop.search" %}

<form shop-product-search class="{{ search_form_classes }}" role="search" method="get"{% if search_product_url %} action="{{ search_product_url }}"{% endif %}>
	{% if search_product_url %}
	<div class="input-group">
	{% endif %}
		<input name="q" ng-model="searchQuery" {% if search_autocomplete %}ng-change="autocomplete()" {% endif %}type="text" class="form-control" placeholder="{% trans 'Search' %}" />
	{% if search_product_url %}
		<div class="input-group-addon" ng-click="submitSearch()" uib-tooltip="{% trans "Refine your search" %}">
			<i class="glyphicon glyphicon-search"></i>
		</div>
	</div>
	{% endif %}
</form>

{% endif %}
{% endspaceless %}
