Skip to content

Commit

Permalink
DPIB-496: AI Feature integrations. (#11095)
Browse files Browse the repository at this point in the history
AI Feature integrations
  • Loading branch information
dmiseev authored Sep 12, 2024
1 parent dc3269b commit 1ae46d9
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 57 deletions.
8 changes: 8 additions & 0 deletions assets/Zed/js/modules/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ $(document).ready(function () {
tags: true,
});

const dropdownWithParent = $('.spryker-form-select2combobox[dropdown-parent]');

if (dropdownWithParent) {
dropdownWithParent.select2({
dropdownParent: dropdownWithParent.closest(dropdownWithParent.attr('dropdown-parent')),
});
}

$('.spryker-form-select2combobox.ajax:not([class=".tags"])').select2({
tags: false,
preLoaded: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,81 @@
{# @var locale \Generated\Shared\Transfer\LocaleTransfer #}

<div class="well">
{% apply trans|raw %}
<h3>{{ 'Add General Information' | trans }}</h3>
<p>{{ 'Below the name and description for your product can be edited for different locales (in different languages).' | trans }}</p>
<p><i>{{ 'Note: The SKU prefix, just like the SKUs of your product variants, are not editable after saving anymore.' | trans }}</i></p>
{% endapply %}
</div>

{% if merchant is defined and merchant is not empty %}
<div class="row">
<div class="col-xs-2"><strong>{{ 'Merchant' | trans }}</strong></div>
<div class="col-xs-10">
<a target="_blank" href="/merchant-gui/edit-merchant?id-merchant={{ merchant.idMerchant}}">
{{ merchant.name }}
</a>
{% block body %}
{% block information %}
<div class="well">
{% apply trans|raw %}
<h3>{{ 'Add General Information' | trans }}</h3>
<p>{{ 'Below the name and description for your product can be edited for different locales (in different languages).' | trans }}</p>
<p>
<i>{{ 'Note: The SKU prefix, just like the SKUs of your product variants, are not editable after saving anymore.' | trans }}</i>
</p>
{% endapply %}
</div>
</div>
<div class="hr-line-dashed"></div>
{% endif %}

{% if currentProduct is defined %}
{% include '@ProductApprovalGui/Partials/approval_status_label.twig' ignore missing with {
product: currentProduct,
} only %}
{% endif %}

{% if form.store_relation is defined %}
{{ form_widget(form.store_relation) }}
{% endif %}

{{ form_row(form.sku) }}

{% for locale in localeCollection %}
{% set formKey = 'general_' ~ locale.localeName %}

{% if form[formKey] is defined %}

{% embed '@Gui/Partials/localized-ibox.twig' with {'collapsed': (not loop.first), 'localeName': locale.localeName} %}
{% block content %}
{% for input in form[formKey] %}
<div class="form-group {% if input.vars.errors|length %}has-error{% endif %}">
{{ form_label(input) }}
{{ form_widget(input, {'attr': {'class': 'name-translation'}}) }}
{{ form_errors(input) }}
</div>
{% endfor %}
{% endblock %}
{% endembed %}
{% endif %}
{% endfor %}

{% if form.new_from is defined %}
<p>{{ form_row(form.new_from) }}</p>
{% endif %}

{% if form.new_to is defined %}
<p>{{ form_row(form.new_to) }}</p>
{% endif %}

{% if merchant is defined and merchant is not empty %}
<div class="row">
<div class="col-xs-2">
<strong>{{ 'Merchant' | trans }}</strong>
</div>
<div class="col-xs-10">
<a target="_blank" href="/merchant-gui/edit-merchant?id-merchant={{ merchant.idMerchant}}">
{{ merchant.name }}
</a>
</div>
</div>
<div class="hr-line-dashed"></div>
{% endif %}
{% endblock %}

{% block product %}
{% if currentProduct is defined %}
{% include '@ProductApprovalGui/Partials/approval_status_label.twig' ignore missing with {
product: currentProduct,
} only %}
{% endif %}
{% endblock %}

{% block store %}
{% if form.store_relation is defined %}
{{ form_widget(form.store_relation) }}
{% endif %}
{% endblock %}

{% block sku %}
{{ form_row(form.sku) }}
{% endblock %}

{% block description %}
{% for locale in localeCollection %}
{% set formKey = 'general_' ~ locale.localeName %}

{% if form[formKey] is defined %}
{% block descriptionField %}
{% embed '@Gui/Partials/localized-ibox.twig' with {'collapsed': (not loop.first), 'localeName': locale.localeName} %}
{% block content %}
{% for input in form[formKey] %}
<div class="form-group {% if input.vars.errors|length %}has-error{% endif %}">
{{ form_label(input) }}
{{ form_widget(input, {'attr': {'class': 'name-translation js-infomational-field'}}) }}
{{ form_errors(input) }}
</div>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endif %}
{% endfor %}
{% endblock %}

{% block newFrom %}
{% if form.new_from is defined %}
<p>{{ form_row(form.new_from) }}</p>
{% endif %}
{% endblock %}

{% block newTo %}
{% if form.new_to is defined %}
<p>{{ form_row(form.new_to) }}</p>
{% endif %}
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
</div>
</div>
<div class="col-lg-12">
{% for child in form %}
{% if child.vars.attr.template_path is defined and not child.isRendered %}
{% include child.vars.attr.template_path with {'form': child} %}
{% endif %}
{% endfor %}

{{ form_rest(form) }}
</div>
<div class="col-lg-12">
Expand Down

0 comments on commit 1ae46d9

Please sign in to comment.