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

[UI] Improve readability of Payment and Shipment states on Order Show #17261

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<div class="card-header">
<div class="card-title">
{% hook 'header' %}
</div>
{% hook 'header' %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{% set order = hookable_metadata.context.resource %}

<span class="ms-2" {{ sylius_test_html_attribute('order-payment-state') }}>
{{ label(order.paymentState) }}
</span>
<div class="ms-auto">
<span class="ms-2" {{ sylius_test_html_attribute('order-payment-state') }}>
{{ label(order.paymentState) }}
</span>
</div>
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{ 'sylius.ui.payments'|trans }}
<div class="card-title">
{{ 'sylius.ui.payments'|trans }}
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<td>
<td class="w-1">
<div class="d-flex gap-1 justify-content-end">
{% hook 'actions' %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<form action="{{ path('sylius_admin_order_payment_complete', {'orderId': order.id, 'id': payment.id}) }}" method="POST" novalidate>
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="_csrf_token" value="{{ csrf_token(payment.id) }}" />
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('complete-payment', payment.id) }}>
<button type="submit" class="btn" {{ sylius_test_html_attribute('complete-payment', payment.id) }}>
{{ icon({ icon: 'check' }) }} {{ 'sylius.ui.complete'|trans }}
</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<form action="{{ path('sylius_admin_order_payment_refund', {'orderId': order.id, 'id': payment.id}) }}" method="POST" novalidate>
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="_csrf_token" value="{{ csrf_token(payment.id) }}" />
<button type="submit" class="btn btn-yellow" {{ sylius_test_html_attribute('refund-payment', payment.id) }}>
<button type="submit" class="btn" {{ sylius_test_html_attribute('refund-payment', payment.id) }}>
{{ icon({ icon: 'arrow_back_up_double' }) }} {{ 'sylius.ui.refund'|trans }}
</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% from '@SyliusAdmin/order/macro/order_payment_state_label.html.twig' import label %}

{% set payment = hookable_metadata.context.payment %}

<td class="w-1" {{ sylius_test_html_attribute('payment-state') }}>
<div class="text-primary strong me-3">{{ ('sylius.ui.' ~ payment.state)|trans|upper }}</div>
{{ label(payment.state) }}
</td>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<div class="card-header">
<div class="card-title">
{% hook 'header' %}
</div>
{% hook 'header' %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{% set order = hookable_metadata.context.resource %}

<span class="ms-2" {{ sylius_test_html_attribute('order-shipping-state') }}>
{{ label(order.shippingState) }}
</span>
<div class="ms-auto">
<span class="ms-2" {{ sylius_test_html_attribute('order-shipping-state') }}>
{{ label(order.shippingState) }}
</span>
</div>
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{ 'sylius.ui.shipments'|trans }}
<div class="card-title">
{{ 'sylius.ui.shipments'|trans }}
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<td>
<td class="w-1">
<div class="d-flex justify-content-end">
{% hook 'actions' %}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% from '@SyliusAdmin/order/macro/order_shipping_state_label.html.twig' import label %}

{% set shipment = hookable_metadata.context.shipment %}

<td class="w-1" {{ sylius_test_html_attribute('shipment-state') }}>
<div class="text-primary strong">{{ ('sylius.ui.' ~ shipment.state)|trans|upper }}</div>
{{ label(shipment.state) }}
</td>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<input type="hidden" name="_method" value="PUT">
<div class="input-group flex-nowrap">
{{ form_widget(form.tracking, sylius_test_form_attribute('shipment-tracking')|sylius_merge_recursive({'attr': {'placeholder': 'sylius.ui.tracking_code'|trans ~ '...', 'style': 'min-width: 130px;'}})) }}
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('shipment-ship-button') }}>
<button type="submit" class="btn" {{ sylius_test_html_attribute('shipment-ship-button') }}>
{{ icon({icon: 'truck'}) }}
{{ 'sylius.ui.ship'|trans }}
</button>
Expand Down
Loading