Skip to content

Commit

Permalink
Merge branch 'Sylius:2.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnyshellcloud authored Dec 21, 2024
2 parents c6c7df5 + dd339a5 commit 29b6934
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
padding-top: 0.3rem;
padding-bottom: 0.3rem;
background: transparent;
color: $gray-500;

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

&:active {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<div {{ sylius_test_html_attribute('product-taxons') }}>
{{ form_label(product_taxons_form) }}
<div class="card"{{ stimulus_controller('product-taxon-tree', {treeData: this.tree, autoOpen: hookableMetadata.configuration.auto_open}) }}>
<div {{ stimulus_controller('product-taxon-tree', {treeData: this.tree, autoOpen: hookableMetadata.configuration.auto_open}) }}>
{{ form_widget(product_taxons_form, {attr: {'data-product-taxon-tree-target': 'productTaxons'}}) }}

<div class="p-3 pb-5">
<div class="pb-5">
<div class="d-flex align-items-center mb-4">
<div class="input-group input-group-flat">
<input class="form-control" placeholder="{{ 'sylius.ui.filter'|trans }}" type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% if form.configuration is defined %}
{% set attribute_type = form.vars.value.type %}
<div class="card g-col-12 g-col-xl-12" {{ sylius_test_html_attribute('configuration') }}>
<div class="card g-col-12" {{ sylius_test_html_attribute('configuration') }}>
<div class="card-header">
<div class="card-title">
{{ 'sylius.ui.configuration'|trans }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="card g-col-12 g-col-xl-6">
<div class="card g-col-12">
<div class="card-header">
<div class="card-title">
{{ 'sylius.ui.general'|trans }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set form = hookable_metadata.context.form %}
{% set prefixes = hookable_metadata.prefixes %}

<div class="card g-col-12 g-col-xl-6">
<div class="card g-col-12">
<div class="card-header">
<div class="card-title">
{{ 'sylius.ui.translations'|trans }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="col-12 col-md-6" {{ sylius_test_html_attribute('option-value', hookable_metadata.context.value_form.code.vars.value) }}>
<div class="col-12" {{ sylius_test_html_attribute('option-value', hookable_metadata.context.value_form.code.vars.value) }}>
<div class="card mb-3">
<div class="card-body">
{% hook 'value' with { form: hookable_metadata.context.value_form } %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
{% for translation_form_key, translation_form in hookable_metadata.context.value_form.translations %}
<div class="row mb-2" {{ sylius_test_html_attribute('option-value-locale', translation_form_key) }}>
<div class="col-12">
{% if translation_form.vars.name is not null %}
<div class="d-flex">
<div class="me-3 mt-1">{{ form_label(translation_form, translation_form.vars.name|sylius_locale_name) }}</div>
</div>
{% else %}
<div class="d-flex">
<div class="me-3 mt-1">
<span class="col-form-label">{{ 'sylius.ui.global'|trans }}</span>
<div class="row mb-3">
{% for translation_form_key, translation_form in hookable_metadata.context.value_form.translations %}
<div class="col-3" {{ sylius_test_html_attribute('option-value-locale', translation_form_key) }}>
<div>
{% if translation_form.vars.name is not null %}
<div class="d-flex">
<div class="me-3 mt-1">{{ form_label(translation_form, translation_form.vars.name|sylius_locale_name) }}</div>
</div>
{% else %}
<div class="d-flex">
<div class="me-3 mt-1">
<span class="col-form-label">{{ 'sylius.ui.global'|trans }}</span>
</div>
</div>
{% endif %}
</div>
<div>
<div class="input-group">
{{ form_widget(translation_form.value) }}
<button
type="button"
class="btn btn-icon"
data-bs-toggle="tooltip"
data-bs-title="{{ 'sylius.ui.apply_to_all'|trans }}"
data-action="live#action:prevent"
data-live-action-param="applyToAll"
data-live-value-key-param="{{ hookable_metadata.context.value_form_key }}"
data-live-translation-key-param="{{ translation_form_key }}"
{{ sylius_test_html_attribute('apply-to-all') }}
>
{{ ux_icon('tabler:copy-plus') }}
</button>
{{ form_errors(translation_form.value) }}
</div>
{% endif %}
</div>
<div class="col-12">
<div class="input-group">
{{ form_widget(translation_form.value) }}
<button
type="button"
class="btn btn-icon"
data-bs-toggle="tooltip"
data-bs-title="{{ 'sylius.ui.apply_to_all'|trans }}"
data-action="live#action:prevent"
data-live-action-param="applyToAll"
data-live-value-key-param="{{ hookable_metadata.context.value_form_key }}"
data-live-translation-key-param="{{ translation_form_key }}"
{{ sylius_test_html_attribute('apply-to-all') }}
>
{{ ux_icon('tabler:copy-plus') }}
</button>
{{ form_errors(translation_form.value) }}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class="dropdown-item{% if url is not defined %} disabled{% endif %}"
href="{{ url }}"
>
{{ ux_icon(action.icon|default('tabler:eye')) }}
{{ ux_icon(action.icon|default('tabler:eye'), {'class': 'icon dropdown-item-icon'}) }}
<span>
<span class="text-nowrap">{{ channel_pricing.channelCode|sylius_channel_name }}</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,28 @@
</h2>
</div>
<div class="card-body">
<div class="mb-3">
<div class="mb-4">
{{ form_row(form.code) }}
{{ form_row(form.enabled) }}
</div>
<div class="mb-3">
<div class="mb-4">
{{ form_row(form.shippingCategory) }}
{{ form_row(form.shippingRequired) }}
</div>
{% if form.optionValues is defined and form.optionValues|length > 0 %}
<div class="mb-3">
<div class="mb-4">
<h4>{{ 'sylius.ui.options'|trans }}</h4>
{% for option_form in form.optionValues %}
{{ form_row(option_form) }}
{% endfor %}
</div>
{% endif %}
<div class="card mb-3">
<div class="card-body">
<div class="mb-3">
<h4 class="ui dividing header">{{ 'sylius.ui.properties'|trans }}</h4>
{{ form_row(form.height) }}
{{ form_row(form.width) }}
{{ form_row(form.depth) }}
{{ form_row(form.weight) }}
</div>
</div>
<div class="mb-4">
<h4 class="ui dividing header">{{ 'sylius.ui.properties'|trans }}</h4>
{{ form_row(form.height) }}
{{ form_row(form.width) }}
{{ form_row(form.depth) }}
{{ form_row(form.weight) }}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
{% endif %}
{% for field in definition.enabledFields|sylius_sort_by('position') %}
<td{% if field.options.vars.td_class is defined %} class="{{ field.options.vars.td_class }}"{% endif %}>
{% if field.name == 'code' %}
<code>{{ sylius_grid_render_field(grid, field, row) }}</code>
{% else %}
{{ sylius_grid_render_field(grid, field, row) }}
{% endif %}
{{ sylius_grid_render_field(grid, field, row) }}
</td>
{% endfor %}
{% if definition.actionGroups.item is defined and definition.getEnabledActions('item')|length > 0 %}
Expand Down

0 comments on commit 29b6934

Please sign in to comment.