Skip to content

Commit

Permalink
Improve filter section
Browse files Browse the repository at this point in the history
  • Loading branch information
kulczy authored and GSadee committed May 14, 2024
1 parent 4cc8549 commit 064db37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% endfor %}
</div>
<div>
{{ _button.primary({ text: 'sylius.ui.filter'|trans, type: 'submit', attr: sylius_test_html_attribute('filter') }) }}
{{ _button.primary({ text: 'sylius.ui.filter'|trans, icon: 'adjustments', type: 'submit', attr: sylius_test_html_attribute('filter') }) }}
{{ _button.default({ text: 'sylius.ui.reset'|trans, url: path, attr: sylius_test_html_attribute('reset') }) }}
</div>
</form>
Expand All @@ -28,5 +28,6 @@
{{ _accordion.default([{
title: 'sylius.ui.filters'|trans,
content: content,
icon: 'adjustments',
}], areCriteriaSet) }}
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% macro default(items, open = false, autoClose = null, flush = false) %}
{% from "@SyliusAdmin/shared/helper/icon.html.twig" import icon %}

{% set autoClose = autoClose|default(true) %}
{% set id = id|default(random()) %}

Expand All @@ -7,6 +9,7 @@
{% set item = {
'open': open,
'flag': null,
'icon': null,
}|merge(item) %}
{% set item_id = item.id|default('collapse' ~ loop.index) %}

Expand All @@ -19,10 +22,15 @@
aria-expanded="{{ item.open == true ? 'true' : 'false' }}"
aria-controls="{{ item_id }}">

{% if item.flag %}
<span class="flag flag-country-{{ item.flag }} me-3"></span>
{% endif %}
{{ item.title|default('Title') }}
<span class="d-flex gap-2">
{% if item.flag %}
<span class="flag flag-country-{{ item.flag }}"></span>
{% endif %}
{% if item.icon %}
<span class="d-flex align-items-center">{{ icon({ icon: item.icon }) }}</span>
{% endif %}
{{ item.title|default('Title') }}
</span>
</button>
</h2>
<div id="{{ item_id }}"
Expand Down

0 comments on commit 064db37

Please sign in to comment.