@extends('layouts.idara.panel')


@section('content')
<link rel="stylesheet" href="{{ asset('backend/css/idara.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />

@include('backend.partials.import')

@include('backend.partials.features')


        <section class="mt-4">
            <div class="card">
                <div class="card-header actionTitle">

                    <div class="row">
                        <div class="col">
                            <strong><i class="fa fa-ellipsis-v" aria-hidden="true"></i> {{$article->nom}}</strong>

                        </div>
                        <div class="col flexBtn">
                            <div class="dropdown">
                                <button class="btn  dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                    <i class="fa fa-gears"></i> Actions
                                </button>
                                <ul class="dropdown-menu">
                                    <a href="{{url('/test')}}">
                                        <li><button class="dropdown-item" type="button"><i class="fas fa-eye" aria-hidden="true"></i> Visualiser</button></li>

                                    </a>
                                    <a href="{{ route('produit.edit',['id'=>$article]) }}">
                                        <li><button class="dropdown-item" type="button"> <i class="fa-solid fa-pen-to-square"></i> Modifier</button></li>
                                    </a>

                                </ul>
                            </div>
                            <div class="dropdown ">
                            <button class="btn  dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                <i class="fa fa-puzzle-piece"></i> Extensions
                            </button>
                            <ul class="dropdown-menu">
                                <a href="{{ route('produit.editDoc',['id'=>$article]) }}">

                                    <li><button class="dropdown-item" type="button"><i class="fa-solid fa-pen"></i> Ducument</button></li>
                                </a>
                               
                                <a href="{{ route('produit.editDiapo',['id'=>$article]) }}">

                                    <li><button class="dropdown-item" type="button"> <i class="fa fa-camera"></i>photo Produit</button></li>
                                </a>


                            </ul>
                        </div>
                        </div>
                      
                    </div>


                </div>

                <div class="card-body">
                    <div><i class="fa-solid fa-calendar-days"></i> <strong>Date de mise à jour : </strong> {{$article->created_at}}</div>

                   
                    <div class="mt-3"><i class="fa-solid fa-circle-info"></i> <strong>Descritpion : </strong> {!! html_entity_decode ($article->description)!!}</div>

                    <div class=" mt-3 showImage">

                        <img src="{{ asset('storage/image/'.$article->image) }}" alt="description of myimage">
                        
                    </div>

                </div>
            </div>


        </section>
        <section>

            
            <div class="card mt-4">
                <h5 class="card-header">Image</h5>
                <div class="card-body">

                  

                       <div class="row">
                     
                         @foreach($diapos as $diapo)
                         <div class="col-md-3 mt-4" style="margin-left:74px">
                         <form action="{{url('deleteMedia/'.$diapo->id)}}" method="post">

                                @csrf
                                @method('DELETE')
                                <div>
                            <img src="{{ asset('storage/diapo/'.$diapo->diapo) }}" alt="description of myimage" style="    height: 200px;">
                            </div>
                            <div>
                                <input type="hidden" name="id" value="{{$diapo->id}}" />
                               <button type="submit" class="btn btn-sm btn-secondary ml-2"><i class="fa-solid fa-x"></i></button>
                               </div>
                         </form>
                         </div>
                            @endforeach
                        
                      
                </div>
                </div>
                  
                </div>
          
               
                @if ($article->document !=null)
                    
               
                <div class="card mt-4">
                    <div class="card-header">
                        Featured
                    </div>
                    <div class="card-body">
                    <a href="{{ route('doc.download', $article->id) }}" class="btn btn-secondary"><i class="fa fa-download"></i>Fiche Technique.  {{$extension}} .{{  $sizeFile}} kB</a> 


                    </div>
             </div>
              @endif

        </section>


    </div>

    @endsection
