Browse Source

[Backend] Correctifs multiples

feature/tableau_edition_avancee
Fab 4 years ago
parent
commit
1be289e790
4 changed files with 32 additions and 18 deletions
  1. +1
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  2. +9
    -2
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  3. +20
    -14
      ShopBundle/Resources/views/backend/default/layout/layout.html.twig
  4. +2
    -1
      ShopBundle/Services/ProductFamilyUtils.php

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

delete: Supprimer delete: Supprimer
send: Envoyer send: Envoyer
duplicate: Dupliquer duplicate: Dupliquer
duplicateOtherHub: Dupliquer sur un autre hub
duplicateOtherHub: Dupliquer sur %title%
sortProductFamily: Trier les produits de cette catégorie sortProductFamily: Trier les produits de cette catégorie
group: group:
main: Général main: Général

+ 9
- 2
ShopBundle/Resources/views/backend/default/block/action.html.twig View File


{% set title = "" %}
{% if merchant is defined %}
{% set title = merchant.title %}
{% endif %}
{% if is_dropdown %} {% if is_dropdown %}

<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" <a class="btn dropdown-item {{ action.css_class|default('btn-default') }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}
</a> </a>

{% else %} {% else %}
{% if action.hub is defined %} {% if action.hub is defined %}
{% set trad = action.label~action.hub|uc_first %} {% set trad = action.label~action.hub|uc_first %}
{% endif %} {% endif %}
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}" <a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a> </a>

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

<!-- Google Font: Source Sans Pro --> <!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">


{#<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">#}
{# <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}"> #}
{% endblock %} {% endblock %}


{% block head_custom_stylesheets %} {% block head_custom_stylesheets %}
{% endblock head_custom_stylesheets %} {% endblock head_custom_stylesheets %}


{# {#
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
#} #}


{% block head_favicon %} {% block head_favicon %}
</head> </head>


{% block body %} {% block body %}
<body id="pdl-body" class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
<body id="pdl-body"
class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
{# <script> {# <script>
document.body.classList.add( document.body.classList.add(
'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), 'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'),
'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal') 'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal')
); );
</script>#}
</script> #}


{% block wrapper_wrapper %} {% block wrapper_wrapper %}
<div class="wrapper"> <div class="wrapper">
{% endif %} {% endif %}
</li> </li>
<li> <li>
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% if 'localhost' in app.request.getSchemeAndHttpHost() %}
<a target="_blank" class="btn btn-outline-success"
href="{{ app.request.getSchemeAndHttpHost() }}">Afficher le site</a>
{% else %}
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% endif %}
</li> </li>
</ul> </ul>
{% endblock navbar %} {% endblock navbar %}
{% block global_actions_wrapper %} {% block global_actions_wrapper %}
<div class="global-actions"> <div class="global-actions">
{% block global_actions %}{% endblock %} {% block global_actions %}{% endblock %}
{#{{ dump(_request_parameters) }}#}
{# {{ dump(_request_parameters) }} #}
<button type="button" class="btn-sm btn-primary btn-add-reminder " <button type="button" class="btn-sm btn-primary btn-add-reminder "
data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}"> data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}">
+ Ajouter pense bête + Ajouter pense bête
{% endblock wrapper_wrapper %} {% endblock wrapper_wrapper %}




{#Initilisation des varibles requis dans le JS #}
{# Initilisation des varibles requis dans le JS #}
<script> <script>
const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}"; const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}";
</script> </script>
<!-- Bootstrap 4 --> <!-- Bootstrap 4 -->
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/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>#}
{# <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script> #}
<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.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>
<!-- AdminLTE App --> <!-- AdminLTE App -->

+ 2
- 1
ShopBundle/Services/ProductFamilyUtils.php View File

$entity->addProduct($originProduct); $entity->addProduct($originProduct);


foreach ($entity->getProducts() as $product) { foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity);

if($entity->getProductsQuantityAsTitle() && $product->getStatus()>=1){ if($entity->getProductsQuantityAsTitle() && $product->getStatus()>=1){
$product->setTitle(str_replace('.', ',',$product->getQuantityInherited()).$product->getUnitInherited()->getWording()); $product->setTitle(str_replace('.', ',',$product->getQuantityInherited()).$product->getUnitInherited()->getWording());
} }


$product->setProductFamily($entity);
$this->em->persist($product); $this->em->persist($product);
$entity->addProduct($product); $entity->addProduct($product);
} }

Loading…
Cancel
Save