| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- {{--
- Partial: секция «Фотографии» формы автомобиля
- Переменные из родителя: $car
- --}}
- <div class="card card-dark card-outline">
- <div class="card-header"><h3 class="card-title">Фотографии</h3></div>
- <div class="card-body">
- @if($car && $car->photo_main)
- <div class="mb-3">
- <label>Текущее главное фото</label><br>
- <img src="{{ Storage::url($car->photo_main) }}"
- class="img-thumbnail" style="max-height:150px">
- </div>
- @endif
- <div class="form-group">
- <label>Главное фото {{ $car && $car->photo_main ? '(заменить)' : '' }}</label>
- <div class="input-group">
- <div class="custom-file">
- <input type="file" class="custom-file-input" id="photo_main"
- name="photo_main" accept="image/jpeg,image/png,image/webp">
- <label class="custom-file-label" for="photo_main">Выберите файл...</label>
- </div>
- </div>
- <small class="text-muted">JPG, PNG, WebP. Рекомендуется 800×600 или больше.</small>
- </div>
- @if($car && $car->photos_gallery)
- <div class="mb-3">
- <label>Галерея (текущие фото)</label>
- <div class="d-flex flex-wrap gap-2">
- @foreach($car->photos_gallery as $gPhoto)
- <div class="position-relative" style="margin:4px">
- <img src="{{ Storage::url($gPhoto) }}"
- class="img-thumbnail" style="height:80px;width:auto;max-width:120px;object-fit:cover">
- <div class="custom-control custom-checkbox mt-1">
- <input type="checkbox" class="custom-control-input"
- id="del_{{ $loop->index }}"
- name="delete_gallery[]" value="{{ $gPhoto }}">
- <label class="custom-control-label text-danger" for="del_{{ $loop->index }}">
- <small>Удалить</small>
- </label>
- </div>
- </div>
- @endforeach
- </div>
- </div>
- @endif
- <div class="form-group">
- <label>Добавить фото в галерею</label>
- <div class="input-group">
- <div class="custom-file">
- <input type="file" class="custom-file-input" id="photos_gallery"
- name="photos_gallery[]" multiple accept="image/jpeg,image/png,image/webp">
- <label class="custom-file-label" for="photos_gallery">Выберите файлы...</label>
- </div>
- </div>
- <small class="text-muted">Можно выбрать несколько файлов.</small>
- </div>
- </div>
- </div>
|