Browse Source

Correctif backoffice

reduction
Fab 4 years ago
parent
commit
084b8c814a
9 changed files with 45 additions and 17 deletions
  1. +3
    -1
      ShopBundle/Controller/Admin/ProductFamilyController.php
  2. +4
    -0
      ShopBundle/Form/ProductFamilyCategoriesType.php
  3. +1
    -1
      ShopBundle/Repository/ProductCategoryRepository.php
  4. +5
    -0
      ShopBundle/Resources/public/css/backend/custom.css
  5. +6
    -3
      ShopBundle/Resources/public/js/backend/script/default/init-common.js
  6. +5
    -2
      ShopBundle/Resources/translations/lcshop.fr.yaml
  7. +1
    -1
      ShopBundle/Resources/views/backend/default/layout.html.twig
  8. +9
    -7
      ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig
  9. +11
    -2
      ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig

+ 3
- 1
ShopBundle/Controller/Admin/ProductFamilyController.php View File



$formBuilder->add('warningMessageType', ChoiceType::class, array( $formBuilder->add('warningMessageType', ChoiceType::class, array(
'choices' => array( 'choices' => array(
'field.default.warningMessageTypeOptions.alert' => 'alert',
'field.default.warningMessageTypeOptions.success' => 'success',
'field.default.warningMessageTypeOptions.error' => 'error',
'field.default.warningMessageTypeOptions.warning' => 'warning',
'field.default.warningMessageTypeOptions.info' => 'info' 'field.default.warningMessageTypeOptions.info' => 'info'
), ),
'translation_domain' => 'lcshop', 'translation_domain' => 'lcshop',

+ 4
- 0
ShopBundle/Form/ProductFamilyCategoriesType.php View File

'label' => $category->getTitle(), 'label' => $category->getTitle(),
'data' => $currentProductCategories->contains($category), 'data' => $currentProductCategories->contains($category),
'required' => false, 'required' => false,
'disabled'=>true,
'attr'=>[
'class'=>'none'
]
]); ]);
foreach ($category->getChildrens() as $children) { foreach ($category->getChildrens() as $children) {
$builder->add('category_children_' . $children->getId(), CheckboxType::class, [ $builder->add('category_children_' . $children->getId(), CheckboxType::class, [

+ 1
- 1
ShopBundle/Repository/ProductCategoryRepository.php View File

{ {
return $this->findByMerchantQuery() return $this->findByMerchantQuery()
->andWhere('e.parent is NULL') ->andWhere('e.parent is NULL')
->andWhere('e.status >= 0')
->andWhere('e.status = 1')
->orderBy('e.position', 'ASC') ->orderBy('e.position', 'ASC')
->getQuery() ->getQuery()
->getResult(); ->getResult();

+ 5
- 0
ShopBundle/Resources/public/css/backend/custom.css View File

.form-check{padding-left: 0px;} .form-check{padding-left: 0px;}


.form-sent .form-check-label input:invalid ~ .checkmark { border-color: #dc3545;} .form-sent .form-check-label input:invalid ~ .checkmark { border-color: #dc3545;}
.form-check-label input:disabled ~ .checkmark {display: none}
.form-check-label input ~ .checkmark { position: absolute; top: 0; left: 0; height: 18px; width: 18px; background-color: #eee;border: 1px solid var(--primary);} .form-check-label input ~ .checkmark { position: absolute; top: 0; left: 0; height: 18px; width: 18px; background-color: #eee;border: 1px solid var(--primary);}
.form-check-label.big input ~ .checkmark { height: 21px; width: 21px; } .form-check-label.big input ~ .checkmark { height: 21px; width: 21px; }
.form-check-label input[type="checkbox"] ~ .checkmark {top: 2px;} .form-check-label input[type="checkbox"] ~ .checkmark {top: 2px;}
/* Create a custom radio button */ /* Create a custom radio button */




.product-categories .parent .form-group.field-checkbox .form-check-label{padding-left: 0px; font-style: italic;}
.product-categories .children .form-group.field-checkbox{margin-left: 20px}
.product-categories .form-group{margin-bottom: 0.5rem;}



/* Général */ /* Général */
.btn.btn-primary.action-save{float: right;} .btn.btn-primary.action-save{float: right;}

+ 6
- 3
ShopBundle/Resources/public/js/backend/script/default/init-common.js View File





function custom_switch_merchants() { function custom_switch_merchants() {
$('#switch-merchant select').change(function () {
$('#switch-merchant form').submit();
$('#switch-merchant').on('change',function () {
$('#switch-merchant').parents('form').submit();
}); });
} }


var options = { var options = {
width: "100%", width: "100%",
dropdownAutoWidth: false, dropdownAutoWidth: false,
allowClear: false,
allowClear: true,
minimumResultsForSearch: 8 minimumResultsForSearch: 8
}; };


if ($select.data('allow-clear') == 'false') {
options.allowClear= false;
}
if ($select.data('width')) { if ($select.data('width')) {
options.width = 'auto' options.width = 'auto'
} }

+ 5
- 2
ShopBundle/Resources/translations/lcshop.fr.yaml View File

note: Note interne note: Note interne
warningMessageType: Type de message d'avertissement warningMessageType: Type de message d'avertissement
warningMessageTypeOptions: warningMessageTypeOptions:
alert: Alerte
info: Information
warning: Attention (jaune)
info: Information (bleu)
error: Erreur (rouge)
success: Succès (vert)
warningMessage: Contenu du message d'avertissement warningMessage: Contenu du message d'avertissement


ProductFamily: ProductFamily:
taxRateInherited: Utiliser la TVA par défaut
activeProducts: Activer les déclinaisons activeProducts: Activer les déclinaisons
productsType: Type de déclinaisons productsType: Type de déclinaisons
productsTypeHelp: 'Volume / Pods / Varieté / Parfum ...' productsTypeHelp: 'Volume / Pods / Varieté / Parfum ...'

+ 1
- 1
ShopBundle/Resources/views/backend/default/layout.html.twig View File

<label for="switch-merchant"><i <label for="switch-merchant"><i
class="fa fa-store"></i> {{ 'action.switchMerchant'|trans() }} : class="fa fa-store"></i> {{ 'action.switchMerchant'|trans() }} :
</label> </label>
<select id="switch-merchant" class="select2" data-width="auto" name="id_merchant">
<select id="switch-merchant" data-allow-clear="false" data-width="auto" class="select2" name="id_merchant">
{% for merchant in merchants %} {% for merchant in merchants %}
<option value="{{ merchant.id }}" <option value="{{ merchant.id }}"
{% if current_merchant and current_merchant.id == merchant.id %}selected="selected"{% endif %}> {% if current_merchant and current_merchant.id == merchant.id %}selected="selected"{% endif %}>

+ 9
- 7
ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig View File

{{ macros.endCard(true) }} {{ macros.endCard(true) }}
{{ macros.startCard(0, 'ProductFamily.categories','light') }} {{ macros.startCard(0, 'ProductFamily.categories','light') }}


<div class="col-12">
<div class="col-12 product-categories">
{% for category in categories %} {% for category in categories %}
{% set child = 'category_' ~ category.id %} {% set child = 'category_' ~ category.id %}
<div class="parent">
{{ form_row(attribute(form.productCategories, child)) }} {{ form_row(attribute(form.productCategories, child)) }}
</div>
{% for children in category.childrens %}
<div class="children">
{% set child = 'category_children_' ~ children.id %}
{{ form_row(attribute(form.productCategories, child), {attrs: {class: 'test'}}) }}
</div>
{% endfor %}


{% for children in category.childrens %}
<div class="children">
{% set child = 'category_children_' ~ children.id %}
{{ form_row(attribute(form.productCategories, child), {attrs: {class: 'test'}}) }}
</div>
{% endfor %}
{% endfor %} {% endfor %}
</div> </div>
{{ macros.endCard() }} {{ macros.endCard() }}

+ 11
- 2
ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig View File

</div> </div>
<div class="form-group field-price col-12"> <div class="form-group field-price col-12">
<div class="row"> <div class="row">
<div class="col-10 align-content-center">
{{ form_row(form.multiplyingFactor, {'attr': {'v-model':'multiplyingFactor', '@change' : 'updateMultiplyingFactor'}}) }}
<div class="col-6 align-content-center">
<div class="form-widget">
{{ form_label(form.multiplyingFactor) }}
<div class="input-group">
{{ form_widget(form.multiplyingFactor, {'attr': {'v-model':'multiplyingFactor', '@change' : 'updateMultiplyingFactor'}}) }}
<div class="input-group-append">
<span class="input-group-text">X</span>
</div>
</div>
</div>

</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save