Browse Source

Merge branch 'master' into develop

packProduct
Fabien Normand 3 years ago
parent
commit
fe53e002a9
4 changed files with 13 additions and 6 deletions
  1. +3
    -3
      Model/Reduction/ReductionCatalogModel.php
  2. +1
    -1
      Resources/assets/app/admin/switchmerchant/switchmerchant.js
  3. +7
    -2
      Resources/views/admin/merchant/modal/switch_merchant.html.twig
  4. +2
    -0
      Resources/views/adminlte/layout.html.twig

+ 3
- 3
Model/Reduction/ReductionCatalogModel.php View File

use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyTrait; use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel; use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
return $this; return $this;
} }



public function getProductFamily(): ?ProductFamilyModel
public function getProductFamily(): ?ProductFamilyInterface
{ {
return $this->productFamily; return $this->productFamily;
} }


public function setProductFamily(?ProductFamilyModel $productFamily): self
public function setProductFamily(?ProductFamilyInterface $productFamily): self
{ {
$this->productFamily = $productFamily; $this->productFamily = $productFamily;



+ 1
- 1
Resources/assets/app/admin/switchmerchant/switchmerchant.js View File

}) ; }) ;


function initSwitchMerchant() { function initSwitchMerchant() {
let $form = $('form.switch-merchant') ;
let $form = $('.nav-switch-merchant form.switch-merchant') ;
$form.find('select').change(function() { $form.find('select').change(function() {
$form.submit() ; $form.submit() ;
}) ; }) ;

+ 7
- 2
Resources/views/admin/merchant/modal/switch_merchant.html.twig View File

{% set form_switch_merchant = carac_form_switch_merchant('admin', 'carac_merchant_favorite') %} {% set form_switch_merchant = carac_form_switch_merchant('admin', 'carac_merchant_favorite') %}
{% form_theme form_switch_merchant '@LcSov/adminlte/crud/form_theme.html.twig' %} {% form_theme form_switch_merchant '@LcSov/adminlte/crud/form_theme.html.twig' %}
{{ form_start(form_switch_merchant) }} {{ form_start(form_switch_merchant) }}
{{ form(form_switch_merchant) }}
<div class="hidden">
{{ form_widget(form_switch_merchant.merchant, {attr:{'class': 'disable-select2'}}) }}
</div>
{{ form_rest(form_switch_merchant) }}

{{ form_end(form_switch_merchant) }} {{ form_end(form_switch_merchant) }}
<button id="carac-button-visit-merchant" type="button" class="btn btn-default" <button id="carac-button-visit-merchant" type="button" class="btn btn-default"
data-dismiss="modal">Visiter</button>
data-dismiss="modal">Visiter
</button>
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}

+ 2
- 0
Resources/views/adminlte/layout.html.twig View File

{% set user = app.user %} {% set user = app.user %}
{% set merchant_current = merchant_current() %} {% set merchant_current = merchant_current() %}


{{ dump( merchant_current)}}
{{ dump( user.favoriteMerchant )}}
{% if(user.favoriteMerchant != merchant_current) %} {% if(user.favoriteMerchant != merchant_current) %}
{# modal affichée uniquement si la sessionStorage.visit_merchant n'est pas défini (js) #} {# modal affichée uniquement si la sessionStorage.visit_merchant n'est pas défini (js) #}
{% include '@LcCaracole/admin/merchant/modal/switch_merchant.html.twig' %} {% include '@LcCaracole/admin/merchant/modal/switch_merchant.html.twig' %}

Loading…
Cancel
Save