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

Change partial refunds inputs UI + fix UI validation #84

Merged
merged 1 commit into from
Oct 3, 2018
Merged
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
16 changes: 12 additions & 4 deletions src/Resources/views/orderRefunds.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@
<td class="aligned collapsing partial-refund">
{% set inputName = "sylius_refund_units["~unitNumber~"][amount]" %}
{% set hiddenInputName = "sylius_refund_units["~unitNumber~"][partial-id]" %}
<input type="number" name="{{ inputName }}" {% if not can_unit_be_refunded(unit.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::ORDER_ITEM_UNIT')) %} disabled{% endif %}/>
<input type="hidden" name="{{ hiddenInputName }}" value="{{ unit.id }}"/>

<div class="ui labeled input">
<div class="ui label">{{ order.currencyCode|sylius_currency_symbol }}</div>
<input type="text" name="{{ inputName }}" {% if not can_unit_be_refunded(unit.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::ORDER_ITEM_UNIT')) %} disabled{% endif %}/>
<input type="hidden" name="{{ hiddenInputName }}" value="{{ unit.id }}"/>
</div>
</td>
<td class="aligned collapsing">
<div class="ui checkbox {% if not can_unit_be_refunded(unit.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::ORDER_ITEM_UNIT')) %} disabled{% endif %}">
Expand Down Expand Up @@ -108,8 +112,12 @@
<td class="aligned collapsing partial-refund">
{% set inputName = "sylius_refund_shipments[0][amount]" %}
{% set hiddenInputName = "sylius_refund_shipments[0][partial-id]" %}
<input type="number" name="{{ inputName }}" {% if not can_unit_be_refunded(shipment.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT')) %} disabled{% endif %}/>
<input type="hidden" name="{{ hiddenInputName }}" value="{{ shipment.id }}"/>

<div class="ui labeled input">
<div class="ui label">{{ order.currencyCode|sylius_currency_symbol }}</div>
<input type="text" name="{{ inputName }}" {% if not can_unit_be_refunded(shipment.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT')) %} disabled{% endif %}/>
<input type="hidden" name="{{ hiddenInputName }}" value="{{ shipment.id }}"/>
</div>
</td>
<td class="aligned collapsing">
<div class="ui checkbox {% if not can_unit_be_refunded(shipment.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT')) %} disabled{% endif %}">
Expand Down