









<h6 class="card-header">{{ __('shop on site') }}<br><small>{{ __('shop on site copy') }}</small>
</h6>
<div class="card-body p-3">
    <style>
        .dz-message {
            margin: 2rem 0;
        }
        .default-style .dz-message {
            font-size: 1.1em;
        }
    </style>


        <div class="row">
            @if(count($user->shop->on_sites) <= 5)
            <div class="col-md-6 col-sm-6">
                <div class="row">
                    @foreach($user->shop->on_sites as $image)
                        <div class="col-6 col-md-4  text-center" style="border: 1px solid #eee;">
                            <img class="img-fluid" alt="" src="{{ route('user_shop_image', [$image->slug]) }}">
                            <br>
                            <a href="{{ route('user_shop_on_site_delete_image', [$image->id, $user->shop->id]) }}" class="btn btn-sm btn-danger mt-2 mb-2" onclick="return confirm('Bild wirklich löschen?');"><i class="fa fa-trash"></i></a>
                        </div>
                    @endforeach
                </div>
            </div>
            <div class="col-md-6  col-sm-6">
                <div class="card">
                    <div class="card-body">
                        <form method="POST" action="{{ route('user_shop_on_site_upload_image') }}" accept-charset="UTF-8" class="avatar" enctype="multipart/form-data">
                            @csrf
                            <input type="hidden" name="user_shop_id" value="{{$user->shop->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="600,800"
                                     data-min-size="200,200"
                                     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="3:4">
                                    <input type="file" name="images[]" required />
                                </div>

                                <br>
                                <button class="btn btn-primary" type="submit">Bild speichern</button>
                            </div>
                        </form>
                    </div>
                </div>
                @else
                    <div class="col-12">
                        <div class="row">
                            @foreach($user->shop->on_sites as $image)
                                <div class="col-6 col-md-4  text-center" style="border: 1px solid #eee;">
                                    <img class="img-fluid" alt="" src="{{ route('user_shop_image', [$image->slug]) }}">
                                    <br>
                                    <a href="{{ route('user_shop_on_site_delete_image', [$image->id, $user->shop->id]) }}" class="btn btn-sm btn-danger mt-2 mb-2" onclick="return confirm('Bild wirklich löschen?');"><i class="fa fa-trash"></i></a>
                                </div>
                            @endforeach
                        </div>
                    </div>
                @endif
            </div>
        </div>
    </div>
