|
@@ -16,47 +16,96 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<label for="series" class="form-label">Серия</label>
|
|
<label for="series" class="form-label">Серия</label>
|
|
|
- <input class="form-control" name="series" id="series" value="{{ $product->series }}">
|
|
|
|
|
|
|
+ <input class="form-control @error('series') border-danger @enderror"
|
|
|
|
|
+ name="series" id="series" value="{{ old('series', $product->series) }}">
|
|
|
|
|
+ @error('series')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row mt-3">
|
|
<div class="row mt-3">
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<label for="name" class="form-label">Наименовение</label>
|
|
<label for="name" class="form-label">Наименовение</label>
|
|
|
- <input class="form-control" name="name" id="name" value="{{ $product->name }}">
|
|
|
|
|
|
|
+ <input class="form-control @error('name') border-danger @enderror"
|
|
|
|
|
+ name="name" id="name" value="{{ old('name', $product->name) }}">
|
|
|
|
|
+ @error('name')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<label for="name_for_form" class="form-label">Наименование под образец формы</label>
|
|
<label for="name_for_form" class="form-label">Наименование под образец формы</label>
|
|
|
- <input class="form-control" name="name_for_form" id="name_for_form"
|
|
|
|
|
- value="{{ $product->name_for_form }}">
|
|
|
|
|
|
|
+ <input class="form-control @error('name_for_form') border-danger @enderror"
|
|
|
|
|
+ name="name_for_form" id="name_for_form"
|
|
|
|
|
+ value="{{ old('name_for_form', $product->name_for_form) }}">
|
|
|
|
|
+ @error('name_for_form')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row mt-3">
|
|
<div class="row mt-3">
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<label for="product_group" class="form-label">Группа</label>
|
|
<label for="product_group" class="form-label">Группа</label>
|
|
|
- <input class="form-control" name="product_group" id="product_group"
|
|
|
|
|
- value="{{ $product->product_group }}">
|
|
|
|
|
|
|
+ <input class="form-control @error('product_group') border-danger @enderror"
|
|
|
|
|
+ name="product_group" id="product_group"
|
|
|
|
|
+ value="{{ old('product_group', $product->product_group) }}">
|
|
|
|
|
+ @error('product_group')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<label for="price" class="form-label">Цена</label>
|
|
<label for="price" class="form-label">Цена</label>
|
|
|
- <input type="number" class="form-control" name="price" id="price"
|
|
|
|
|
- value="{{ $product->price }}">
|
|
|
|
|
|
|
+ <input type="number" class="form-control @error('price') border-danger @enderror"
|
|
|
|
|
+ name="price" id="price"
|
|
|
|
|
+ value="{{ old('price', $product->price) }}">
|
|
|
|
|
+ @error('price')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <label for="characteristics" class="form-label">Характеристики</label>
|
|
|
|
|
- <textarea class="form-control" name="characteristics" rows="4"
|
|
|
|
|
- id="characteristics">{{ $product->characteristics }}</textarea>
|
|
|
|
|
|
|
+ <label for="characteristics" class="form-label mt-3">Характеристики</label>
|
|
|
|
|
+ <textarea class="form-control @error('characteristics') border-danger @enderror"
|
|
|
|
|
+ name="characteristics" rows="4"
|
|
|
|
|
+ id="characteristics">{{ old('characteristics', $product->characteristics) }}</textarea>
|
|
|
|
|
+ @error('characteristics')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
|
|
|
|
|
- <label for="tech_description" class="form-label">Техническое описание</label>
|
|
|
|
|
- <textarea class="form-control" name="tech_description" rows="6"
|
|
|
|
|
- id="tech_description">{{ $product->tech_description }}</textarea>
|
|
|
|
|
|
|
+ <label for="tech_description" class="form-label mt-3">Техническое описание</label>
|
|
|
|
|
+ <textarea class="form-control @error('tech_description') border-danger @enderror"
|
|
|
|
|
+ name="tech_description" rows="5"
|
|
|
|
|
+ id="tech_description">{{ old('tech_description', $product->tech_description) }}</textarea>
|
|
|
|
|
+ @error('tech_description')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
|
|
|
|
|
- <label for="tech_description_short" class="form-label">Техническое описание сокращенное без
|
|
|
|
|
|
|
+ <label for="tech_description_short" class="form-label mt-3">Техническое описание сокращенное без
|
|
|
артикула</label>
|
|
артикула</label>
|
|
|
- <textarea class="form-control" name="tech_description_short" rows="6"
|
|
|
|
|
- id="tech_description_short">{{ $product->tech_description_short }}</textarea>
|
|
|
|
|
|
|
+ <textarea class="form-control @error('tech_description_short') border-danger @enderror"
|
|
|
|
|
+ name="tech_description_short" rows="5"
|
|
|
|
|
+ id="tech_description_short">{{
|
|
|
|
|
+ old('tech_description_short', $product->tech_description_short) }}</textarea>
|
|
|
|
|
+ @error('tech_description_short')
|
|
|
|
|
+ <div class="form-text text-danger" id="titleError">
|
|
|
|
|
+ {{ $message }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @enderror
|
|
|
|
|
|
|
|
<div class="col-12 text-center mt-3">
|
|
<div class="col-12 text-center mt-3">
|
|
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
|
@@ -65,11 +114,57 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-12 col-md-6">
|
|
<div class="col-sm-12 col-md-6">
|
|
|
- <img src="{{ '/' . env('IMAGES_PATH', '/fill_images_path_in_env') . '/' . $product->image_path }}"
|
|
|
|
|
- alt="{{ $product->article }}" class="img-fluid">
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="col-12 text-end">
|
|
|
|
|
+ <button class="btn btn-primary" onclick="document.getElementById('upload-image-form').click()">
|
|
|
|
|
+ Загрузить
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <br>
|
|
|
|
|
+ <span class="notice">Изображение сохраниться в папку с изображениями товаров: stroyprofit.com/{{ env('IMAGES_PATH', 'fill-path') }}/<br>
|
|
|
|
|
+ Имя файла будет сформировано уникальное, в начале имени до точки будет артикул товара.</span>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <form action="{{ route('upload_image') }}" method="post" enctype="multipart/form-data"
|
|
|
|
|
+ class="visually-hidden" onchange="this.submit()">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <input type="hidden" name="article" value="{{ $product->article }}">
|
|
|
|
|
+ <input type="file" name="filename" id="upload-image-form" accept=".jpg">
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @empty($product->image_path)
|
|
|
|
|
+ <div class="text-center my-5 fs-3">Нет изображения</div>
|
|
|
|
|
+ @else
|
|
|
|
|
+ <div class="col-12 text-center" >
|
|
|
|
|
+ <img src="{{ '/' . env('IMAGES_PATH', '/fill_images_path_in_env') . '/' . $product->image_path }}"
|
|
|
|
|
+ alt="{{ $product->article }}" class="img-fluid" style="max-height: 40vh;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ @endempty
|
|
|
|
|
+ @if(count($images) > 1)
|
|
|
|
|
+ <div class="col-12 mt-3">
|
|
|
|
|
+ <div class="fs-5 mb-4">Найдены изображения с таким артикулом:</div>
|
|
|
|
|
+ <div class="row justify-content-center align-items-end">
|
|
|
|
|
+ @foreach($images as $image)
|
|
|
|
|
+ <div class="h-100 col-md-3 col-sm-2 text-center">
|
|
|
|
|
+ <img class="img-thumbnail"
|
|
|
|
|
+ src="{{ '/' . env('IMAGES_PATH', 'zzz') . '/' . $image }}" alt="{{ $image }}">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <form action="{{ route('update_image', $product->id) }}" method="post">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <input type="hidden" name="image_path" value="{{ $image }}">
|
|
|
|
|
+ <button type="submit" class="btn btn-primary my-3">Выбрать</button>
|
|
|
|
|
+ </form>
|
|
|
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|