|
@@ -27,6 +27,29 @@
|
|
|
border: 0px;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
+ .btn-file {
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .btn-file input[type=file] {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ min-width: 100%;
|
|
|
+ min-height: 100%;
|
|
|
+ font-size: 100px;
|
|
|
+ text-align: right;
|
|
|
+ filter: alpha(opacity=0);
|
|
|
+ opacity: 0;
|
|
|
+ outline: none;
|
|
|
+ background: white;
|
|
|
+ cursor: inherit;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+
|
|
|
+ #img-upload{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
</style>
|
|
|
@endslot
|
|
|
@slot('subject')
|
|
@@ -48,7 +71,7 @@
|
|
|
@endcomponent
|
|
|
<div class="card-body mx-lg-5 px-lg-3">
|
|
|
<form method="POST" action="{{ route('products.store') }}"
|
|
|
- enctype="multipart/form-data">
|
|
|
+ class="dropzone" id="dropzone" enctype="multipart/form-data" >
|
|
|
@csrf
|
|
|
|
|
|
<div class="form-group">
|
|
@@ -94,12 +117,10 @@
|
|
|
class="form-control @error('type') is-invalid @enderror" name="type"
|
|
|
value="{{ old('type') }}" autocomplete="type">
|
|
|
<option value="">انتخاب کنید</option>
|
|
|
- <option value="0" {{ (old('type') == '0') ? 'selected' : '' }}>ساده
|
|
|
- </option>
|
|
|
- <option value="1" {{ (old('type') == '1') ? 'selected' : '' }}>متغیر
|
|
|
- </option>
|
|
|
- <option value="2" {{ (old('type') == '2') ? 'selected' : '' }}>باندل
|
|
|
- </option>
|
|
|
+ <option value="0" {{ (old('type') == '0') ? 'selected' : '' }}>ساده </option>
|
|
|
+ <option value="1" {{ (old('type') == '1') ? 'selected' : '' }}>متغیر </option>
|
|
|
+ <option value="2" {{ (old('type') == '2') ? 'selected' : '' }}>باندل </option>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
@error('type')
|
|
@@ -193,14 +214,46 @@
|
|
|
@enderror
|
|
|
|
|
|
</div>
|
|
|
+ <div class="file-upload-wrapper">
|
|
|
+ <input type="file" id="input-file-now-custom-2" class="file-upload"
|
|
|
+ data-height="500" />
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+
|
|
|
+ <label for="title">{{ __('product.feature_image') }}</label><i
|
|
|
+ class="required"> *</i>
|
|
|
+ <input type="file" name="file" id="profile-img"
|
|
|
+ data-input="thumbnail" data-preview="holder"
|
|
|
+ class="form-control photo @error('featured_image') is-invalid @enderror"
|
|
|
+ value="{{old('featured_image')}}" autocomplete="featured_image" autofocus multiple>
|
|
|
+ @error('featured_image')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
+ <strong>{{ $message }}</strong>
|
|
|
+ </span>
|
|
|
+ @enderror
|
|
|
+ <div class="gallery_files">
|
|
|
+ @if( old( 'featured_image' ) )
|
|
|
+ <div class="gallery_file_upload mb-2">
|
|
|
+ <div class="file_info">
|
|
|
+ <a class="uploaded_file_thumbnail" target="_blank" href="{{ Storage::url( old( 'featured_image' ) ) }}">
|
|
|
+ <img src="" id="profile-img-tag" width="200px" />
|
|
|
+ </a>
|
|
|
+ <span class="file_name">{{ basename( old( 'featured_image' ) ) }}</span>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <span class="delete_file"><i class="fas fa-times"></i></span>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="form-group">
|
|
|
- <label for="title">{{ __('product.photo') }}</label><i
|
|
|
+ <label for="title">{{ __('product.gallery_image') }}</label><i
|
|
|
class="required"> *</i>
|
|
|
- <input type="file" name="photo" id="photo"
|
|
|
+ <input type="file" name="gallery_image" id="gallery_image"
|
|
|
|
|
|
- class="form-control photo @error('photo') is-invalid @enderror"
|
|
|
- value="{{old('photo')}}" autocomplete="photo" autofocus multiple>
|
|
|
- @error('photo')
|
|
|
+ class="form-control photo @error('gallery_image') is-invalid @enderror"
|
|
|
+ value="{{old('gallery_image')}}" autocomplete="gallery_image" autofocus multiple>
|
|
|
+ @error('gallery_image')
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
<strong>{{ $message }}</strong>
|
|
|
</span>
|
|
@@ -230,7 +283,9 @@
|
|
|
@endslot
|
|
|
|
|
|
@slot('script')
|
|
|
-
|
|
|
+ <script>
|
|
|
+ $('.file-upload').file_upload();
|
|
|
+ </script>
|
|
|
@endslot
|
|
|
|
|
|
@endcomponent
|