-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25b9c20
commit 7fdbc96
Showing
11 changed files
with
97 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
src/Promotion/Validator/PromotionSubjectCouponsValidator.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends '@SyliusShop/Form/theme.html.twig' %} | ||
|
||
{# No changes with Sylius form #} | ||
{# We copied it to called our `collection_item` #} | ||
{% block collection_widget -%} | ||
{% from '@SyliusResource/Macros/notification.html.twig' import error %} | ||
{% import _self as self %} | ||
{% set attr = attr|merge({'class': attr.class|default ~ ' controls collection-widget'}) %} | ||
|
||
{% apply spaceless %} | ||
<div data-form-type="collection" {{ block('widget_container_attributes') }} | ||
{% if prototype is defined and allow_add %} | ||
data-prototype='{{ self.collection_item(prototype, allow_delete, button_delete_label, prototype.vars.name)|e }}' | ||
data-prototype-name='{{ prototype.vars.name }}' | ||
{%- endif -%} | ||
> | ||
{{ error(form.vars.errors) }} | ||
|
||
{% if prototypes|default is iterable %} | ||
{% for key, subPrototype in prototypes %} | ||
<input type="hidden" data-form-prototype="{{ key }}" | ||
value="{{ self.collection_item(subPrototype, allow_delete, button_delete_label, subPrototype.vars.name)|e }}" | ||
data-subprototype-name="{{ subPrototype.vars.name }}" | ||
/> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
<div data-form-collection="list"> | ||
{% for child in form %} | ||
{{ self.collection_item(child, allow_delete, button_delete_label, loop.index0) }} | ||
{% endfor %} | ||
</div> | ||
|
||
{% if prototype is defined and allow_add %} | ||
<a href="#" class="ui labeled icon button" data-form-collection="add"> | ||
<i class="plus square outline icon"></i> | ||
{{ button_add_label|trans }} | ||
</a> | ||
{% endif %} | ||
</div> | ||
{% endapply %} | ||
{%- endblock collection_widget %} | ||
|
||
{# Same as Sylius one but add `form_errors` #} | ||
{% macro collection_item(form, allow_delete, button_delete_label, index) %} | ||
{% apply spaceless %} | ||
<div data-form-collection="item" data-form-collection-index="{{ index }}"> | ||
{{ form_widget(form) }} | ||
{% if allow_delete %} | ||
<a href="#" data-form-collection="delete" class="ui red labeled icon button" style="margin-bottom: 1em;"> | ||
<i class="trash icon"></i> | ||
{{ button_delete_label|trans }} | ||
</a> | ||
{% endif %} | ||
{{ form_errors(form) }} {# Add this line to show error #} | ||
</div> | ||
{% endapply %} | ||
{% endmacro %} |