-
Notifications
You must be signed in to change notification settings - Fork 38
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
Showing
15 changed files
with
200 additions
and
76 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 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,57 @@ | ||
twig_hooks: | ||
hooks: | ||
'sylius_admin.product.create.content.form.side_navigation': | ||
general: | ||
template: '@SyliusAdmin/product/form/side_navigation/general.html.twig' | ||
configuration: | ||
active: true | ||
channel_pricing: | ||
template: '@SyliusAdmin/product/form/side_navigation/channel_pricing.html.twig' | ||
taxes: | ||
template: '@SyliusAdmin/product/form/side_navigation/taxes.html.twig' | ||
shipping: | ||
template: '@SyliusAdmin/product/form/side_navigation/shipping.html.twig' | ||
inventory: | ||
template: '@SyliusAdmin/product/form/side_navigation/inventory.html.twig' | ||
translations: | ||
template: '@SyliusAdmin/product/form/side_navigation/translations.html.twig' | ||
taxonomy: | ||
template: '@SyliusAdmin/product/form/side_navigation/taxonomy.html.twig' | ||
attributes: | ||
template: '@SyliusAdmin/product/form/side_navigation/attributes.html.twig' | ||
associations: | ||
template: '@SyliusAdmin/product/form/side_navigation/associations.html.twig' | ||
media: | ||
template: '@SyliusAdmin/product/form/side_navigation/media.html.twig' | ||
bundle: | ||
template: '@BitBagSyliusProductBundlePlugin/Admin/product/form/side_navigation/bundle.html.twig' | ||
|
||
'sylius_admin.product.create.content.form.sections': | ||
general: | ||
template: '@SyliusAdmin/product/form/sections/general.html.twig' | ||
configuration: | ||
active: true | ||
channel_pricing: | ||
template: '@SyliusAdmin/product/form/sections/channel_pricing.html.twig' | ||
taxes: | ||
template: '@SyliusAdmin/product/form/sections/taxes.html.twig' | ||
shipping: | ||
template: '@SyliusAdmin/product/form/sections/shipping.html.twig' | ||
inventory: | ||
template: '@SyliusAdmin/product/form/sections/inventory.html.twig' | ||
translations: | ||
template: '@SyliusAdmin/product/form/sections/translations.html.twig' | ||
taxonomy: | ||
template: '@SyliusAdmin/product/form/sections/taxonomy.html.twig' | ||
attributes: | ||
template: '@SyliusAdmin/product/form/sections/attributes.html.twig' | ||
associations: | ||
template: '@SyliusAdmin/product/form/sections/associations.html.twig' | ||
media: | ||
template: '@SyliusAdmin/product/form/sections/media.html.twig' | ||
bundle: | ||
template: '@BitBagSyliusProductBundlePlugin/Admin/product/form/sections/bundle.html.twig' | ||
|
||
'sylius_admin.product.create.content.form.sections.bundle': | ||
item: | ||
template: '@BitBagSyliusProductBundlePlugin/Admin/Form/productBundleItem.html.twig' |
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,2 @@ | ||
imports: | ||
- { resource: "@BitBagSyliusProductBundlePlugin/Resources/config/twig_hooks/product/create.yaml" } |
122 changes: 61 additions & 61 deletions
122
src/Resources/views/Admin/Form/productBundleItem.html.twig
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 |
---|---|---|
@@ -1,68 +1,68 @@ | ||
{% extends '@SyliusUi/Form/theme.html.twig' %} | ||
{#{% extends '@SyliusUi/Form/theme.html.twig' %}#} | ||
|
||
{% 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'}) %} | ||
{#{% 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) }} | ||
{# {% 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, '__name__')|e }}" /> | ||
{% endfor %} | ||
{% endif %} | ||
{# {% 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, '__name__')|e }}" />#} | ||
{# {% endfor %}#} | ||
{# {% endif %}#} | ||
|
||
<table class="ui stackable celled table"> | ||
<thead> | ||
<tr> | ||
<th>{{ 'bitbag_sylius_product_bundle.ui.product_variant'|trans }}</th> | ||
<th>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}</th> | ||
<th>{{ 'bitbag_sylius_product_bundle.ui.delete'|trans }}</th> | ||
</tr> | ||
</thead> | ||
<tbody data-form-collection="list"> | ||
{% for child in form %} | ||
{{ self.collection_item(child, allow_delete, button_delete_label, loop.index0) }} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{# <table class="ui stackable celled table">#} | ||
{# <thead>#} | ||
{# <tr>#} | ||
{# <th>{{ 'bitbag_sylius_product_bundle.ui.product_variant'|trans }}</th>#} | ||
{# <th>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}</th>#} | ||
{# <th>{{ 'bitbag_sylius_product_bundle.ui.delete'|trans }}</th>#} | ||
{# </tr>#} | ||
{# </thead>#} | ||
{# <tbody data-form-collection="list">#} | ||
{# {% for child in form %}#} | ||
{# {{ self.collection_item(child, allow_delete, button_delete_label, loop.index0) }}#} | ||
{# {% endfor %}#} | ||
{# </tbody>#} | ||
{# </table>#} | ||
|
||
{% if prototype is defined and allow_add %} | ||
<a href="#" class="ui labeled icon button" data-form-collection="add" id="bitbag_add_product_to_bundle_button"> | ||
<i class="plus square outline icon"></i> | ||
{{ button_add_label|trans }} | ||
</a> | ||
{% endif %} | ||
</div> | ||
{% endapply %} | ||
{%- endblock collection_widget %} | ||
{# {% if prototype is defined and allow_add %}#} | ||
{# <a href="#" class="ui labeled icon button" data-form-collection="add" id="bitbag_add_product_to_bundle_button">#} | ||
{# <i class="plus square outline icon"></i>#} | ||
{# {{ button_add_label|trans }}#} | ||
{# </a>#} | ||
{# {% endif %}#} | ||
{# </div>#} | ||
{# {% endapply %}#} | ||
{#{%- endblock collection_widget %}#} | ||
|
||
{% macro collection_item(form, allow_delete, button_delete_label, index) %} | ||
{% apply spaceless %} | ||
<tr data-form-collection="item" data-form-collection-index="{{ index }}"> | ||
<td> | ||
<div id="add_product_to_bundle_autocomplete"> {{ form_row(form.productVariant, {'remote_url': path('bitbag_product_bundle_admin_ajax_product_variants_by_phrase'), 'remote_criteria_type': 'contains', 'remote_criteria_name': 'phrase', 'load_edit_url': path('bitbag_product_bundle_admin_ajax_product_variants_by_codes')}) }} </div> | ||
</td> | ||
<td> | ||
{{ form_row(form.quantity) }} | ||
</td> | ||
{#{% macro collection_item(form, allow_delete, button_delete_label, index) %}#} | ||
{# {% apply spaceless %}#} | ||
{# <tr data-form-collection="item" data-form-collection-index="{{ index }}">#} | ||
{# <td>#} | ||
{# <div id="add_product_to_bundle_autocomplete"> {{ form_row(form.productVariant, {'remote_url': path('bitbag_product_bundle_admin_ajax_product_variants_by_phrase'), 'remote_criteria_type': 'contains', 'remote_criteria_name': 'phrase', 'load_edit_url': path('bitbag_product_bundle_admin_ajax_product_variants_by_codes')}) }} </div>#} | ||
{# </td>#} | ||
{# <td>#} | ||
{# {{ form_row(form.quantity) }}#} | ||
{# </td>#} | ||
|
||
{% if allow_delete %} | ||
<td> | ||
<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> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endapply %} | ||
{% endmacro %} | ||
{# {% if allow_delete %}#} | ||
{# <td>#} | ||
{# <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>#} | ||
{# </td>#} | ||
{# {% endif %}#} | ||
{# </tr>#} | ||
{# {% endapply %}#} | ||
{#{% endmacro %}#} |
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
src/Resources/views/Admin/product/form/sections/bundle.html.twig
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,21 @@ | ||
{#{% form_theme form '@BitBagSyliusProductBundlePlugin/Admin/Form/productBundleItem.html.twig' %}#} | ||
{% set form = hookable_metadata.context.form %} | ||
{% set product = hookable_metadata.context.resource %} | ||
|
||
<div class="tab pane " id="product-bundle" role="tabpanel" tabindex="0"> | ||
<div class="card mb-3"> | ||
<div class="card-header"> | ||
<h2 id="productBundle" class="card-title"> | ||
{{ 'bitbag_sylius_product_bundle.ui.bundle'|trans }} | ||
</h2> | ||
</div> | ||
<div class="card-body"> | ||
{{ dump(form) }} | ||
{{ form_row(form.productBundle.isPackedProduct) }} | ||
{{ form_row(form.productBundle.productBundleItems) }} | ||
{# {{ sonata_block_render_event('sylius.admin.product.' ~ action ~ '.tab_bundle', {'form': form }) }}#} | ||
{% hook 'bundle' with { product } %} | ||
</div> | ||
</div> | ||
|
||
</div> |
10 changes: 10 additions & 0 deletions
10
src/Resources/views/Admin/product/form/side_navigation/bundle.html.twig
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,10 @@ | ||
<button | ||
type="button" | ||
class="list-group-item list-group-item-action {% if hookable_metadata.configuration.active|default(false) %}active{% endif %}" | ||
data-bs-toggle="tab" | ||
data-bs-target="#product-bundle" | ||
role="tab" | ||
{{ sylius_test_html_attribute('side-navigation-tab', 'bundle') }} | ||
> | ||
{{ 'bitbag_sylius_product_bundle.ui.bundle'|trans }} | ||
</button> |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
sylius_admin: | ||
resource: "@SyliusAdminBundle/Resources/config/routing.yml" | ||
prefix: /admin | ||
|
||
live_component: | ||
resource: "@LiveComponentBundle/config/routes.php" | ||
prefix: /_components |
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