table th.filtered{border-top:3px solid var(--primary);} | table th.filtered{border-top:3px solid var(--primary);} | ||||
td.actions{white-space: nowrap;} | td.actions{white-space: nowrap;} | ||||
/* Général */ | |||||
/* Général */ | |||||
.btn.btn-primary.action-save{float: right;} | |||||
.input-group-text { | .input-group-text { | ||||
padding: 0.250rem .75rem ; | padding: 0.250rem .75rem ; |
initAdminLtePlugin(); | initAdminLtePlugin(); | ||||
// generateNotice('success', '<i class="fa fa-store"></i> NICHE'); | |||||
//generateNotice('error', 'Ceci est une notice'); | |||||
}); | }); | ||||
function initAdminLtePlugin(){ | function initAdminLtePlugin(){ | ||||
$('[data-toggle="tooltip"]').tooltip() | $('[data-toggle="tooltip"]').tooltip() | ||||
if($('.select2').length) { | |||||
$('.select2').select2({ | |||||
/*theme: 'bootstrap4'*/ | |||||
/*if($('.select2, select.form-control').length) { | |||||
$('.select2,select.form-control').select2({ | |||||
//theme: 'bootstrap' | |||||
}) | }) | ||||
} | } | ||||
if($('.select2-no-search').length) { | if($('.select2-no-search').length) { | ||||
minimumResultsForSearch: Infinity | minimumResultsForSearch: Infinity | ||||
}); | }); | ||||
} | } | ||||
*/ | |||||
product: | product: | ||||
title: Titre | title: Titre | ||||
titleHelp: Un message d'aide | titleHelp: Un message d'aide | ||||
form: | |||||
group: | |||||
group: | |||||
main: Général | |||||
address: Adresse | |||||
default: Édition | |||||
ProductFamily: | |||||
addresses: Livraisons & facturation | |||||
main: Général | main: Général | ||||
products: Déclinaisons | |||||
price: Prix | |||||
categories: Catégories | |||||
unit: Unité & quantité | |||||
tax: TVA | |||||
property: Caractéristiques | |||||
field: | |||||
default: | |||||
id: Id | |||||
status: En ligne | |||||
supplier: Producteur | |||||
title: Titre | |||||
titleHelp: Ceci est une texte d'aide, utilises <i>le nom du champ</i>Help pour en ajouter un | |||||
subtitle: Sous-titre | |||||
kmsHub: Nombre de kilomètres depuis le dépôt | |||||
image: Image | |||||
description: Description | |||||
type: Type | |||||
civility: Civilité | |||||
lastname: Nom | |||||
firstname: Prénom | |||||
country: Pays | |||||
address: Adresse | address: Adresse | ||||
field: | |||||
default: | |||||
supplier: Producteur | |||||
title: Titre | |||||
subtitle: Sous-titre | |||||
kmsHub: Nombre de kilomètres depuis le dépôt | |||||
image: Image | |||||
description: Description | |||||
type: Type | |||||
civility: Civilité | |||||
lastname: Nom | |||||
firstname: Prénom | |||||
country: Pays | |||||
address: Adresse | |||||
zip: Code postal | |||||
city: Ville | |||||
phone: Téléphone | |||||
company: Société | |||||
siret: N° SIRET | |||||
tva: N° TVA | |||||
price: Prix de vente | |||||
ProductFamily: | |||||
productsType: Type de déclinaisons | |||||
buyingPrice: Prix d'achat | |||||
multiplyingFactor: Coefficiant multiplicateur | |||||
priceByRefUnit: Prix de vente / unité de référence | |||||
availableQuantity: Quantité disponible | |||||
availableQuantityDefault: Quantité disponible par défaut | |||||
quantity: Quantité disponible cette semaine | |||||
behaviorCountStock: Gestion du stock | |||||
taxRate: TVA | |||||
unit: Unité | |||||
zip: Code postal | |||||
city: Ville | |||||
phone: Téléphone | |||||
company: Société | |||||
siret: N° SIRET | |||||
tva: N° TVA | |||||
price: Prix de vente | |||||
username: Nom d'utilisateur | |||||
email: E-mail | |||||
plainPassword: Mot de passe | |||||
roles: Rôle attribué | |||||
addresses: Adresses | |||||
enabled: Activé | |||||
isSubscribedNewsletter: Inscris à la newsletter | |||||
zips: Codes postaux | |||||
cities: Villes | |||||
orderPriceMin: Montant minimum de commande | |||||
deliveryPrice: Montant de la livraison | |||||
ProductFamily: | |||||
productsType: Type de déclinaisons | |||||
buyingPrice: Prix d'achat | |||||
multiplyingFactor: Coefficiant multiplicateur | |||||
priceByRefUnit: Prix de vente / unité de référence | |||||
availableQuantity: Quantité disponible | |||||
availableQuantityDefault: Quantité disponible par défaut | |||||
quantity: Quantité disponible cette semaine | |||||
behaviorCountStock: Gestion du stock | |||||
taxRate: TVA | |||||
unit: Unité | |||||
action: | action: | ||||
new: Créer %entity_label% | new: Créer %entity_label% | ||||
switchMerchant: Votre hub | switchMerchant: Votre hub |
{% macro startCard(col, zone = "default") %} | |||||
<div class="col-{{ col }}"> | |||||
<div class="card card-primary"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title"> | |||||
{% set label = "group."~zone %} | |||||
{{ label|trans({}, 'lcshop')|raw }} | |||||
</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
{% endmacro %} | |||||
{% macro endCard() %} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% endmacro %} |
{% endblock delete_form %} | {% endblock delete_form %} | ||||
{% endblock %} | {% endblock %} | ||||
{% block head_stylesheets %} | |||||
{{ parent() }} | |||||
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/jquery-ui/jquery-ui.min.css') }}"> | |||||
{% endblock %} | |||||
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} | ||||
<script type="text/javascript"> | |||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script> | |||||
{#<script type="text/javascript"> | |||||
$(function() { | $(function() { | ||||
$('.edit-form').areYouSure({ 'message': '{{ 'form.are_you_sure'|trans({}, 'EasyAdminBundle')|e('js') }}' }); | $('.edit-form').areYouSure({ 'message': '{{ 'form.are_you_sure'|trans({}, 'EasyAdminBundle')|e('js') }}' }); | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); | ||||
</script> | |||||
{{ include('@EasyAdmin/default/includes/_select2_widget.html.twig') }} | |||||
</script>#} | |||||
{% endblock %} | {% endblock %} |
{% block body_javascript %} | {% block body_javascript %} | ||||
<!-- jQuery --> | <!-- jQuery --> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery.min.js') }}"></script> | |||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery/jquery.min.js') }}"></script> | |||||
<!-- Bootstrap 4 --> | <!-- Bootstrap 4 --> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap.bundle.min.js') }}"></script> | |||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap.bundle.min.js') }}"></script> | |||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script> | <script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script> | |||||
<!-- AdminLTE App --> | <!-- AdminLTE App --> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/adminlte.min.js') }}"></script> | <script src="{{ asset('bundles/lcshop/js/backend/plugin/adminlte.min.js') }}"></script> | ||||
{% endfor %} | {% endfor %} | ||||
{% endblock body_custom_javascript %} | {% endblock body_custom_javascript %} | ||||
</body> | </body> | ||||
{% endblock body %} | {% endblock body %} | ||||
</html> | </html> |
{% for field, metadata in _fields_visible_by_user %} | {% for field, metadata in _fields_visible_by_user %} | ||||
{% set isSortingField = (metadata.property == app.request.get('sortField')) or ('association' == metadata.type and app.request.get('sortField') starts with metadata.property ~ '.') %} | {% set isSortingField = (metadata.property == app.request.get('sortField')) or ('association' == metadata.type and app.request.get('sortField') starts with metadata.property ~ '.') %} | ||||
{% set nextSortDirection = isSortingField ? (app.request.get('sortDirection') == 'DESC' ? 'ASC' : 'DESC') : 'DESC' %} | {% set nextSortDirection = isSortingField ? (app.request.get('sortDirection') == 'DESC' ? 'ASC' : 'DESC') : 'DESC' %} | ||||
{% set _column_label = metadata.label|trans(_trans_parameters) %} | |||||
{% set _column_icon = isSortingField ? (nextSortDirection == 'DESC' ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %} | {% set _column_icon = isSortingField ? (nextSortDirection == 'DESC' ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %} | ||||
{% set searchable = ''%} | {% set searchable = ''%} | ||||
{#<th class="{{ isSortingField ? 'sorted' }} {{ metadata.virtual ? 'virtual' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" >#} | {#<th class="{{ isSortingField ? 'sorted' }} {{ metadata.virtual ? 'virtual' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" >#} | ||||
<th data-searchable="{{ searchable }}" > | <th data-searchable="{{ searchable }}" > | ||||
{% if metadata.sortable %} | {% if metadata.sortable %} | ||||
{#<a href="{{ path('easyadmin', _request_parameters|merge({ page: 1, sortField: metadata.property, sortDirection: nextSortDirection })) }}">#} | |||||
{{ _column_label|raw }} {#<i class="fa fa-fw {{ _column_icon }}"></i>#} | |||||
{#</a>#} | |||||
{{ metadata.fieldName|lc_trad(_entity_config['name']) }} | |||||
{% else %} | {% else %} | ||||
<span>{{ _column_label|raw }}</span> | |||||
<span>{{ metadata.fieldName|lc_trad(_entity_config['name']) }}</span> | |||||
{% endif %} | {% endif %} | ||||
</th> | </th> | ||||
{% endfor %} | {% endfor %} | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/responsive.bootstrap4.min.js') }}"></script> | <script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/responsive.bootstrap4.min.js') }}"></script> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/dataTables.fixedHeader.min.js') }}"></script> | <script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/dataTables.fixedHeader.min.js') }}"></script> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script> | <script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script> | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script> | |||||
{% endblock %} | {% endblock %} |
{% endblock entity_form %} | {% endblock entity_form %} | ||||
{% endblock %} | {% endblock %} | ||||
{% block head_stylesheets %} | |||||
{{ parent() }} | |||||
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/jquery-ui/jquery-ui.min.css') }}"> | |||||
{% endblock %} | |||||
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} | ||||
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script> | |||||
{# | |||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
$(function() { | $(function() { | ||||
$('.new-form').areYouSure({ 'message': '{{ 'form.are_you_sure'|trans({}, 'EasyAdminBundle')|e('js') }}' }); | $('.new-form').areYouSure({ 'message': '{{ 'form.are_you_sure'|trans({}, 'EasyAdminBundle')|e('js') }}' }); | ||||
}, false); | }, false); | ||||
}); | }); | ||||
</script> | </script> | ||||
{{ include('@EasyAdmin/default/includes/_select2_widget.html.twig') }} | |||||
#} | |||||
{#{{ include('@EasyAdmin/default/includes/_select2_widget.html.twig') }}#} | |||||
{% endblock %} | {% endblock %} |
<i class="fa fa-fw fa-image"></i> | <i class="fa fa-fw fa-image"></i> | ||||
</div> | </div> | ||||
<input class="lc-ckfinder-field" type="hidden" name="{{ full_name }}" value="{{ value }}" /> | <input class="lc-ckfinder-field" type="hidden" name="{{ full_name }}" value="{{ value }}" /> | ||||
<button type="button" id="{{ button_id }}" class="btn btn-primary lc-ckfinder-button" {% for attrname, attrvalue in button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ 'action.choiceFile'|trans({}, 'lcshop') }}</button> | |||||
<button type="button" id="{{ button_id }}" class="btn btn-secondary lc-ckfinder-button" {% for attrname, attrvalue in button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ 'action.choiceFile'|trans({}, 'lcshop') }}</button> | |||||
</div> | </div> | ||||
{% endblock %} | {% endblock %} |
</div> | </div> | ||||
{% endif %}#} | {% endif %}#} | ||||
{% if easyadmin.field.help|default(form.vars.help) != '' %} | |||||
<small class="form-help">{{ easyadmin.field.help|default(form.vars.help)|trans(domain = form.vars.translation_domain)|raw }}</small> | |||||
{% set labelHelp = 'form.field.'~easyadmin['entity']['name']~'.'~name~'Help' %} | |||||
{% if labelHelp|trans({}, 'lcshop') == labelHelp %}{% set labelHelp = 'form.field.default.'~name~'Help' %}{% endif %} | |||||
{% if labelHelp|trans({}, 'lcshop') != labelHelp %} | |||||
<small class="form-text text-muted">{{ labelHelp|trans({}, 'lcshop')|raw }}</small> | |||||
{% endif %} | {% endif %} | ||||
{{- form_errors(form) -}} | {{- form_errors(form) -}} | ||||
{% block easyadmin_widget_groups %} | {% block easyadmin_widget_groups %} | ||||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | |||||
{% for group_name, group_config in easyadmin_form_groups|filter(group_config => not group_config.form_tab or group_config.form_tab == tab_name) %} | {% for group_name, group_config in easyadmin_form_groups|filter(group_config => not group_config.form_tab or group_config.form_tab == tab_name) %} | ||||
<div class="field-group col-{{ group_config.columns|default('12') }} {{ group_config.css_class|default('') }}"> | |||||
<div class="card card-primary"> | |||||
{% if group_config.label|default(false) or group_config.icon|default(false) or group_config.collapsible|default(false) %} | |||||
<div class="card-header {{ group_config.icon|default(false) ? 'with-icon' }}"> | |||||
<h3 class="card-title"> | |||||
{% if group_config.icon|default(false) %} | |||||
<i class="fa fa-fw fa-{{ group_config.icon }}"></i> | |||||
{% endif %} | |||||
{% set label = 'form.group.'~group_config.label %} | |||||
{{ label|trans(domain = _translation_domain)|raw }} | |||||
</h3> | |||||
{{ macros.startCard(group_config.columns|default('12'), group_config.label, 'primary') }} | |||||
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.easyadmin.form_group == group_name) %} | |||||
{% if not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name %} | |||||
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}"> | |||||
{{ form_row(field) }} | |||||
</div> | </div> | ||||
{% if group_config.help|default(false) %} | |||||
<div class="legend-help">{{ group_config.help|trans(domain = _translation_domain)|raw }}</div> | |||||
{% endif %} | |||||
{% endif %} | {% endif %} | ||||
{% endfor %} | |||||
{{ macros.endCard() }} | |||||
{% else %} | |||||
<div class="card-body"> | |||||
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.easyadmin.form_group == group_name) %} | |||||
{% if not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name %} | |||||
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}"> | |||||
{{ form_row(field) }} | |||||
</div> | |||||
{% endif %} | |||||
{% endfor %} | |||||
{{ macros.startCard(8) }} | |||||
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name)) %} | |||||
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}"> | |||||
{{ form_row(field) }} | |||||
</div> | </div> | ||||
</div> | |||||
</div> | |||||
{% else %} | |||||
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name)) %} | |||||
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}"> | |||||
{{ form_row(field) }} | |||||
</div> | |||||
{% endfor %} | |||||
{% endfor %} | |||||
{{ macros.endCard() }} | |||||
{% endfor %} | {% endfor %} | ||||
{% endblock easyadmin_widget_groups %} | {% endblock easyadmin_widget_groups %} | ||||
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} | {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} | ||||
{%- endif -%} | {%- endif -%} | ||||
{%- if label_format is not empty -%} | |||||
{# {%- if label_format is not empty -%} | |||||
{% set label = label_format|replace({ | {% set label = label_format|replace({ | ||||
'%name%': name, | '%name%': name, | ||||
'%id%': id, | '%id%': id, | ||||
}) %} | }) %} | ||||
{%- else -%} | {%- else -%} | ||||
{{ name|lc_trad(easyadmin['entity']['name'], 'form') }} | |||||
{% set label = 'form.field.'~easyadmin['entity']['name']~'.'~name %} | {% set label = 'form.field.'~easyadmin['entity']['name']~'.'~name %} | ||||
{% if label|trans({}, 'lcshop') == label %} | |||||
{% set label = 'form.field.default.'~name %} | |||||
{% endif %} | |||||
{%- endif -%} | |||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ label|trans({}, 'lcshop') }}</{{ element|default('label') }}> | |||||
{% if label|trans({}, 'lcshop') == label %}{% set label = 'form.field.default.'~name %}{% endif %} | |||||
{%- endif -%}#} | |||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ name|lc_trad(easyadmin['entity']['name'], 'field') }}</{{ element|default('label') }}> | |||||
{%- endif -%} | {%- endif -%} | ||||
{%- endblock form_label %} | {%- endblock form_label %} |
<div class="row"> | <div class="row"> | ||||
<div class="field-group col-12"> | <div class="field-group col-12"> | ||||
<fieldset> | |||||
<legend>Livraisons & facturation</legend> | |||||
<div class="card card-primary"> | |||||
<div class="card-header"> | |||||
<h3>{{ "form.group.ProductFamily.addresses"|trans }}</h3> | |||||
</div> | |||||
<div class="row" > | <div class="row" > | ||||
<div class="col"> | <div class="col"> |
{{ form_start(form, {"attr": {'@change' : 'formUpdated'}}) }} | {{ form_start(form, {"attr": {'@change' : 'formUpdated'}}) }} | ||||
<div class="lc-vue-js-container" id="lc-product-family-edit"> | |||||
<div id="nav-params"> | |||||
<button type="button" v-for="section in sectionsArray" | |||||
v-if="(section.name == 'products' && activeProducts == true) || (section.name != 'products')" | |||||
:class="'btn '+((currentSection == section.name) ? 'btn-primary' : 'btn-default')" | |||||
@click="changeSection(section)"> | |||||
${ section.nameDisplay } | |||||
<span v-if="section.name == 'products'">({{ form.products|length }})</span> | |||||
<span class="glyphicon glyphicon-triangle-bottom"></span> | |||||
</button> | |||||
<div id="lc-product-family-edit"> | |||||
<div class="card card-light"> | |||||
<div class="lc-vue-js-container card-header p-0 border-bottom-0"> | |||||
<ul class="nav nav-tabs" id="nav-params"> | |||||
<li class="nav-item" v-for="section in sectionsArray"> | |||||
<button type="button" | |||||
v-if="(section.name == 'products' && activeProducts == true) || (section.name != 'products')" | |||||
:class="'btn '+((currentSection == section.name) ? 'btn btn-primary' : 'btn ')" | |||||
@click="changeSection(section)"> | |||||
${ section.nameDisplay } | |||||
<span v-if="section.name == 'products'">({{ form.products|length }})</span> | |||||
<span class="glyphicon glyphicon-triangle-bottom"></span> | |||||
</button> | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="form"> | |||||
<div class="form "> | |||||
<script>// rendered by server | <script>// rendered by server | ||||
window.mixinUnitValues = { | window.mixinUnitValues = { | ||||
<div v-show="currentSection == 'note'" class="panel panel-default"> | <div v-show="currentSection == 'note'" class="panel panel-default"> | ||||
<div class="row" id="lc-app-unit"> | <div class="row" id="lc-app-unit"> | ||||
<div class="field-group col-12"> | <div class="field-group col-12"> | ||||
<fieldset> | |||||
<legend>Note interne</legend> | |||||
{{ form_row(form.note) }} | |||||
</fieldset> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.note"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
{{ form_row(form.note) }} | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="field-group col-12"> | <div class="field-group col-12"> | ||||
<fieldset> | |||||
<legend>Note interne</legend> | |||||
{{ entity.note|raw }} | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.note"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
{{ entity.note|raw }} | |||||
</div> | |||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
{{ form_end(form) }} | {{ form_end(form) }} | ||||
{% trans_default_domain 'lcshop' %} | |||||
<div class="row"> | <div class="row"> | ||||
<div class="field-group col-8"> | <div class="field-group col-8"> | ||||
<fieldset> | |||||
<legend>Général</legend> | |||||
<div class="row"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.main"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body row"> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.supplier) }} | {{ form_row(form.supplier) }} | ||||
</div> | </div> | ||||
{{ form_row(form.description) }} | {{ form_row(form.description) }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="field-group col-4" id="product-categories"> | <div class="field-group col-4" id="product-categories"> | ||||
<fieldset> | |||||
<legend>Déclinaisons</legend> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.products"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
{{ form_row(form.activeProducts, {"attr": {"v-model": 'activeProducts'}}) }} | |||||
{{ form_row(form.activeProducts, {"attr": {"v-model": 'activeProducts'}}) }} | |||||
<div v-show="activeProducts == true"> | |||||
{{ form_row(form.productsType) }} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div v-show="activeProducts == true"> | |||||
{{ form_row(form.productsType) }} | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.categories"|trans }}</h3> | |||||
</div> | </div> | ||||
</fieldset> | |||||
<fieldset> | |||||
<legend>Catégories</legend> | |||||
<div class="row"> | |||||
<div class="card-body"> | |||||
{% for category in categories %} | {% for category in categories %} | ||||
{% set child = 'category_' ~ category.id %} | {% set child = 'category_' ~ category.id %} | ||||
{{ form_row(attribute(form.productCategories, child)) }} | {{ form_row(attribute(form.productCategories, child)) }} | ||||
{% endfor %} | {% endfor %} | ||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> |
{% trans_default_domain 'lcshop' %} | |||||
<product-unit-price ref="productUnitPrice" inline-template key-form="productfamily"> | <product-unit-price ref="productUnitPrice" inline-template key-form="productfamily"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="field-group col-8"> | |||||
<fieldset> | |||||
<legend>Prix</legend> | |||||
<div class="form-group field-price"> | |||||
<div class=" field-group col-4"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.unit"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body row"> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_label(form.buyingPrice) }} | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.buyingPrice, {'attr' : {'v-model': 'buyingPrice', '@change' : 'changeBuyingPriceWithTax'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT {#${ unitReference }#}</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{{ form_row(form.unit, {"attr":{'v-model': 'unit', '@change': "priceByRefUnitUpdate"}}) }} | |||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.buyingPriceWithTax, {'attr' : {'v-model': 'buyingPriceWithTax', '@change' : 'changeBuyingPrice'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ TTC</span> | |||||
<div class="col-12"> | |||||
<div class="form-group field-weight"> | |||||
{{ form_label(form.quantity) }} | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.quantity, {'attr' : {'v-model': 'quantity', '@change': "priceByRefUnitUpdate"}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">${ unit }</span> | |||||
</div> | |||||
</div> | </div> | ||||
{{ form_help(form.quantity) }} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="col-10 align-content-center"> | |||||
{{ form_row(form.multiplyingFactor, {'attr': {'v-model':'multiplyingFactor', '@change' : 'updateMultiplyingFactor'}}) }} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="form-group field-price"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.tax"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body row"> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_label(form.price) }} | |||||
{{ form_row(form.taxRate, {'attr': {'v-model':'taxRate'}}) }} | |||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.price, {'attr' : {'v-model': 'price', '@change' : 'changePriceWithTax'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT</span> | |||||
<div class="col-12"> | |||||
{{ form_row(form.differentSupplierTaxRate, {'attr': {'v-model':'differentSupplierTaxRate'}}) }} | |||||
</div> | |||||
<div class="col-12" v-show="differentSupplierTaxRate == true"> | |||||
{{ form_row(form.supplierTaxRate, {'attr': {'v-model':'supplierTaxRate'}}) }} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="field-group col-8"> | |||||
<div class="card card-light "> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.price"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
<div class="form-group field-price row"> | |||||
<div class="col-12"> | |||||
{{ form_label(form.buyingPrice) }} | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.buyingPrice, {'attr' : {'v-model': 'buyingPrice', '@change' : 'changeBuyingPriceWithTax'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT {#${ unitReference }#}</span> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="col-6"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.priceWithTax, {'attr' : {'v-model': 'priceWithTax', '@change' : 'changePrice'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ TTC</span> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.buyingPriceWithTax, {'attr' : {'v-model': 'buyingPriceWithTax', '@change' : 'changeBuyingPrice'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ TTC</span> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="row"> | |||||
<div class="col-10 align-content-center"> | |||||
{{ form_row(form.multiplyingFactor, {'attr': {'v-model':'multiplyingFactor', '@change' : 'updateMultiplyingFactor'}}) }} | |||||
</div> | |||||
</div> | |||||
<div class="form-group field-price" v-show="unit != 'piece'"> | |||||
<div class="col-12"> | |||||
{{ form_label(form.priceByRefUnit) }} | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.priceByRefUnit, {'attr' : {'v-model': 'priceByRefUnit', 'readonly':'readonly'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT / ${ unitReference }</span> | |||||
<div class="form-group field-price row"> | |||||
<div class="col-12"> | |||||
{{ form_label(form.price) }} | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.price, {'attr' : {'v-model': 'price', '@change' : 'changePriceWithTax'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT</span> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="col-6"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.priceByRefUnitWithTax, {'attr' : {'v-model': 'priceByRefUnitWithTax','readonly':'readonly'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ TTC / ${ unitReference }</span> | |||||
<div class="col-6"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.priceWithTax, {'attr' : {'v-model': 'priceWithTax', '@change' : 'changePrice'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ TTC</span> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
</fieldset> | |||||
</div> | |||||
<div class="field-group col-4"> | |||||
<fieldset> | |||||
<legend>TVA</legend> | |||||
<div class="col-12"> | |||||
{{ form_row(form.taxRate, {'attr': {'v-model':'taxRate'}}) }} | |||||
</div> | |||||
<div class="col-12"> | |||||
{{ form_row(form.differentSupplierTaxRate, {'attr': {'v-model':'differentSupplierTaxRate'}}) }} | |||||
</div> | |||||
<div class="col-12" v-show="differentSupplierTaxRate == true"> | |||||
{{ form_row(form.supplierTaxRate, {'attr': {'v-model':'supplierTaxRate'}}) }} | |||||
</div> | |||||
</fieldset> | |||||
<fieldset> | |||||
<legend>Unité et quantité</legend> | |||||
<div class="col-12"> | |||||
{{ form_row(form.unit, {"attr":{'v-model': 'unit', '@change': "priceByRefUnitUpdate"}}) }} | |||||
</div> | |||||
<div class="col-12"> | |||||
<div class="form-group field-weight"> | |||||
{{ form_label(form.quantity) }} | |||||
<div class="form-widget"> | |||||
<div class="form-group field-price row" v-show="unit != 'piece'"> | |||||
<div class="col-12"> | |||||
{{ form_label(form.priceByRefUnit) }} | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.priceByRefUnit, {'attr' : {'v-model': 'priceByRefUnit', 'readonly':'readonly'}}) }} | |||||
<div class="input-group-append"> | |||||
<span class="input-group-text">€ HT / ${ unitReference }</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="col-6"> | |||||
<div class="input-group"> | <div class="input-group"> | ||||
{{ form_widget(form.quantity, {'attr' : {'v-model': 'quantity', '@change': "priceByRefUnitUpdate"}}) }} | |||||
{{ form_widget(form.priceByRefUnitWithTax, {'attr' : {'v-model': 'priceByRefUnitWithTax','readonly':'readonly'}}) }} | |||||
<div class="input-group-append"> | <div class="input-group-append"> | ||||
<span class="input-group-text">${ unit }</span> | |||||
<span class="input-group-text">€ TTC / ${ unitReference }</span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
{{ form_help(form.quantity) }} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
</fieldset> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</product-unit-price> | |||||
</product-unit-price> |
<td colspan="2" class="price" v-on:click="priceInherited = true"> | <td colspan="2" class="price" v-on:click="priceInherited = true"> | ||||
<div v-show="priceInherited == false"> | <div v-show="priceInherited == false"> | ||||
<div v-if="price" > | |||||
<div v-if="price"> | |||||
{% verbatim %}{{ price }}€{% endverbatim %} | {% verbatim %}{{ price }}€{% endverbatim %} | ||||
</div> | </div> | ||||
<div v-else class="inherited"> | <div v-else class="inherited"> | ||||
</tr> | </tr> | ||||
{% endmacro %} | {% endmacro %} | ||||
{% import _self as formMacros %} | {% import _self as formMacros %} | ||||
<table class="table datagrid sortable lc-sortable-products products-collection-table" | |||||
:data-index="formProductArray.length" | |||||
data-prototype="{{ formMacros.printProductRow(form.products.vars.prototype)|e('html_attr') }}"> | |||||
<thead> | |||||
<tr> | |||||
<th> | |||||
</th> | |||||
<th colspan="3" class="string"> | |||||
Titre | |||||
</th> | |||||
<th colspan="1" class="string "> | |||||
Quantité | |||||
</th> | |||||
<th colspan="2" class="quantity"> | |||||
Unité | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PA HT | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PA TTC | |||||
</th> | |||||
<th colspan="2" class=""> | |||||
Coef | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PV HT | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PV TTC | |||||
</th> | |||||
<th colspan="2" class="priceByRefUnit"> | |||||
PV HT / ${ getUnitReference() } | |||||
</th> | |||||
<th colspan="2" class="priceByRefUnit"> | |||||
PV TTC / ${ getUnitReference() } | |||||
</th> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.products"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
<th class="stock"> | |||||
Stock | |||||
</th> | |||||
<th class="stock"> | |||||
Stock par défaut | |||||
</th> | |||||
<th colspan="2" class=""> | |||||
DLC | |||||
</th> | |||||
<th class=""> | |||||
Action | |||||
</th> | |||||
</tr> | |||||
</thead> | |||||
<tbody class="products-collection"> | |||||
<table class="table datagrid sortable lc-sortable-products products-collection-table" | |||||
:data-index="formProductArray.length" | |||||
data-prototype="{{ formMacros.printProductRow(form.products.vars.prototype)|e('html_attr') }}"> | |||||
<thead> | |||||
<tr> | |||||
<th> | |||||
</th> | |||||
<th colspan="3" class="string"> | |||||
Titre | |||||
</th> | |||||
<th colspan="1" class="string "> | |||||
Quantité | |||||
</th> | |||||
<th colspan="2" class="quantity"> | |||||
Unité | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PA HT | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PA TTC | |||||
</th> | |||||
<th colspan="2" class=""> | |||||
Coef | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PV HT | |||||
</th> | |||||
<th colspan="2" class="price"> | |||||
PV TTC | |||||
</th> | |||||
<th colspan="2" class="priceByRefUnit"> | |||||
PV HT / ${ getUnitReference() } | |||||
</th> | |||||
<th colspan="2" class="priceByRefUnit"> | |||||
PV TTC / ${ getUnitReference() } | |||||
</th> | |||||
<th class="stock"> | |||||
Stock | |||||
</th> | |||||
<th class="stock"> | |||||
Stock par défaut | |||||
</th> | |||||
<th colspan="2" class=""> | |||||
DLC | |||||
</th> | |||||
<th class=""> | |||||
Action | |||||
</th> | |||||
</tr> | |||||
</thead> | |||||
<tbody class="products-collection"> | |||||
<template v-for="(formProduct, key) in formProductArray"> | |||||
<template v-for="(formProduct, key) in formProductArray"> | |||||
<product-form ref="productForm" v-bind:product-family="productFamily" :template="formProduct" | |||||
:key-form="key"></product-form> | |||||
</template> | |||||
<product-form ref="productForm" v-bind:product-family="productFamily" :template="formProduct" | |||||
:key-form="key"></product-form> | |||||
</template> | |||||
</tbody> | |||||
</table> | |||||
<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span | |||||
class="fa fa-plus"></span> Ajouter une déclinaison | |||||
</button> | |||||
<div class="clearfix"></div> | |||||
<script> | |||||
window.productForm = new Array(); | |||||
</script> | |||||
</tbody> | |||||
</table> | |||||
<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span | |||||
class="fa fa-plus"></span> Ajouter une déclinaison | |||||
</button> | |||||
<div class="clearfix"></div> | |||||
<script> | |||||
window.productForm = new Array(); | |||||
</script> | |||||
{% for keyForm,i in sortableProductsField %} | |||||
{% set product = form.products[i] %} | |||||
<script> | |||||
window.productForm[{{ keyForm }}] = { | |||||
{% if product.vars.value.title %}title: "{{ product.vars.value.title }}",{% endif %} | |||||
{% if product.vars.value.quantity %}quantity: "{{ product.vars.value.quantity }}",{% endif %} | |||||
{% if product.vars.value.unit %}unit: "{{ product.vars.value.unit }}",{% endif %} | |||||
{% if product.vars.value.buyingPrice %}buyingPrice: "{{ product.vars.value.buyingPrice }}",{% endif %} | |||||
{% if product.vars.value.price %}price: parseFloat({{ product.vars.value.price }}).toFixed(3),{% endif %} | |||||
{% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}){% endif %} | |||||
{% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}){% endif %} | |||||
{% if product.vars.value.expirationDate %}expirationDate: {{ product.vars.value.expirationDate }}{% endif %} | |||||
}; | |||||
jQuery(window).on('load', function () { | |||||
var formProduct = '{{ formMacros.printProductRow(product)|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}'; | |||||
{% for keyForm,i in sortableProductsField %} | |||||
{% set product = form.products[i] %} | |||||
<script> | |||||
window.productForm[{{ keyForm }}] = { | |||||
{% if product.vars.value.title %}title: "{{ product.vars.value.title }}",{% endif %} | |||||
{% if product.vars.value.quantity %}quantity: "{{ product.vars.value.quantity }}",{% endif %} | |||||
{% if product.vars.value.unit %}unit: "{{ product.vars.value.unit }}",{% endif %} | |||||
{% if product.vars.value.buyingPrice %}buyingPrice: "{{ product.vars.value.buyingPrice }}",{% endif %} | |||||
{% if product.vars.value.price %}price: parseFloat({{ product.vars.value.price }}).toFixed(3),{% endif %} | |||||
{% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}){% endif %} | |||||
{% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}){% endif %} | |||||
{% if product.vars.value.expirationDate %}expirationDate: {{ product.vars.value.expirationDate }}{% endif %} | |||||
}; | |||||
jQuery(window).on('load', function () { | |||||
var formProduct = '{{ formMacros.printProductRow(product)|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}'; | |||||
appProductFamily.formProductArray.push(formProduct); | |||||
appProductFamily.indexFormProduct++; | |||||
}); | |||||
</script> | |||||
appProductFamily.formProductArray.push(formProduct); | |||||
appProductFamily.indexFormProduct++; | |||||
}); | |||||
</script> | |||||
{% endfor %} | |||||
{% endfor %} | |||||
</div> | |||||
</div> | |||||
{% do form.products.setRendered %} | {% do form.products.setRendered %} | ||||
{% trans_default_domain 'lcshop' %} | |||||
<div class="row"> | <div class="row"> | ||||
<div class="field-group col-7"> | <div class="field-group col-7"> | ||||
<fieldset> | |||||
<legend>Caractéristiques</legend> | |||||
<div class="row"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.property"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
<div class="col-5"> | <div class="col-5"> | ||||
{{ form_row(form.isNovelty, {'attr': {'v-model':'isNovelty'}}) }} | {{ form_row(form.isNovelty, {'attr': {'v-model':'isNovelty'}}) }} | ||||
</div> | </div> | ||||
<div class="col-7" v-show="isNovelty==true"> | <div class="col-7" v-show="isNovelty==true"> | ||||
{{ form_row(form.noveltyExpirationDate) }} | {{ form_row(form.noveltyExpirationDate) }} | ||||
</div> | </div> | ||||
</div> | |||||
<div class="row"> | |||||
<div class="col-5"> | <div class="col-5"> | ||||
{{ form_row(form.isOrganic, {'attr': {'v-model':'isOrganic'}}) }} | {{ form_row(form.isOrganic, {'attr': {'v-model':'isOrganic'}}) }} | ||||
</div> | </div> | ||||
<div class="col-7" v-show="isOrganic==true"> | <div class="col-7" v-show="isOrganic==true"> | ||||
{{ form_row(form.organicLabel) }} | {{ form_row(form.organicLabel) }} | ||||
</div> | </div> | ||||
</div> | |||||
<div class="row"> | |||||
<div class="col"> | <div class="col"> | ||||
{{ form_row(form.largeVolume) }} | {{ form_row(form.largeVolume) }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="field-group col-5"> | <div class="field-group col-5"> | ||||
<fieldset> | |||||
<legend>Date d'expiration</legend> | |||||
<div class="row"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.property"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body"> | |||||
<div class="col"> | <div class="col"> | ||||
{{ form_row(form.expirationDate, {'attr': {'v-model':'expirationDate'}}) }} | {{ form_row(form.expirationDate, {'attr': {'v-model':'expirationDate'}}) }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
</div> |
<div class="row"> | |||||
<div class="field-group col-12"> | |||||
<fieldset> | |||||
<legend>Stock</legend> | |||||
<div class="row"> | |||||
<div class="col"> | |||||
{{ form_label(form.behaviorCountStock) }} | |||||
{% for field in form.behaviorCountStock %} | |||||
{% if field.vars.value == "by-product" %} | |||||
<div v-if="activeProducts == true"> | |||||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | |||||
</div> | |||||
{% else %} | |||||
{% trans_default_domain 'lcshop' %} | |||||
<div class="field-group col-12"> | |||||
<div class="card card-light"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title">{{ "form.group.ProductFamily.stock"|trans }}</h3> | |||||
</div> | |||||
<div class="card-body row"> | |||||
<div class="col"> | |||||
{{ form_label(form.behaviorCountStock) }} | |||||
{% for field in form.behaviorCountStock %} | |||||
{% if field.vars.value == "by-product" %} | |||||
<div v-if="activeProducts == true"> | |||||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | {{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | ||||
{% endif %} | |||||
{% endfor %} | |||||
</div> | |||||
<div class="col"> | |||||
<div v-show="behaviorCountStock == 'by-product-family' || behaviorCountStock == 'by-quantity'" | |||||
class="form-group"> | |||||
{{ form_label(form.availableQuantity) }} | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.availableQuantity) }} | |||||
<div v-show="behaviorCountStock == 'by-quantity'" class="input-group-append"> | |||||
<span class="input-group-text">${ getUnitReference() }</span> | |||||
</div> | |||||
</div> | |||||
{% else %} | |||||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | |||||
{% endif %} | |||||
{% endfor %} | |||||
</div> | |||||
<div class="col"> | |||||
<div v-show="behaviorCountStock == 'by-product-family' || behaviorCountStock == 'by-quantity'" | |||||
class="form-group"> | |||||
{{ form_label(form.availableQuantity) }} | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.availableQuantity) }} | |||||
<div v-show="behaviorCountStock == 'by-quantity'" class="input-group-append"> | |||||
<span class="input-group-text">${ getUnitReference() }</span> | |||||
</div> | </div> | ||||
{{ form_help(form.availableQuantity) }} | |||||
</div> | </div> | ||||
{{ form_help(form.availableQuantity) }} | |||||
</div> | |||||
{{ form_label(form.availableQuantityDefault) }} | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.availableQuantityDefault) }} | |||||
<div v-show="behaviorCountStock == 'by-quantity'" class="input-group-append"> | |||||
<span class="input-group-text">${ getUnitReference() }</span> | |||||
</div> | |||||
{{ form_label(form.availableQuantityDefault) }} | |||||
<div class="form-widget"> | |||||
<div class="input-group"> | |||||
{{ form_widget(form.availableQuantityDefault) }} | |||||
<div v-show="behaviorCountStock == 'by-quantity'" class="input-group-append"> | |||||
<span class="input-group-text">${ getUnitReference() }</span> | |||||
</div> | </div> | ||||
{{ form_help(form.availableQuantityDefault) }} | |||||
</div> | </div> | ||||
{{ form_help(form.availableQuantityDefault) }} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</fieldset> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
</div> | |||||
<?php | |||||
namespace Lc\ShopBundle\Twig; | |||||
use Symfony\Contracts\Translation\TranslatorInterface; | |||||
use Twig\Extension\AbstractExtension; | |||||
use Twig\TwigFilter; | |||||
use Twig\TwigFunction; | |||||
class BackendTwigExtension extends AbstractExtension | |||||
{ | |||||
public $trans; | |||||
public function __construct(TranslatorInterface $translator) | |||||
{ | |||||
$this->trans = $translator; | |||||
} | |||||
public function getFunctions() | |||||
{ | |||||
return array( | |||||
); | |||||
} | |||||
public function getFilters() | |||||
{ | |||||
return [ | |||||
new TwigFilter('lc_trad', [$this, 'lcTrad']) | |||||
]; | |||||
} | |||||
public function lcTrad($field, $entityName, $type="field") | |||||
{ | |||||
$tradKey = $type.'.'.$entityName.'.'.$field; | |||||
$tradDefaultKey = $type.'.default.'.$field; | |||||
$trad = $this->trans->trans($tradKey, array(), 'lcshop'); | |||||
if($trad == $tradKey){ | |||||
$trad = $this->trans->trans($tradDefaultKey, array(), 'lcshop'); | |||||
} | |||||
return $trad; | |||||
} | |||||
} |