Advertisement
Guest User

jquery

a guest
May 25th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.43 KB | None | 0 0
  1. @extends('_layouts.admin')
  2.  
  3.  
  4. @section('content')
  5.  
  6. {{-- <nav class="flex flex-row justify-between transition duration-500 ease-in-out border-b dark:border-gray-600 dark:text-gray-400">
  7.                 <div class="flex">
  8.                     <!-- Top NavBar -->
  9.  
  10.                     <a
  11.                         href="users-dashboard/"
  12.                         class="block py-2 font-medium text-green-500 capitalize transition duration-500 ease-in-out border-b-2 border-green-500 dark:text-green-200 dark:border-green-200 focus:outline-none">
  13.                         users
  14.                     </a>
  15.                     <button
  16.                         class="block py-2 ml-6 font-medium text-center capitalize transition duration-500 ease-in-out border-b-2 border-transparent focus:outline-none focus:text-green-500 focus:border-green-500 dark-focus:text-green-200 dark-focus:border-green-200">
  17.                         role
  18.                     </button>
  19.                     <button
  20.                         class="block py-2 ml-6 font-medium text-center capitalize transition duration-500 ease-in-out border-b-2 border-transparent focus:outline-none focus:text-green-500 focus:border-green-500 dark-focus:text-green-200 dark-focus:border-green-200">
  21.                         access rights
  22.                     </button>
  23.                 </div>
  24.  
  25.                 <div class="flex items-center select-none">
  26.                     <span
  27.                         class="mr-3 transition duration-500 ease-in-out cursor-pointer hover:text-green-500 dark-hover:text-green-300">
  28.  
  29.                         <svg viewBox="0 0 512 512" class="w-5 h-5 fill-current">
  30.                             <path
  31.                                 d="M505 442.7L405.3
  32.                                 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7
  33.                                 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1
  34.                                 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4
  35.                                 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9
  36.                                 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7
  37.                                 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0
  38.                                 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
  39.                         </svg>
  40.                     </span>
  41.  
  42.                     <input
  43.                         class="w-12 bg-transparent focus:outline-none"
  44.                         placeholder="Search" />
  45.  
  46.                 </div>
  47.  
  48.             </nav> --}}
  49.             <h2 class="my-4 mb-5 text-4xl font-semibold dark:text-gray-400">
  50.                 Liste des produits de la catégorie {{ $category->name }}
  51.             </h2>
  52.  
  53.            
  54.             @if (session('message'))
  55.             <div id="flash-message" class="border border-green-700 text-green-700 bg-green-200 p-2 rounded mt-5 mx-5">
  56.                 {{ session('message') }}
  57.             </div>
  58.             @endif
  59.  
  60.  
  61.             @forelse($products as $product)
  62.             <div class="flex justify-between px-4 py-4 mt-4 bg-white rounded-lg shadow-xl cursor-pointer dark:bg-gray-600 ">
  63.                 <!-- Card -->
  64.  
  65.                 <div class="flex justify-between">
  66.                     <!-- Left side -->
  67.  
  68.                     <img
  69.                         class="object-cover w-16 h-16 mt-2 rounded-full"
  70.                         src="{{ asset('images/' . $product->image) }}"
  71.                         alt="" />
  72.  
  73.                     <div
  74.                         class="flex flex-col mt-4 ml-4 text-gray-600 capitalize dark:text-gray-400">
  75.                         <span>Produit</span>
  76.                         <span class="mt-2 text-black dark:text-gray-200">
  77.                             {{ $product->title }}
  78.                         </span>
  79.                     </div>
  80.  
  81.                     {{-- <div
  82.                         class="flex flex-col mt-4 ml-12 text-gray-600 capitalize dark:text-gray-400">
  83.                         <span>Description</span>
  84.                         <span class="mt-2 text-black dark:text-gray-200">
  85.                             {{ $product->description }}
  86.                         </span>
  87.                     </div> --}}
  88.  
  89.                     <div
  90.                         class="flex flex-col mt-4 ml-12 text-gray-600 capitalize dark:text-gray-400 mr-2">
  91.                         <span>Prix</span>
  92.                         <span class="mt-2 text-black dark:text-gray-200">
  93.                             {{ $product->getPrice() }}
  94.                         </span>
  95.                     </div>
  96.  
  97.                     <div
  98.                         class="flex flex-col mt-4 ml-12 text-gray-600 capitalize dark:text-gray-400 mr-2">
  99.                         <span>Stock</span>
  100.                         <span class="mt-2 text-black dark:text-gray-200">
  101.                             @if ($product->stock_status == "instock")
  102.                                 <p class="text-green-700">Disponible</p>
  103.                             @else
  104.                             <p class="text-red-700">Non disponible</p>
  105.                             @endif
  106.                         </span>
  107.                     </div>
  108.  
  109.                     <div
  110.                         class="flex flex-col mt-4 ml-12 text-gray-600 capitalize dark:text-gray-400 mr-2">
  111.                         <span>Visibilité</span>
  112.                         <span class="mt-2 text-black dark:text-gray-200">
  113.                             @if ($product->featured == 1)
  114.                                 <p class="text-green-700">Visible</p>
  115.                             @else
  116.                             <p class="text-red-700">Non visible</p>
  117.                             @endif
  118.                         </span>
  119.                     </div>
  120.  
  121.                 </div>
  122.  
  123.                 <div class="flex">
  124.                     <!-- Rigt side -->
  125.  
  126.                     <div class="flex flex-col mr-5 text-gray-600 capitalize dark:text-gray-400">
  127.                         <button id="detailsBtn" class="flex items-center px-4 py-2 text-green-500 border-2 border-green-500 rounded-full shadow mt-7 hover:bg-green-500 hover:text-white">
  128.                             Détails
  129.                         </button>
  130.                     </div>
  131.  
  132.                     <div class="flex flex-col mr-5 text-gray-600 capitalize dark:text-gray-400">
  133.                         <a href="{{ route('admin.products.edit', $product) }}">
  134.                             <button class="flex items-center px-4 py-2 text-blue-500 border-2 border-blue-500 rounded-full shadow mt-7 hover:bg-blue-500 hover:text-white">
  135.                                 Modifier
  136.                             </button>
  137.                         </a>
  138.                     </div>
  139.  
  140.                     <div class="flex flex-col mr-5 text-gray-600 capitalize dark:text-gray-400">
  141.                         <form action="{{ route('admin.products.destroy', $product) }}" method="POST">
  142.                             @csrf
  143.                             @method('DELETE')
  144.                             <button class="flex items-center px-4 py-2 text-red-500 border-2 border-red-500 rounded-full shadow mt-7 hover:bg-red-500 hover:text-white">
  145.                                 Supprimer
  146.                             </button>
  147.                         </form>
  148.                     </div>
  149.  
  150.                 </div>
  151.  
  152.             </div>
  153.  
  154.             <div id="product-description" class="flex justify-between px-4 py-4 mt-4 bg-white rounded-lg shadow-xl cursor-pointer dark:bg-gray-600 ">
  155.                 <div
  156.                         class="flex flex-col mt-4 ml-4 text-gray-600 capitalize dark:text-gray-400">
  157.                         <span>Description</span>
  158.                         <span class="mt-2 text-black dark:text-gray-200">
  159.                             Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lectus lacus, venenatis a pulvinar sed, porta sit amet nunc. Curabitur tempor et velit ac rutrum. Cras magna ex, elementum quis tincidunt non, ultrices vitae mauris. Nulla volutpat sollicitudin neque. Nunc nec massa tincidunt, congue augue nec, dignissim mi. Quisque lobortis quam at massa condimentum ultricies. Aliquam malesuada commodo urna, non maximus orci auctor sit amet. Curabitur nec consequat felis. Vestibulum dictum urna ornare vehicula faucibus.
  160.                         </span>
  161.                     </div>
  162.             </div>
  163.  
  164.             @empty
  165.  
  166.             <h1 class="mt-8">Aucun produit dans cette catégorie.</h1>
  167.  
  168.  
  169.             @endforelse
  170.  
  171.             <div class="mt-5">{{ $products->links() }}</div>
  172.  
  173.  
  174.  
  175.  
  176.  
  177. <script>
  178.     $(document).ready(function(){
  179.             $("[id=product-description]").hide();
  180.     });
  181. </script>
  182. @endsection
  183.  
  184.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement