<script>
var chars = ['sale'{% for ck, char in chars %}, {{ char.id }}
{% endfor %}];
</script>
<div class="left-tab" id="left-tab-2" {% if prods|length > 0 %} style="display: block;" {% else %} style="display: none;" {% endif %}>
<div class="hidden" id="extsearch-action" data-action="{{ path('getnum', {'cat_id': cat_id}) }}"></div>
<form action="{% apply spaceless %} {% if spec == 'new' or spec == 'pop' or spec == 'action' or spec == 'mix' or spec == 'onsale' or spec == 'search' %} {{ path('prod_list_cat_spec', {'cat_id': cat_id, 'cat_intname': cat_intname, 'spec': spec}) }} {% else %} {{ path('prod_list_cat', {'cat_id': cat_id, 'cat_intname': cat_intname}) }} {% endif %} {% endapply %}" method="get" id="extsearch">
<div id="extnum">
<span id="total-filter-count">{{ labels.get('extsearch-1')|raw }}:
<b>0</b>
</span>
<input type="submit" value="{{ labels.get('block-extsearch-1')|raw }}">
</div>
<input type="hidden" name="filter" value="1">
<input type="hidden" name="q" value="{{ app.request.query.get('q') }}">
<table id="filterform">
<tr>
<td>
<table>
{% for char in chars %}
{% if charvals[char.id]|length != 0 %}
{% if char.type == 1 %}
<tr>
<td>
<input type="checkbox" name="{{ 'char' ~ char.id }}" value="1" {% if chars_selected[char.id]|length %} checked {% endif %}>
<strong>{{ char.name }}</strong>
</td>
</tr>
{% elseif char.type == 4 or char.type == 5 %}
<tr data-char-name-id="{{ char.id }}">
<td>
<strong>{{ char.name }}</strong>
</td>
</tr>
<tr data-char-list-id="{{ char.id }}">
<td class="char char-block">
<div class="cchar">
{% if char.id == 309 %}
{% for charval in charvals[char.id] %}
<div class="pal-item disabled" id="{{ 'charval' ~ charval.id }}">
<input type="checkbox" name="{{ 'char' ~ char.id ~ '[]'}}" value="{{ charval.id }}" {% if chars_selected[char.id] is iterable and charval.id in chars_selected[char.id] %} checked {% endif %}>
<img src="/pic/charval/{{ charval.id }}.jpg" alt="{{ charval.value }}" width="40" height="25" title="{{ charval.value }}" {% if chars_selected[char.id] is iterable and charval.id in chars_selected[char.id] %} class="click-color pal pal-active" {% else %} class="click-color pal" {% endif %}>
<br>
<em id="{{ 'prodcountnum-' ~ char.id ~ '-' ~ charval.id }}"></em>
</div>
{% endfor %}
{% else %}
{% set i = 1 %}
{% set marked = chars_selected[char.id] is iterable %}
{% for charval in charvals[char.id] %}
<div id="{{ 'charval' ~ charval.id }}" class="disabled {{ 'charval-' ~ char.id }}{% if i > 7 and marked == false %} hidden {% endif %}">
<input type="checkbox" name="{{ 'char' ~ char.id ~ '[]'}}" value="{{ charval.id }}" {% if marked == true and charval.id in chars_selected[char.id] %} checked {% endif %}>
{{ charval.value }}
<em id="{{ 'prodcountnum-' ~ char.id ~ '-' ~ charval.id }}"></em>
</div>
{% set i = i + 1 %}
{% endfor %}
{% if charvals[char.id]|length > 7 and marked == false %}
<div class="charval-more click-more" data-id="{{ char.id }}">
<i class="fa fa-sort-down"></i>
<span>{{ labels.get('showmore')|raw }}</span>
</div>
{% endif %}
{% endif %}
</div>
</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
{% if not spec %}
<tr>
<td>
<strong>{{ labels.get('extsearch-2')|raw }}</strong>
</td>
</tr>
<tr>
<td class="char char-block">
<div class="cchar">
<div id="charvalaction" class="disabled">
<input type="radio" name="sale" value="action" {% if chars_selected['sale'] == 'action' %} checked {% endif %}>
{{ labels.get('extsearch-3')|raw }}
<em id="prodcountnum-sale-action"></em>
</div>
</div>
<div class="cchar">
<div id="charvalnew" class="disabled">
<input type="radio" name="sale" value="new" {% if chars_selected['sale'] == 'new' %} checked {% endif %}>
{{ labels.get('extsearch-4')|raw }}
<em id="prodcountnum-sale-new"></em>
</div>
</div>
<div class="cchar">
<div id="charvalpop" class="disabled">
<input type="radio" name="sale" value="pop" {% if chars_selected['sale'] == 'pop' %} checked {% endif %}>
{{ labels.get('extsearch-5')|raw }}
<em id="prodcountnum-sale-pop"></em>
</div>
</div>
<div class="cchar">
<div id="charvalmix" class="disabled">
<input type="radio" name="sale" value="mix" {% if chars_selected['sale'] == 'mix' %} checked {% endif %}>
{{ labels.get('extsearch-6')|raw }}
<em id="prodcountnum-sale-mix"></em>
</div>
</div>
</td>
</tr>
{% endif %}
</table>
</td>
</tr>
</table>
</form>
</div>