



<div class="card mb-2">

    <h5 class="card-header">
        {{ __('Headline Bild') }}

    </h5>


    <div class="card-body">

        @if($category->id>0)
        <style>
            .dz-message {
                margin: 2rem 0;
            }
            .default-style .dz-message {
                font-size: 1.1em;
            }
        </style>

        <div class="row">

            <div class="col-12">
                <p>Bild wird hinter oder unter die Headline gesetzt und einer Breite von 100% ausgegeben.</p>
            </div>
            <div class="col-md-8 col-sm-6">

                <div class="row">
                    @if($category->headline_image_id)
                        <div class="col-6 col-md-4  text-center" style="border: 1px solid #eee;">
                            <img class="" height="60" alt="" src="{{ route('iq_image', [$category->iq_image->slug]) }}">
                            <br>
                            <a href="{{ route('admin_product_category_image_delete', [$category->iq_image->id, $category->id]) }}" class="btn btn-sm btn-primary mt-2 mb-2" onclick="return confirm('Bild wirklich löschen?');">Bild löschen</a>
                            @if($category->iq_image->active)
                                <a href="{{ route('admin_product_category_image_attribute', [$category->iq_image->id, 'active', 0]) }}" class="btn btn-sm btn-default mt-2 mb-2"><span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span> <i class="far fa-sync"></i></a>
                            @else
                                <a href="{{ route('admin_product_category_image_attribute', [$category->iq_image->id, 'active', 1]) }}" class="btn btn-sm btn-default mt-2 mb-2"><span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span> <i class="far fa-sync"></i></a>
                            @endif
                        </div>
                    @endif
                </div>
            </div>
            <div class="col-md-4  col-sm-6">

                @if(!$category->headline_image_id)
                <div class="card">
                    <div class="card-body">
                            <form method="POST" action="{{ route('admin_product_category_image_upload') }}" accept-charset="UTF-8" class="avatar" enctype="multipart/form-data">
                                @csrf
                                <input type="hidden" name="category_id" value="{{$category->id}}">
                                <div class="slim_holder text-center">
                                    <div class="slim" style="margin:20px auto;"
                                         data-label='<span class="text-green">Foto-Upload</span><br>(Datei suchen oder Drag & Drop)'
                                         data-fetcher="fetch.php"
                                         data-size="1680,640"
                                         data-min-size="100,100"
                                         data-max-file-size="10"
                                         data-status-image-too-small="Bild zu klein<br>min. $0 Pixel"
                                         data-status-file-type="Ungültige Datei<br>bitte nur: $0"
                                         data-status-file-size="Die Datei ist zu groß<br>max. $0 MB"
                                         data-button-confirm-label="bestätigen"
                                         data-button-cancel-label="abbrechen"
                                         data-button-confirm-title="bestätigen"
                                         data-button-cancel-title="abbrechen"
                                         data-button-rotate-title="drehen"
                                         data-ratio="">
                                        <input type="file" name="images[]" required />
                                    </div>

                                    <br>
                                    <button class="btn btn-primary" type="submit">Bild speichern</button>
                                </div>
                            </form>
                    </div>
                </div>
                @else
                    <p> Nur ein Bild möglich, vor neuem Upload Bild löschen </p>
                @endif
            </div>
        </div>
        @else
         <p>Kategorie erst anlegen</p>


        @endif


    </div>
</div>
