Commit 61220dcf by Yvon Kerdoncuff

Merge branch '5976-group-admin-see-presta-products' into 'ssa-gironde'

show presta products in presta admin

See merge request cooperatic/kohinos-tav!67
parents 4d623ac5 4d4abca6
...@@ -2154,4 +2154,14 @@ https://github.com/sonata-project/SonataAdminBundle/issues/4022 ...@@ -2154,4 +2154,14 @@ https://github.com/sonata-project/SonataAdminBundle/issues/4022
width: 0.1px !important; width: 0.1px !important;
height: 0.1px !important; height: 0.1px !important;
opacity: 0.01 !important; opacity: 0.01 !important;
}
.prestataire-products-families-row {
display: flex;
gap: 10px;
}
.prestataire-products-families-row .form-group {
flex-basis: 50%;
margin-bottom: 5px;
} }
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"/build/admin.86a2d986.js" "/build/admin.86a2d986.js"
], ],
"css": [ "css": [
"/build/admin.5dc0eea7.css" "/build/admin.4de55830.css"
] ]
} }
} }
......
{ {
"build/app.css": "/build/app.c40ef51c.css", "build/app.css": "/build/app.c40ef51c.css",
"build/app.js": "/build/app.94b71822.js", "build/app.js": "/build/app.94b71822.js",
"build/admin.css": "/build/admin.5dc0eea7.css", "build/admin.css": "/build/admin.4de55830.css",
"build/admin.js": "/build/admin.86a2d986.js", "build/admin.js": "/build/admin.86a2d986.js",
"build/runtime.js": "/build/runtime.6ad5c9da.js", "build/runtime.js": "/build/runtime.6ad5c9da.js",
"build/images/fa-solid-900.svg": "/build/images/fa-solid-900.a838c42a.svg", "build/images/fa-solid-900.svg": "/build/images/fa-solid-900.a838c42a.svg",
......
...@@ -21,6 +21,7 @@ use App\Exporter\CustomDoctrineORMQuerySourceIterator; ...@@ -21,6 +21,7 @@ use App\Exporter\CustomDoctrineORMQuerySourceIterator;
use App\Form\Type\ContactEntityFormType; use App\Form\Type\ContactEntityFormType;
use App\Form\Type\GeolocPrestataireFormType; use App\Form\Type\GeolocPrestataireFormType;
use App\Form\Type\UserFormType; use App\Form\Type\UserFormType;
use App\Form\Type\PrestataireProductFamilyFormType;
use Doctrine\ORM\Query; use Doctrine\ORM\Query;
use FOS\CKEditorBundle\Form\Type\CKEditorType; use FOS\CKEditorBundle\Form\Type\CKEditorType;
use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\Event\UserEvent;
...@@ -369,6 +370,23 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -369,6 +370,23 @@ class PrestataireAdmin extends AbstractAdmin
->end(); ->end();
} }
if ($this->getConfigurationPool()->getContainer()->getParameter('presta_extra_data')) {
$formMapper
->tab('Prestataire')
->with('Prestataire', ['class' => 'col-md-6'])
->add('prestataireProductFamilies', CollectionType::class, [
'label' => 'Produits que le prestataire a renseigné',
'entry_type' => PrestataireProductFamilyFormType::class,
'required' => false,
'disabled' => true,
'entry_options' => [
'attr' => ['class' => 'prestataire-products-families-row'],
],
])
->end()
->end();
}
// @TODO : add tags model transformer if add new from text // @TODO : add tags model transformer if add new from text
// ->get('etats') // ->get('etats')
// ->addModelTransformer(new CallbackTransformer( // ->addModelTransformer(new CallbackTransformer(
......
...@@ -7,7 +7,7 @@ use App\Entity\ProductFamily; ...@@ -7,7 +7,7 @@ use App\Entity\ProductFamily;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
...@@ -19,15 +19,18 @@ class PrestataireProductFamilyFormType extends AbstractType ...@@ -19,15 +19,18 @@ class PrestataireProductFamilyFormType extends AbstractType
->add('productFamily', EntityType::class, array( ->add('productFamily', EntityType::class, array(
'class' => ProductFamily::class, 'class' => ProductFamily::class,
'choice_label' => 'name', 'choice_label' => 'name',
'label' => 'Famille de produits ', 'label' => false,
'required' => true, 'required' => true,
'placeholder' => 'Choisissez une famille', 'placeholder' => 'Choisissez une famille de produits',
'attr' => ['class' => 'prestataire-product-families-select'] 'attr' => ['class' => 'prestataire-product-families-select']
)) ))
->add('products', TextType::class, [ ->add('products', TextareaType::class, [
'label' => 'Produits ', 'label' => false,
'required' => true, 'required' => true,
'attr' => ['class' => 'prestataire-product-families-products'] 'attr' => [
'class' => 'prestataire-product-families-products',
'placeholder' => 'Renseignez des produits correspondant à cette famille'
],
]) ])
; ;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{% block blockcontent %} {% block blockcontent %}
{% set form = getPrestataireInfosForm(app.user) %} {% set form = getPrestataireInfosForm(app.user) %}
{# Create "template" as a macro for a product family entry in the form collection #} {# Use macro as a template : macro for a prestataire product family entry in the form collection #}
{% import _self as formMacros %} {% import _self as formMacros %}
{% macro printPrestataireProductFamilyForm(prestataireProductFamilyForm, formName = "") %} {% macro printPrestataireProductFamilyForm(prestataireProductFamilyForm, formName = "") %}
<div class="presta-products-family"> <div class="presta-products-family">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment