Skip to content

Commit

Permalink
General UI improvements (#195)
Browse files Browse the repository at this point in the history
Fixes #187
  • Loading branch information
loic425 authored Dec 23, 2024
2 parents 96338ad + 123af38 commit f94657b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 35 deletions.
5 changes: 3 additions & 2 deletions src/BootstrapAdminUi/assets/styles/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
font-weight: 500;

&:active {
transform: translateY(1px);
transform: translateY(1px);
}
}

Expand All @@ -30,9 +30,10 @@
padding-top: 0.3rem;
padding-bottom: 0.3rem;
background: transparent;
color: $gray-500;

&.active {
color: var(--tblr-white);
color: $primary;
}

&:active {
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapAdminUi/public/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/BootstrapAdminUi/public/app.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/BootstrapAdminUi/public/app.rtl.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
{%- set classes = classes|merge([options.lastClass]) %}
{%- endif %}

{% set always_open = ['catalog', 'sales', 'customers'] %}
{% set is_active = matcher.isCurrent(item) or matcher.isAncestor(item, options.matchingDepth) or item.getExtra('always_open') %}

{# Mark item as "leaf" (no children) or as "branch" (has children that are displayed) #}
Expand Down Expand Up @@ -90,9 +89,7 @@
{%- set attributes = attributes|merge({'class': classes|join(' ')}) %}
{%- endif %}

{% set is_active = matcher.isCurrent(item) %}

<a class="dropdown-item {{ is_active ? '' : 'text-muted' }} {% if attributes.class is defined %}{{ attributes.class }}{% endif %}" href="{{ item.uri }}" target="{{ target }}">
<a class="dropdown-item {% if attributes.class is defined %}{{ attributes.class }}{% endif %}" href="{{ item.uri }}" target="{{ target }}">
{{ item.label|trans }}{% if target == '_blank' %}{{ ux_icon('tabler:external-link', {'class': 'icon icon-sm ms-1 mb-2 opacity-75'}) }}{% endif %}
</a>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@
{% set path = path(app.request.attributes.get('_route'), app.request.attributes.all('_route_params')) %}
{% set are_criteria_set = app.request.query.has('criteria') %}

<div class="position-relative z-1 bg-white mb-5">
{% set content %}
<div class="mb-3">
<form method="get" action="{{ path }}" novalidate {{ sylius_test_html_attribute('filters-form') }}>
<div class="sylius-filters">
{% for filter in resources.definition.enabledFilters|filter(filter => filter.enabled)|sylius_sort_by('position') %}
<div class="sylius-filters__item">
{{ sylius_grid_render_filter(resources, filter) }}
</div>
{% endfor %}
</div>
<div>
{{ button.primary({ text: 'sylius.ui.filter'|trans, icon: 'tabler: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>
</div>
{% endset %}
{% if resources.definition.enabledFilters is not empty %}
<div class="position-relative z-1 bg-white mb-5">
{% set content %}
<div class="mb-3">
<form method="get" action="{{ path }}" novalidate {{ sylius_test_html_attribute('filters-form') }}>
<div class="sylius-filters">
{% for filter in resources.definition.enabledFilters|filter(filter => filter.enabled)|sylius_sort_by('position') %}
<div class="sylius-filters__item">
{{ sylius_grid_render_filter(resources, filter) }}
</div>
{% endfor %}
</div>
<div>
{{ button.primary({ text: 'sylius.ui.filter'|trans, icon: 'tabler: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>
</div>
{% endset %}

{{ accordion([{
title: 'sylius.ui.filters'|trans,
content: content,
icon: 'tabler:adjustments',
}], are_criteria_set) }}
</div>
{{ accordion([{
title: 'sylius.ui.filters'|trans,
content: content,
icon: 'tabler:adjustments',
}], are_criteria_set) }}
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
{% endfor %}
</div>
</div>
{% else %}
<button type="button" class="btn btn-ghost-secondary dropdown-toggle" disabled>
{{ 'sylius.ui.show'|trans }} {{ paginator.maxPerPage }}
</button>
{% endif %}
{% endmacro %}

0 comments on commit f94657b

Please sign in to comment.