Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap update #121

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ composer require encore
yarn
yarn add @symfony/webpack-encore sass-loader@^13.0.0 node-sass -D
yarn add lodash.throttle -D
yarn add bootstrap@^4.5.0 bootstrap.native@^3.0.0 glightbox axios form-serialize @fortawesome/fontawesome-svg-core @fortawesome/free-brands-svg-icons @fortawesome/free-regular-svg-icons @fortawesome/free-solid-svg-icons popper.js
yarn add bootstrap@^5.3 glightbox axios form-serialize @fortawesome/fontawesome-svg-core @fortawesome/free-brands-svg-icons @fortawesome/free-regular-svg-icons @fortawesome/free-solid-svg-icons
yarn add @popperjs/core
```

Expand Down
2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Account/AddressBook/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>
{% endif %}

{% for address in addresses|filter(address => address.id != default_address.id or default_address is null) %}
{% for address in addresses|filter(address => default_address is null or address.id != default_address.id) %}
<div class="col-12 col-lg-6 mb-3" id="sylius-addresses" {{ sylius_test_html_attribute('addresses') }}>
{% include '@SyliusShop/Account/AddressBook/_item.html.twig' %}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="badge badge-warning">
<span class="badge bg-warning">
{{ value|trans }}
</span>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="badge badge-success">
<span class="badge bg-success">
{{ value|trans }}
</span>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="badge badge-primary">
<span class="badge bg-primary">
{{ value|trans }}
</span>
6 changes: 3 additions & 3 deletions SyliusShopBundle/views/Account/Order/Show/_header.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<div>
{{ order.checkoutCompletedAt|format_date }}
</div>
<div class="pl-2">
<div class="ps-2">
{% include [('@SyliusShop/Account/Order/Label/State' ~ '/' ~ order.state ~ '.html.twig'), '@SyliusUi/Label/_default.html.twig'] with {'value': ('sylius.ui.' ~ order.state)|trans} %}
</div>
<div class="pl-2">
<div class="ps-2">
{{ order.currencyCode }}
</div>
<div class="pl-2">
<div class="ps-2">
{{ flags.fromLocaleCode(order.localeCode) }}{{ order.localeCode|locale_name }}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions SyliusShopBundle/views/Account/dashboard.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{{ sylius_template_event('sylius.shop.account.dashboard.after_information', {'customer': customer}) }}

<div class="d-flex">
<a href="{{ path('sylius_shop_account_profile_update') }}" class="btn btn-primary mr-2">{{ 'sylius.ui.edit'|trans }}</a>
<a href="{{ path('sylius_shop_account_change_password') }}" class="btn btn-primary mr-2">{{ 'sylius.ui.change_password'|trans }}</a>
<a href="{{ path('sylius_shop_account_profile_update') }}" class="btn btn-primary me-2">{{ 'sylius.ui.edit'|trans }}</a>
<a href="{{ path('sylius_shop_account_change_password') }}" class="btn btn-primary me-2">{{ 'sylius.ui.change_password'|trans }}</a>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Cart/Summary/_checkout.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a href="{{ path('sylius_shop_checkout_start') }}" class="btn btn-primary btn-block">
<a href="{{ path('sylius_shop_checkout_start') }}" class="btn btn-primary d-block w-100">
{{ 'sylius.ui.checkout'|trans }}
</a>
2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Cart/Summary/_item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<td class="text-center">
<span class="sylius-quantity">{{ form_widget(form.quantity, sylius_test_form_attribute('cart-item-quantity-input', item.productName)) }}</span>
</td>
<td class="text-right">
<td class="text-end">
<span class="sylius-total" {{ sylius_test_html_attribute('cart-product-subtotal') }}>{{ money.convertAndFormat(item.subtotal) }}</span>
</td>
</tr>
6 changes: 3 additions & 3 deletions SyliusShopBundle/views/Cart/Summary/_items.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="card">
<div class="card overflow-hidden">
{{ form_start(form, {'action': path('sylius_shop_cart_save'), 'attr': {'class': 'loadable', 'novalidate': 'novalidate', 'id': form.vars.id}}) }}
{{ form_errors(form) }}
<input type="hidden" name="_method" value="PATCH"/>
Expand All @@ -12,7 +12,7 @@
<th class="border-0 text-nowrap">{{ 'sylius.ui.item'|trans }}</th>
<th class="border-0 text-nowrap text-center">{{ 'sylius.ui.unit_price'|trans }}</th>
<th class="border-0 text-nowrap text-center">{{ 'sylius.ui.qty'|trans }}</th>
<th class="border-0 text-nowrap text-right">{{ 'sylius.ui.total'|trans }}</th>
<th class="border-0 text-nowrap text-end">{{ 'sylius.ui.total'|trans }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -29,7 +29,7 @@
</div>
{% endif %}

<div class="col text-right">
<div class="col text-end">
{% include '@SyliusShop/Cart/Summary/_update.html.twig' with {'main_form': form.vars.id} %}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions SyliusShopBundle/views/Cart/Widget/_button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %}

<a class="btn btn-light d-flex align-items-center dropdown-toggle"
data-toggle="dropdown"
data-bs-toggle="dropdown"
href="#"
id="sylius-cart-total" {{ sylius_test_html_attribute('cart-total') }}>
<span class="pr-3">{{ money.convertAndFormat(cart.itemsTotal) }}</span>
<span class="pe-3">{{ money.convertAndFormat(cart.itemsTotal) }}</span>
<span>{{ icons.cart('h1 m-0') }}</span>
<span class="badge badge-pill badge-primary" style="transform: translate(-8px, 10px)">{{ cart.items|length }}</span>
<span class="badge rounded-pill bg-primary" style="transform: translate(-8px, 10px)">{{ cart.items|length }}</span>
</a>
8 changes: 4 additions & 4 deletions SyliusShopBundle/views/Cart/Widget/_popup.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
{% for item in cart.items %}
<tr>
<td>{{ item.product }}</td>
<td class="text-right">
<td class="text-end">
<small class="text-muted">{{ item.quantity }} x </small>
{{ money.convertAndFormat(item.unitPrice) }}
</td>
</tr>
{% endfor %}
<tr class="bg-light">
<td><strong class="text-dark">{{ 'sylius.ui.subtotal'|trans }}:</strong></td>
<td class="text-right text-dark"><strong>{{ money.convertAndFormat(cart.itemsTotal) }}</strong></td>
<td class="text-end text-dark"><strong>{{ money.convertAndFormat(cart.itemsTotal) }}</strong></td>
</tr>
</tbody>
</table>

<div class="px-3 pb-2">
<a href="{{ path('sylius_shop_cart_summary') }}" class="btn btn-outline-primary btn-block">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a>
<a href="{{ path('sylius_shop_checkout_start') }}" class="btn btn-primary btn-block">{{ 'sylius.ui.checkout'|trans }}</a>
<a href="{{ path('sylius_shop_cart_summary') }}" class="btn btn-outline-primary d-block w-100">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a>
<a href="{{ path('sylius_shop_checkout_start') }}" class="btn btn-primary d-block w-100">{{ 'sylius.ui.checkout'|trans }}</a>
</div>
{% endif %}

2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Cart/_widget.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="sylius-cart-button">
{{ sylius_template_event('sylius.shop.cart.widget.button', {'cart': cart}) }}

<div class="dropdown-menu dropdown-menu-right" style="width:300px">
<div class="dropdown-menu dropdown-menu-end" style="width:300px">
{{ sylius_template_event('sylius.shop.cart.widget.popup', {'cart': cart}) }}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if app.user is not empty and app.user.customer is not empty and app.user.customer.addresses|length > 0 %}
<div class="dropdown address-book-select" {{ sylius_test_html_attribute('address-book') }}>
<button class="btn btn-outline-primary dropdown-toggle" type="button" data-toggle="dropdown">
<button class="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown">
{{ 'sylius.ui.select_address_from_book'|trans }}
</button>
<div class="dropdown-menu">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="text-right mb-3">
<div class="text-end mb-3">
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('confirmation-button') }}>
{{ 'sylius.ui.place_order'|trans }}
</button>
Expand Down
26 changes: 13 additions & 13 deletions SyliusShopBundle/views/Checkout/_summary.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@
{% set tax_included = sylius_order_tax_included(order) %}
{% set tax_excluded = sylius_order_tax_excluded(order) %}

<div class="card">
<div class="card overflow-hidden">
<table class="table" id="sylius-checkout-subtotal" {{ sylius_test_html_attribute('checkout-subtotal') }}>
<thead class="card-header">
<tr>
<th class="border-0 sylius-table-column-item">{{ 'sylius.ui.item'|trans }}</th>
<th class="border-0 text-right sylius-table-column-qty">{{ 'sylius.ui.quantity'|trans }}</th>
<th class="border-0 text-right sylius-table-column-subtotal">{{ 'sylius.ui.subtotal'|trans }}</th>
<th class="border-0 bg-light sylius-table-column-item">{{ 'sylius.ui.item'|trans }}</th>
<th class="border-0 bg-light text-end sylius-table-column-qty">{{ 'sylius.ui.quantity'|trans }}</th>
<th class="border-0 bg-light text-end sylius-table-column-subtotal">{{ 'sylius.ui.subtotal'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in order.items %}
<tr>
<td class="text-dark">{{ item.getVariant.product.name }}</td>
<td class="text-right">
<td class="text-dark {% if loop.last %} border-dark {% endif %}">{{ item.getVariant.product.name }}</td>
<td class="text-end {% if loop.last %} border-dark {% endif %}">
{{ item.quantity }}
</td>
<td class="text-right" id="sylius-item-{{ item.variant.product.slug }}-subtotal" {{ sylius_test_html_attribute('item-subtotal', item.variant.product.slug) }}>
<td class="text-end {% if loop.last %} border-dark {% endif %}" id="sylius-item-{{ item.variant.product.slug }}-subtotal" {{ sylius_test_html_attribute('item-subtotal', item.variant.product.slug) }}>
{{ money.convertAndFormat(item.subtotal) }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="1" class="border-top border-dark">
<td colspan="1" class="border-top">
<strong>{{ 'sylius.ui.items_total'|trans }}:</strong>
</td>
<td colspan="2" id="sylius-summary-items-subtotal" class="text-right border-top border-dark">
<td colspan="2" id="sylius-summary-items-subtotal" class="text-end border-top">
{{ money.convertAndFormat(items_subtotal) }}
</td>
</tr>
<tr {% if tax_included and not tax_excluded %}class="bg-light" {% endif %}>
<td colspan="1">
<strong>{{ 'sylius.ui.taxes_total'|trans }}:</strong>
</td>
<td colspan="2" class="text-right">
<td colspan="2" class="text-end">
{% if not tax_included and not tax_excluded %}
<div id="sylius-summary-tax-none">{{ money.convertAndFormat(0) }}</div>
{% endif %}
Expand All @@ -58,15 +58,15 @@
<td colspan="1">
<strong>{{ 'sylius.ui.discount'|trans }}:</strong>
</td>
<td colspan="2" id="sylius-summary-promotion-total" class="text-right">
<td colspan="2" id="sylius-summary-promotion-total" class="text-end">
{{ money.convertAndFormat(order.orderPromotionTotal) }}
</td>
</tr>
<tr>
<td colspan="1">
<strong>{{ 'sylius.ui.shipping_estimated_cost'|trans }}:</strong>
</td>
<td colspan="2" class="text-right">
<td colspan="2" class="text-end">
{% if order.getAdjustmentsTotal('shipping') > order.shippingTotal %}
<small><s>{{ money.convertAndFormat(order.getAdjustmentsTotal('shipping')) }}</s></small>
{% endif %}
Expand All @@ -77,7 +77,7 @@
<td colspan="1">
<div class="h3">{{ 'sylius.ui.order_total'|trans }}:</div>
</td>
<td colspan="2" id="sylius-summary-grand-total" class="text-right">
<td colspan="2" id="sylius-summary-grand-total" class="text-end">
<div class="h3">{{ money.convertAndFormat(order.total) }}</div>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Common/Form/_address.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{% include '@SyliusShop/Common/Form/_countryCode.html.twig' with {'form': form.countryCode} %}

<div class="form-group province-container" data-url="{{ path('sylius_shop_ajax_render_province_form') }}" data-parent="{{ form.countryCode.vars.id }}">
<div class="mb-3 province-container" data-url="{{ path('sylius_shop_ajax_render_province_form') }}" data-parent="{{ form.countryCode.vars.id }}">
{% if form.provinceCode is defined %}
{{ form_row(form.provinceCode, sylius_test_form_attribute('province-code')|sylius_merge_recursive({'attr': {'class': 'ui dropdown'}})) }}
{% elseif form.provinceName is defined %}
Expand Down
10 changes: 5 additions & 5 deletions SyliusShopBundle/views/Common/Macro/labels.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro default(text) %}
<span class="badge badge-secondary">{{ text|trans }}</span>
<span class="badge bg-secondary">{{ text|trans }}</span>
{% endmacro %}

{% macro status(status) %}
Expand All @@ -13,14 +13,14 @@
{% endmacro %}

{% macro enabled() %}
<span class="badge badge-info">
<span class="badge bg-info">
<i class="fas fa-check"></i>
{{ 'sylius.ui.enabled'|trans }}
</span>
{% endmacro %}

{% macro disabled() %}
<span class="badge badge-danger">
<span class="badge bg-danger">
<i class="fas fa-times"></i>
{{ 'sylius.ui.disabled'|trans }}
</span>
Expand All @@ -37,14 +37,14 @@
{% endmacro %}

{% macro yes() %}
<span class="badge badge-primary">
<span class="badge bg-primary">
<i class="fas fa-check"></i>
{{ 'sylius.ui.yes_label'|trans }}
</span>
{% endmacro %}

{% macro no() %}
<span class="badge badge-primary">
<span class="badge bg-primary">
<i class="fas fa-times"></i>
{{ 'sylius.ui.no_label'|trans }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion SyliusShopBundle/views/Common/Macro/messages.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% macro default(message, icon, type, header) %}
<div class="alert alert-{{ type|default('') }}" {{ sylius_test_html_attribute('flash-message', type) }}>
<div class="d-flex align-items-center">
<span class="pr-3 fa-2x">
<span class="pe-3 fa-2x">
{{ icon }}
</span>
<strong>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro default(header, subheader) %}
<h2 class="mt-5 mb-3 text-center font-weight-bold">{{ header }}</h2>
<h2 class="mt-5 mb-3 text-center fw-bold">{{ header }}</h2>
{% if subheader is not empty %}
<p class="text-muted mb-4">{{ subheader|raw }}</p>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{% set value = 'sylius.ui.' ~ state %}

<span class="badge-{{ view_options[state]['color'] }} badge">
<span class="bg-{{ view_options[state]['color'] }} badge">
<i class="{{ view_options[state]['icon'] }} icon"></i>
{{ 'sylius.ui.state'|trans }}: <span id="order-payment-status" {{ sylius_test_html_attribute('order-payment-state') }}>{{ value|trans }}</span>
</span>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% set value = 'sylius.ui.' ~ state %}

<span class="badge-{{ view_options[state]['color'] }} badge">
<span class="bg-{{ view_options[state]['color'] }} badge">
<i class="{{ view_options[state]['icon'] }} icon"></i>
{{ value|trans }}
</span>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% set value = 'sylius.ui.' ~ state %}

<span class="badge-{{ view_options[state]['color'] }} badge">
<span class="bg-{{ view_options[state]['color'] }} badge">
<i class="{{ view_options[state]['icon'] }} icon"></i>
{{ 'sylius.ui.state'|trans }}: <span id="order-shipment-status" {{ sylius_test_html_attribute('order-shipment-state') }}>{{ value|trans }}</span>
</span>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{% set value = 'sylius.ui.' ~ state %}

<span class="badge-{{ view_options[state]['color'] }} badge mx-2">
<span class="bg-{{ view_options[state]['color'] }} badge mx-2">
<i class="{{ view_options[state]['icon'] }} icon"></i>
{{ value|trans }}
</span>
6 changes: 3 additions & 3 deletions SyliusShopBundle/views/Common/Order/Table/_headers.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr>
<th class="sylius-table-column-item">{{ 'sylius.ui.item'|trans }}</th>
<th class="sylius-table-column-price text-right">{{ 'sylius.ui.unit_price'|trans }}</th>
<th class="sylius-table-column-qty text-right">{{ 'sylius.ui.qty'|trans }}</th>
<th class="sylius-table-column-subtotal text-right">{{ 'sylius.ui.subtotal'|trans }}</th>
<th class="sylius-table-column-price text-end">{{ 'sylius.ui.unit_price'|trans }}</th>
<th class="sylius-table-column-qty text-end">{{ 'sylius.ui.qty'|trans }}</th>
<th class="sylius-table-column-subtotal text-end">{{ 'sylius.ui.subtotal'|trans }}</th>
</tr>
8 changes: 4 additions & 4 deletions SyliusShopBundle/views/Common/Order/Table/_item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

<tr {{ sylius_test_html_attribute('product-row', item.productName) }}>
<td>{% include '@SyliusShop/Product/_info.html.twig' with {'variant': item.variant} %}</td>
<td class="text-right">
<td class="text-end">
{% if item.unitPrice != item.discountedUnitPrice %}
<small class="old-price" {{ sylius_test_html_attribute('product-old-price', item.productName) }}><s>{{ money.convertAndFormat(item.unitPrice) }}</s></small>
{% endif %}
<span class="sylius-unit-price" {{ sylius_test_html_attribute('product-unit-price', item.productName) }}>
{{ money.convertAndFormat(item.discountedUnitPrice) }}
{% if item.unitPrice != item.discountedUnitPrice %}
<span id="item-promotion-details" title="{% for promotion in unit_promotions %}<div>{{ promotion.label }}: {{ money.convertAndFormat(promotion.amount) }}</div>{% endfor %}" data-toggle="tooltip" data-placement="top" >
<span id="item-promotion-details" title="{% for promotion in unit_promotions %}<div>{{ promotion.label }}: {{ money.convertAndFormat(promotion.amount) }}</div>{% endfor %}" data-bs-toggle="tooltip" data-placement="top" >
<i class="fas fa-question-circle"></i>
</span>
{% endif %}
</span>
</td>
<td class="text-right">{{ item.quantity }}</td>
<td class="text-right">{{ money.convertAndFormat(item.subtotal) }}</td>
<td class="text-end">{{ item.quantity }}</td>
<td class="text-end">{{ money.convertAndFormat(item.subtotal) }}</td>
</tr>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<small><s>{{ money.convertAndFormat(order.getAdjustmentsTotal(shipping_adjustment)) }}</s></small>
<span>
<span id="shipping-total" {{ sylius_test_html_attribute('shipping-total') }}>{{ money.convertAndFormat(order.getAdjustmentsTotal(shipping_adjustment) + order.getAdjustmentsTotal(order_shipping_promotion_adjustment)) }}</span>
<span id="shipping-promotion-details" {{ sylius_test_html_attribute('shipping-promotion-details') }} title="{% for label, amount in order_shipping_promotions %}<div>{{ label }}: {{ money.convertAndFormat(amount) }}</div>{% endfor %}" data-toggle="tooltip" data-placement="top" >
<span id="shipping-promotion-details" {{ sylius_test_html_attribute('shipping-promotion-details') }} title="{% for label, amount in order_shipping_promotions %}<div>{{ label }}: {{ money.convertAndFormat(amount) }}</div>{% endfor %}" data-bs-toggle="tooltip" data-placement="top" >
<i class="fas fa-question-circle"></i>
</span>
</span>
Expand Down
Loading