Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
templates
/
back
/
product
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/templates/back/product/search.html.twig
{% extends 'back/layout.html.twig' %} {% block title %} Gestion {{'Product'|transchoice(2)}} {% endblock %} {% block content %} {# ///////////////// MODAL DELETE ////////////////////#} <div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Suppression d'un enregistrement</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-secondary rounded" data-dismiss="modal">Fermer</button> <form method="post" action=""> <input id="token" type="hidden" name="_token" value=""> <input type="hidden" name="_method" value="DELETE"> <button type="submit" class="btn btn-danger text-light btn-red rounded">Supprimer</button> </form> </div> </div> </div> </div> {# ///////////////// END MODAL DELETE ////////////////////#} <section class="section-padding"> <div class="container"> <h1>Gestion de produits</h1> <div class="shape"></div> <div class="text-right mt-4"> <a href="{{ path('admin_product_create') }}" class="btn rounded btn-red text-light"> <i class="fa fa-plus" aria-hidden="true"></i> Ajouter un produit </a> </div> <div class="card mt-4 mb-4"> <div class="card-header text-center text-light btn-red" style="background-color:#c11823;"> <h4>Produit phare ( <small> affiché dans l'accueil</small>) </h4> </div> <div class="card-content"> <div class="table-responsive mt-4 mb-4"> <table class="table table-striped table-bordered" width="100%" cellspacing="0" data-page-length='50'> <thead> <tr class="text-center"> <th>{% trans %}Image{% endtrans %}</th> <th>{% trans %}Titre{% endtrans %}</th> <th>{% trans %}Gamme/Categorie{% endtrans %}</th> <th>{% trans %}Prix{% endtrans %}</th> <th>{% trans %}Nouveau{% endtrans %}</th> <th>{% trans %}Actif{% endtrans %}</th> <th>Prix remise</th> <th>Actions</th> </tr> </thead> <tbody> {% for phareProduit in isFlagship %} <tr style="background-color:#CCD1D1" class="text-center"> <td> <div class="thumb-search"> {% if phareProduit.images|length > 0 %} <img src="{{ vich_uploader_asset(phareProduit.images.0, 'imageFile') | imagine_filter('thumb') }}" alt="{{ phareProduit.title }}" class="img-responsive"> {% endif %} </div> </td> <td>{{ phareProduit.title }}</td> <td>{{ phareProduit.gammeProduct }} / {{ phareProduit.category }}</td> <td> {{ phareProduit.price|number_format(2, ',', '') }} € </td> <td>{{ phareProduit.isNewProduct ? '<i class=" fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' }}</td> <td>{{ phareProduit.isActive ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' }}</td> <td> <a href="{{path('admin_discount_search', {'id' :phareProduit.id })}}" class="btn btn-primary"> Voir prix remise</td> </td> <td> <a href="{{ path('admin_product_read', {'id': phareProduit.id}) }}" title="Voir" class="btn btn-secondary rounded p-2" aria-label="Voir"> <i class="fa fa-file"></i> </a> <a href="{{ path('admin_product_update', {'id': phareProduit.id}) }}" title="Modifier" class="btn btn-secondary rounded p-2" aria-label="Modifier"> <i class="fas fa-edit"></i> </a> <a href="#" title="Supprimer" class="btn btn-danger rounded p-2 btn-delete" data-toggle="modal" data-target="#delete" aria-label="Supprimer" id="{{phareProduit.id}}" data-title="{{ phareProduit.title }}" data-path="{{ path('admin_product_delete', {'id': phareProduit.id})}}"> <i class="fa fa-times"></i> </a> </td> </tr> {% else %} <tr> <td colspan="12">Aucun produit phare est selectionné</td> </tr> {% endfor %} </tbody> </table> </div> </div> </div> <div class="card mt-4 mb-4"> <div class="card-header text-center btn-red text-light"> <h4>Liste des produits</h4> </div> <div class="card-content"> <div class="table-responsive mt-4 mb-4"> <table class="table table-striped table-bordered" id="dataTable" width="100%" cellspacing="0" data-page-length='50'> <thead> <tr class="text-center"> <th>{% trans %}Image{% endtrans %}</th> <th>{% trans %}Titre{% endtrans %}</th> <th>{% trans %}Gamme/Categorie{% endtrans %}</th> <th>{% trans %}Prix{% endtrans %}</th> <th>{% trans %}Poids{% endtrans %}</th> <th>{% trans %}Nouveau{% endtrans %}</th> <th>{% trans %}Actif{% endtrans %}</th> <th>{% trans %}Prix remise{% endtrans %}</th> <th>Caractéristiques</th> <th>Actions</th> </tr> </thead> <tbody> {% for product in products %} {% if product.isFlagship == 1 %} <tr style="background-color:#CCD1D1" class="text-center"> {% else %} <tr class="text-center"> {% endif %} {# <td>{{product.id}}</td> #} <td> <div class="thumb-search"> {% if product.images|length > 0 %} <img src="{{ vich_uploader_asset(product.images.0, 'imageFile') | imagine_filter('thumb') }}" alt="{{ product.title }}" class="img-responsive"> {% endif %} </div> </td> <td>{{ product.title }}</td> <td> {% if product.gammeProduct %} {{ product.gammeProduct.name }} {% else %} Non renseigné {% endif %} / {{ product.category }}</td> <td> {{ product.price|number_format(2, ',', '') }} € </td> <td>{{ product.poidsKg }} kg</td> {# <td>{{ product.solde }}</td> <td>{{ product.sale }}</td> #} <td>{{ product.isNewProduct ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' }}</td> <td>{{ product.isActive ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' }}</td> <td> <a href="{{path('admin_discount_search', {'id' :product.id })}}" class="btn btn-primary"> Voir prix remise</td> </td> <td style="width:15%"> <small> <a href="{{ path('admin_product_read', {'id': product.id}) }}" title="Voir" class="btn btn-secondary rounded p-2 " aria-label="Voir"> <i class="fas fa-eye"></i> </a> </small> <small> <a href="{{path('admin_product_update', {'id': product.id}) }}" title="Modifier" class="btn btn-secondary rounded p-2"> <i class="fas fa-edit"></i> </a> </small> <a href="#" title="Supprimer" class="btn btn-danger rounded p-2 btn-delete" data-toggle="modal" data-target="#delete" aria-label="Supprimer" id="{{product.id}}" data-title="{{ product.title }}" data-path="{{ path('admin_product_delete', {'id': product.id})}}"> <i class="fa fa-times"></i> </a> </td> </tr> {% else %} <tr> <td colspan="12">Aucun enregistrement</td> </tr> {% endfor %} </tbody> </tbody> </table> </div> </div> </div> </section> {% endblock %} {% block javascripts %} {{ parent() }} <script src="{{ asset('datatables/jquery.dataTables.js')}}"></script> <script src="{{ asset('datatables/dataTables.bootstrap4.js')}}"></script> <script> $(document).ready(function () { $(document).on("click", ".btn-delete", function () { var id = $(this).attr('id'); var title = $(this).attr('data-title'); var path = $(this).attr('data-path'); $('.modal-footer form').attr('action', path); $('#token').val("{{ csrf_token('delete' ~"+id+") }}"); $('.modal-body').html("<p>Confirmez-vous la suppression du produit: <strong>" + title + "</strong></p>"); }); }); </script> <script> $(document).ready(function () { $("#dataTable").DataTable() }); </script> <script type="text/javascript"> $('#dataTable').DataTable({ language: { processing: "Traitement en cours...", search: "Rechercher :", lengthMenu: "Afficher _MENU_ éléments", info: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", infoEmpty: "Affichage de l'élement 0 à 0 sur 0 éléments", infoFiltered: "(filtré de _MAX_ éléments au total)", infoPostFix: "", loadingRecords: "Chargement en cours...", zeroRecords: "Aucun élément à afficher", emptyTable: "Aucune donnée disponible dans le tableau", paginate: { first: "Premier", previous: "Précédent", next: "Suivant", last: "Dernier" }, aria: { sortAscending: ": activer pour trier la colonne par ordre croissant", sortDescending: ": activer pour trier la colonne par ordre décroissant" } }, aaSorting: [] }); </script> <style> .btn-red{ background-color:#c11823; } {% endblock %}