{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% form_theme form 'Form/form_div_layout.twig' %}
<div class="h_search">
<form method="get" class="searchform" action="{{ path('product_list') }}">
<div class="ec-headerSearch__category hidden">
<div class="ec-select ec-select_search">
{{ form_widget(form.category_id, {'id': null, 'attr': {'class': 'category_id'}}) }}
</div>
</div>
<div class="ec-headerSearch__keyword hidden">
<div class="ec-input">
{{ form_widget(form.name, {'id': null, 'attr': {'class': 'search-name', 'placeholder' : 'キーワードを入力' }} ) }}
<button class="ec-headerSearch__keywordBtn" type="submit">
<div class="ec-icon">
<img src="{{ asset('assets/icon/search-dark.svg') }}" alt="">
</div>
</button>
</div>
</div>
<div class="tags hidden">{{ form_widget(form.tag) }}</div>
<div class="hidden">{{ form_widget(form.tag1) }}{{ form_widget(form.tag2) }}</div>
<div class="box ft_e">
<div class="list">
<dl>
<dt data-label="Category" data-labelsp="カテゴリーからさがす">Category</dt>
<dd class="category root"><ul></ul></dd>
<dd class="child1"></dd>
<dd class="child2"></dd>
</dl>
<dl>
<dt data-label="Color" data-labelsp="色からさがす">Color</dt>
<dd class="color"><ul></ul></dd>
</dl>
<dl>
<dt data-label="Material" data-labelsp="素材からさがす">Material</dt>
<dd class="material"><ul></ul></dd>
</dl>
{{ form_widget(form.word, {'id': null, 'attr': {'placeholder' : 'Keyword' }} ) }}
<input type="submit" value="検索する" disabled />
</div>
<div class="tag"></div>
</div>
</form>
{% set Categories = repository('Eccube\\Entity\\Category').getList() %}
{% macro tree(Category) %}
{% from _self import tree %}
<a href="{{ url('product_list') }}?category_id={{ Category.id }}">
{{ Category.name }}
</a>
{% if Category.children|length > 0 %}
<ul>
{% for ChildCategory in Category.children %}
<li>
{{ tree(ChildCategory) }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<ul class="cats hidden">
{% for Category in Categories %}
<li>
{{ tree(Category) }}
</li>
{% endfor %}
</ul>
</div>