templates/admin/category/edit/editCategory.html.twig line 1

Open in your IDE?
  1. {% extends 'admin/baseAdmin.html.twig' %}
  2. {% block page_title %}Modifier Categorie{% endblock %}
  3. {% block breadcump_main %}Categorie{% endblock %}
  4. {% block breadcump_subtitle %}Modification de catégorie{% endblock %}
  5. {% block menu_left_sidebar %}
  6.     {% include 'include/menu/menuAdmin.html.twig' with { menu_active_event : '2'} %}
  7. {% endblock %}
  8. {% block stylesheets %}
  9.     <link href="{{ asset('admin/libs/select2/css/select2.min.css') }}" rel="stylesheet" type="text/css">
  10.     <link href="{{ asset('admin/css/tailwind.min.css') }}" rel="stylesheet" type="text/css">
  11.     <link href="{{ asset('admin/css/tailwind2.css') }}" rel="stylesheet" type="text/css">
  12. {% endblock %}
  13. {% block title %}{{"Modifier categorie"|trans }}{% endblock %} 
  14. {% block content %}
  15.             <div class="container-fluid">
  16.                 <div class="row">
  17.                     <div class="col-xl-12 px-0">
  18.                         <div class="card">
  19.                             <div class="card-body">
  20.                                 <form class="p-1 " method="post" action="{{ path('edit_category',{'id':category.id})}}" enctype="multipart/form-data"  >
  21.                                     <div class="row">
  22.                                         <h5 class="text-base col-md-2 col-sm-12 px-0 ">Image du category </h5>
  23.                                         <div class="m-auto my-1 relative col-10">
  24.                                             <label for="avatar-upload" class="relative flex justify-center" style="cursor: pointer;">
  25.                                                 <img class="w-full h-72 rounded-lg m-auto object-cover" src="{{ asset(''~category.image)}}" alt="category image" id="avatar-img">
  26.                                                 <div class="h-10 w-10 bg-orange rounded-full flex  items-center justify-center" style="position: absolute;right: 43%;bottom: 4px;font-size: 43px;">
  27.                                                     <i class="bx bxs-image-alt text-xl text-white"></i>
  28.                                                 </div>
  29.                                                 <input type="file" id="avatar-upload" name='image' value="{{ category.image }}" style="display: none;" accept="image/*" onchange="changeAvatar(event)">
  30.                                             </label>
  31.                                         </div>
  32.                                     </div>
  33.                                     <h5 class="text-base sm:text-lg font-semibold mt-5 ">Information General du category</h5>
  34.                                     <p class="pb-4 text-gray-700 text-xs sm:text-sm">Decrivez la category par ses caracteristiques. </p>
  35.                                     <div class="row mb-4">
  36.                                         <div class="form-floating col-md-12 col-sm-12 ">
  37.                                             <input type="text" name="name" value="{{ category.name }}"
  38.                                                    class="form-control sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 ps-5"
  39.                                                    id="nom" placeholder="">
  40.                                             <label class="mb-2 ms-2 ps-5 text-sm font-medium text-gray-900 " for="nom">Nom du Category</label>
  41.                                             <div class="absolute" style="top: 11px;left: 17px;color: #a1a1a1;">
  42.                                                 <i class="bx bx-grid-small" style="font-size: 36px;"></i>
  43.                                             </div>
  44.                                         </div>
  45.                                     </div>
  46.                                     <div class="row mb-4">
  47.                                         <div class="form-floating">
  48.                                             <textarea class="form-control px-5" placeholder="description du category" id="floatingTextarea2" name='description' style="height: 100px">{{ category.description }}</textarea>
  49.                                             <label class="mb-2 ms-2 ps-5 text-sm font-medium text-gray-900 " for="floatingTextarea2">Description du Category</label>
  50.                                             <div class="absolute" style="top: 15px;left: 23px;color: #a1a1a1;">
  51.                                                 <i class="bx bx-notepad text-2xl"></i>
  52.                                             </div>
  53.                                         </div>
  54.                                     </div>
  55.                                     <div class="form-floating col-md-12 col-sm-12  mb-4">
  56.                                         <input value="{{ category.ordre }}" type="number" name="ordre"
  57.                                                class="form-control sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 ps-5"
  58.                                                id="nom" placeholder="">
  59.                                         <label class="mb-2 ms-2 ps-5 text-sm font-medium text-gray-900 " for="nom">Category order</label>
  60.                                         <div class="absolute" style="top: 15px;left: 13px;color: #a1a1a1;">
  61.                                             <i class="bx bx-sort-a-z" style="font-size: 29px;"></i>
  62.                                         </div>
  63.                                     </div>
  64.                                     <div class="mb-3 flex items-center text-base">
  65.                                         <label for="example-color-input" class="pr-24">Color</label>
  66.                                         <div class="">
  67.                                             <input class="form-control form-control-color mw-100" type="color" name='color' value="{{ category.color }}" id="example-color-input">
  68.                                         </div>
  69.                                         <p class="text-xs text-gray-500 pl-4">*Color principale de la sous categorie</p>
  70.                                     </div>
  71.                                     <div class="flex gap-20 mt-4">
  72.                                         <label for="example-text-input" class="block font-medium text-gray-700  dark:text-zink-200 text-13">Visibilite du Category :</label>
  73.                                         <div class=" flex gap-2">
  74.                                             <!-- "Afficher" button -->
  75.                                             <button type="button" class="flex font-medium items-center px-2 text-gray-900 text-lg w-full">
  76.                                                 <div class="flex items-center">
  77.                                                     <div class="relative inline-block w-10 mr-2 align-middle transition duration-200 ease-in">
  78.                                                         <input type="radio" name="visibility" id="radio-show" class="absolute block w-5 h-5 transition duration-300 ease-linear border-2 border-gray-200 rounded-sm appearance-none cursor-pointer bg-white/80 peer/published checked:bg-white checked:right-0 checked:border-green-500 arrow-none">
  79.                                                         <label for="radio-show" class="block h-5 overflow-hidden transition duration-300 ease-linear border rounded-sm cursor-pointer border-slate-200 bg-slate-200 peer-checked/published:bg-green-500 peer-checked/published:border-green-500"></label>
  80.                                                     </div>
  81.                                                 </div>
  82.                                                 <span class="text-sm font-medium" for="radio-show">Afficher</span>
  83.                                             </button>
  84.                                             <!-- "Masquer" button -->
  85.                                             <button type="button" class="flex font-medium items-center px-2 text-gray-900 text-lg w-full">
  86.                                                 <div class="flex items-center">
  87.                                                     <div class="relative inline-block w-10 mr-2 align-middle transition duration-200 ease-in">
  88.                                                         <input type="radio" name="visibility" id="radio-hide" class="absolute block w-5 h-5 transition duration-300 ease-linear border-2 border-gray-200 rounded-sm appearance-none cursor-pointer bg-white/80 peer/published checked:bg-white checked:right-0 checked:border-green-500 arrow-none">
  89.                                                         <label for="radio-hide" class="block h-5 overflow-hidden transition duration-300 ease-linear border rounded-sm cursor-pointer border-slate-200 bg-slate-200 peer-checked/published:bg-green-500 peer-checked/published:border-green-500"></label>
  90.                                                     </div>
  91.                                                 </div>
  92.                                                 <span class="text-sm font-medium" for="radio-hide">Masquer  </span>
  93.                                             </button>
  94.                                         </div>
  95.                                     </div>
  96.                                     <div class="divider mt-16"></div>
  97.                                     <div class="flex mt-4 row">
  98.                                         <div class="col-md-6">
  99.                                             <p class="text-xs  text-gray-900 mb-2">En cliquant sur le bouton de Enregistrer, vous mettez à jours les informations envoyé dans ce formulaire </p>
  100.                                         </div>
  101.                                         <div class="col-md flex justify-end">
  102.                                             <button type="reset" style=" color: #ffaa00; border: 1px solid;" class="font-medium h-10  py-2.5 rounded-lg text-center text-sm  w-40 me-2">
  103.                                                 Annuler</button>
  104.                                             <button type="submit" style=" background: #ffaa00;" class="font-medium hover:bg-primary-700 h-10  py-2.5 rounded-lg text-center text-sm text-white w-40">Enregistrer</button>
  105.                                         </div>
  106.                                     </div>
  107.                                 </form>
  108.                             </div>
  109.                             <!-- end card body -->
  110.                         </div>
  111.                         <!-- end card -->
  112.                     </div>
  113.                     <!-- end col -->
  114.                     <!-- end col -->
  115.                 </div>
  116.             </div> <!-- container-fluid -->
  117. {% endblock %}
  118. {% block javascripts %}
  119.     <!-- apexcharts -->
  120.     <script src="{{ asset('admin/libs/parsleyjs/parsley.min.js')}}"></script>
  121.     <script src="{{ asset('admin/libs/select2/js/select2.min.js')}}"></script>
  122.     <script src="{{ asset('admin/libs/bootstrap-maxlength/bootstrap-maxlength.min.js')}}"></script>
  123.     <script src="{{ asset('admin/js/pages/form-validation.init.js')}}"></script>
  124.     <script src="{{ asset('admin/js/app.js')}}"></script>
  125.     <script>
  126.                                         /*
  127.                                          Template Name: Skote - Admin & Dashboard Template
  128.                                          Author: Themesbrand
  129.                                          Website: https://themesbrand.com/
  130.                                          Contact: themesbrand@gmail.com
  131.                                          File: Form Advanced Js File
  132.                                          */
  133.                                         !function ($) {
  134.                                             "use strict";
  135.                                             var AdvancedForm = function () { };
  136.                                             AdvancedForm.prototype.init = function () {
  137.                                                 // Select2
  138.                                                 if ($('.select2').length > 0) {
  139.                                                     $(".select2").select2();
  140.                                                 }
  141.                                                 if ($('.select2-tags').length > 0) {
  142.                                                     $(".select2-tags").select2({
  143.                                                         tags: true
  144.                                                     });
  145.                                                 }
  146.                                                 if ($('.select2-limiting-3').length > 0) {
  147.                                                     $(".select2-limiting-3").select2({
  148.                                                         maximumSelectionLength: 3
  149.                                                     });
  150.                                                 }
  151.                                                 //Bootstrap-MaxLength
  152.                                                 $('input#defaultconfig').maxlength({
  153.                                                     warningClass: "badge bg-info",
  154.                                                     limitReachedClass: "badge bg-warning"
  155.                                                 });
  156.                                                 $('input#thresholdconfig').maxlength({
  157.                                                     threshold: 20,
  158.                                                     warningClass: "badge bg-info",
  159.                                                     limitReachedClass: "badge bg-warning"
  160.                                                 });
  161.                                                 $('input#moreoptions').maxlength({
  162.                                                     alwaysShow: true,
  163.                                                     warningClass: "badge bg-success",
  164.                                                     limitReachedClass: "badge bg-danger"
  165.                                                 });
  166.                                                 $('input#alloptions').maxlength({
  167.                                                     alwaysShow: true,
  168.                                                     warningClass: "badge bg-success",
  169.                                                     limitReachedClass: "badge bg-danger",
  170.                                                     separator: ' out of ',
  171.                                                     preText: 'You typed ',
  172.                                                     postText: ' chars available.',
  173.                                                     validate: true
  174.                                                 });
  175.                                                 $('textarea#textarea').maxlength({
  176.                                                     alwaysShow: true,
  177.                                                     warningClass: "badge bg-info",
  178.                                                     limitReachedClass: "badge bg-warning"
  179.                                                 });
  180.                                                 $('input#placement').maxlength({
  181.                                                     alwaysShow: true,
  182.                                                     placement: 'top-left',
  183.                                                     warningClass: "badge bg-info",
  184.                                                     limitReachedClass: "badge bg-warning"
  185.                                                 });
  186.                                             },
  187.                                                     //init
  188.                                                     $.AdvancedForm = new AdvancedForm, $.AdvancedForm.Constructor = AdvancedForm
  189.                                         }(window.jQuery),
  190.                                                 //Datepicker
  191.                                                         function ($) {
  192.                                                             "use strict";
  193.                                                             $.AdvancedForm.init();
  194.                                                         }(window.jQuery);
  195.     </script>
  196. {% endblock %}