|
@@ -1,249 +1,156 @@
|
|
|
-@extends('back.index')
|
|
|
-
|
|
|
-@section('title')
|
|
|
- ویرایش دسته بندی
|
|
|
-@endsection
|
|
|
-@section('content1')
|
|
|
- <!--==========================main============================-->
|
|
|
-
|
|
|
- <div class=" main-panel col-12 col-sm-12 col-md-8 col-lg-9 col-xl-9 ">
|
|
|
- <div class="container">
|
|
|
- <h3 class="col-lg-12 col-md-12 col-sm-12 col-12">
|
|
|
- ویرایش دسته بندی
|
|
|
- @component('panel.layouts.component', ['title' => 'ویرایش دسته بندی جدید'])
|
|
|
-
|
|
|
- @slot('style')
|
|
|
- <style>
|
|
|
- .card-header {
|
|
|
- text-align: center !important;
|
|
|
- }
|
|
|
- </style>
|
|
|
- @endslot
|
|
|
- @slot('subject')
|
|
|
- <h1><i class="fa fa-users"></i>ویرایش دسته بندی </h1>
|
|
|
- <p></p>
|
|
|
- @endslot
|
|
|
- @slot('breadcrumb')
|
|
|
- <li class="breadcrumb-item">دسته بندی ها</li>
|
|
|
- @endslot
|
|
|
-
|
|
|
- @slot('content')
|
|
|
- <div class="auth-background h-auto py-5">
|
|
|
- <div class="container py-5">
|
|
|
- <div class="row align-items-center">
|
|
|
- <div class="col-lg-8 col-md-10 mx-auto">
|
|
|
- <div class="card">
|
|
|
- <div class="card-header"><strong>{{ __('ویرایش دسته بندی جدید') }}</strong>
|
|
|
- </div>
|
|
|
- @foreach ($products as $product)
|
|
|
-
|
|
|
-
|
|
|
- <div class="card-body mx-lg-5 px-lg-3">
|
|
|
- <form method="POST"
|
|
|
- action="{{ route('categories.update',$category->id) }}">
|
|
|
- @csrf
|
|
|
- @if ($product)
|
|
|
- @method('PUT')
|
|
|
- @endif
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label for="title">{{ __('نام دسته بندی جدید') }}</label>
|
|
|
- <input id="title" type="text"
|
|
|
- class="form-control @error('title') is-invalid @enderror"
|
|
|
- name="title"
|
|
|
- value="{{$category->title}}" required
|
|
|
- autocomplete="title" autofocus>
|
|
|
-
|
|
|
- @error('title')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
- <strong>{{ $message }}</strong>
|
|
|
- </span>
|
|
|
- @enderror
|
|
|
+@component('panel.layouts.component', ['title' => 'ویرایش دسته جدید'])
|
|
|
+
|
|
|
+ @slot('style')
|
|
|
+ <style>
|
|
|
+ .card-header {
|
|
|
+ text-align: center !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .form-control {
|
|
|
+
|
|
|
+ background-color: hsl(315, 22%, 86%);
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ @endslot
|
|
|
+ @slot('subject')
|
|
|
+ <h1><i class="fa fa-users"></i> ویرایش دسته بندی </h1>
|
|
|
+
|
|
|
+ @endslot
|
|
|
+ @slot('breadcrumb')
|
|
|
+ <li class="breadcrumb-item">ویرایش دسته بندی محصولات</li>
|
|
|
+ @endslot
|
|
|
+
|
|
|
+ @slot('content')
|
|
|
+ <div class="auth-background h-auto py-5">
|
|
|
+ <div class="container py-5">
|
|
|
+ <div class="row align-items-center">
|
|
|
+ <div class="col-lg-8 col-md-10 mx-auto">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-header"><strong>{{ __('ویرایش دسته بندی ') }}</strong></div>
|
|
|
|
|
|
- </div>
|
|
|
+ <div class="card-body mx-lg-5 px-lg-3">
|
|
|
+ <form method="POST" action="{{ route('categories-products.store') }}">
|
|
|
+ @csrf
|
|
|
|
|
|
- <div class="form-group">
|
|
|
- <label
|
|
|
- for="slug"> {{ __('نام مستعار دسته بندی ') }}</label>
|
|
|
- <input id="slug" type="text"
|
|
|
- class="form-control @error('slug') is-invalid @enderror"
|
|
|
- name="slug" value="{{$category->slug}}" required
|
|
|
- autocomplete="slug" autofocus>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="title">{{ __('ویرایش نام دسته بندی') }}</label>
|
|
|
+ <input id="title" type="text"
|
|
|
+ class="form-control @error('title') is-invalid @enderror" name="title"
|
|
|
+ value="{{$category->title}}" required autocomplete="title" autofocus>
|
|
|
|
|
|
- @error('slug')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
- <strong>{{ $message }}</strong>
|
|
|
- </span>
|
|
|
- @enderror
|
|
|
-
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="parent"> {{ __(' کد محصول ') }}</label>
|
|
|
- <input id="parent" type="text"
|
|
|
- class="form-control @error('parent') is-invalid @enderror"
|
|
|
- name="sku" value="{{$category->parent}}" required
|
|
|
- autocomplete="parent" autofocus>
|
|
|
-
|
|
|
- @error('parent')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
+ @error('title')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
<strong>{{ $message }}</strong>
|
|
|
</span>
|
|
|
- @enderror
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label for="category_type">{{ __(' نوع محصول') }}</label>
|
|
|
- <select id="category_type" type="text"
|
|
|
- class="form-control @error('category_type') is-invalid @enderror"
|
|
|
- name="category_type"
|
|
|
- required autocomplete="category_type">
|
|
|
- <option value="0">فرعی</option>
|
|
|
- <option
|
|
|
- value="1" <?php if ($category->category_type == 1) echo 'selected'?> >
|
|
|
- اصلی
|
|
|
- </option>
|
|
|
- </select>
|
|
|
-
|
|
|
- @error('category_type')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
- <strong>{{ $message }}</strong>
|
|
|
- </span>
|
|
|
- @enderror
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label for="status">{{ __(' وضعیت محصول') }}</label>
|
|
|
- <select id="status" type="text"
|
|
|
- class="form-control @error('status') is-invalid @enderror"
|
|
|
- name="status"
|
|
|
- value="{{$product->status}}" required
|
|
|
- autocomplete="status">
|
|
|
- <option value="0">ناموجود</option>
|
|
|
- <option
|
|
|
- value="1" <?php if ($category->status == 1) echo 'selected'?> >
|
|
|
- موجود
|
|
|
- </option>
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- @error('status')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
+ @enderror
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="slug"> {{ __('ویرایش نام مستعار دسته بندی ') }}</label>
|
|
|
+ <input id="slug" type="text"
|
|
|
+ class="form-control @error('slug') is-invalid @enderror"
|
|
|
+ name="slug" value="{{$category->slug}}" required
|
|
|
+ autocomplete="slug" autofocus>
|
|
|
+
|
|
|
+ @error('slug')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
<strong>{{ $message }}</strong>
|
|
|
</span>
|
|
|
- @enderror
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label for="discription">{{ __(' توضیحات محصول') }}</label>
|
|
|
- <textarea id="discription" type="text"
|
|
|
- class="form-control @error('discription') is-invalid @enderror"
|
|
|
- name="discription"
|
|
|
- required
|
|
|
- autocomplete="discription">{{$product->discription}}</textarea>
|
|
|
-
|
|
|
- @error('discription')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
+ @enderror
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="parent"> {{ __('ویرایش کد دسته بندی ') }}</label>
|
|
|
+ <input id="parent" type="text"
|
|
|
+ class="form-control @error('parent') is-invalid @enderror"
|
|
|
+ name="parent" value="{{$category->parent}}" required
|
|
|
+ autocomplete="parent" autofocus>
|
|
|
+
|
|
|
+ @error('parent')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
<strong>{{ $message }}</strong>
|
|
|
</span>
|
|
|
- @enderror
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label
|
|
|
- for="creator_id">{{ __(' نام ثبت کننده محصول') }}</label>
|
|
|
- <input id="creator_id" type="text"
|
|
|
- class="form-control @error('creator_id') is-invalid @enderror"
|
|
|
- name="creator_id"
|
|
|
- value="{{ auth()->user()->name }}" required
|
|
|
- autocomplete="creator_id" readonly>
|
|
|
-
|
|
|
- @error('creator_id')
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
+ @enderror
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="category_type">{{ __(' ویرایش نوع دسته بندی') }}</label>
|
|
|
+ <select id="category_type" type="text"
|
|
|
+ class="form-control @error('category_type') is-invalid @enderror"
|
|
|
+ name="category_type"
|
|
|
+ required autocomplete="category_type">
|
|
|
+ <option value="1">محصولات</option>
|
|
|
+ <option value="0">دسته بندی</option>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ @error('category_type')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
<strong>{{ $message }}</strong>
|
|
|
</span>
|
|
|
- @enderror
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="form-group mb-0">
|
|
|
- <div class="">
|
|
|
- <button type="submit" class="btn btn-primary">
|
|
|
- {{ __('ویرایش محصول') }}
|
|
|
- </button>
|
|
|
-
|
|
|
- <a href={{ route('products.index') }} type="button"
|
|
|
- class="btn btn-warning"> انصراف</a>
|
|
|
-
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- @endforeach
|
|
|
- <div class="card-footer">
|
|
|
-
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ @enderror
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- @endslot
|
|
|
-
|
|
|
- @slot('script')
|
|
|
|
|
|
- @endslot
|
|
|
-
|
|
|
- @endcomponent
|
|
|
- <hr>
|
|
|
-
|
|
|
- <div class="row container">
|
|
|
- <div class="col-lg-12 grid-margin stretch-card">
|
|
|
- <div class="card">
|
|
|
- <div class="card-body">
|
|
|
- @include('back.users.messages')
|
|
|
- <form action="{{route('admin.categories.update',$category->id)}}" method="post">
|
|
|
|
|
|
- @csrf
|
|
|
- {{-- name--}}
|
|
|
<div class="form-group">
|
|
|
- <label for="title">نام دسته بندی جدید</label>
|
|
|
- <input type="text" name="name"
|
|
|
- class="form-control @error('name') is-invalid @enderror"
|
|
|
- value="{{$category->name}}">
|
|
|
- @error('name')
|
|
|
- <div class="alert alert-danger">{{$message}}</div>
|
|
|
+ <label for="discription">{{ __('ویرایش توضیحات دسته بندی') }}</label>
|
|
|
+ <textarea id="discription" type="text"
|
|
|
+ class="form-control @error('discription') is-invalid @enderror"
|
|
|
+ name="discription"
|
|
|
+ required
|
|
|
+ autocomplete="discription">{{$category->discription}}</textarea>
|
|
|
+
|
|
|
+ @error('discription')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
+ <strong>{{ $message }}</strong>
|
|
|
+ </span>
|
|
|
@enderror
|
|
|
</div>
|
|
|
- {{-- email--}}
|
|
|
+
|
|
|
+
|
|
|
<div class="form-group">
|
|
|
- <label for="title">نام مستعار جدید</label>
|
|
|
- <input type="slug" name="slug"
|
|
|
- class="form-control @error('slug') is-invalid @enderror"
|
|
|
- value="{{$category->slug}}">
|
|
|
- @error('slug')
|
|
|
- <div class="alert alert-danger">{{$message}}</div>
|
|
|
+ <label for="creator_id">{{ __(' نام ثبت کننده دسته بندی') }}</label>
|
|
|
+ <input id="creator_id" type="text"
|
|
|
+ class="form-control @error('creator_id') is-invalid @enderror"
|
|
|
+ name="creator_id"
|
|
|
+ value="{{ auth()->user()->name }}" required autocomplete="creator_id"
|
|
|
+ readonly>
|
|
|
+
|
|
|
+ @error('creator_id')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
+ <strong>{{ $message }}</strong>
|
|
|
+ </span>
|
|
|
@enderror
|
|
|
</div>
|
|
|
|
|
|
+ <div class="form-group mb-0">
|
|
|
+ <div class="">
|
|
|
+ <button type="submit" class="btn btn-primary">
|
|
|
+ {{ __('ویرایش دسته بندی') }}
|
|
|
+ </button>
|
|
|
|
|
|
- <div class="form-group">
|
|
|
- <button type="submit" class="btn btn-success">ذخیره</button>
|
|
|
- <a href="{{route('admin.categories')}}" class="btn btn-warning">انصراف</a>
|
|
|
+ <a href={{ route('categories-products.index') }} type="button" class="btn btn-warning">
|
|
|
+ انصراف</a>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="card-footer">
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
-
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-@endsection
|
|
|
-
|
|
|
-
|
|
|
+ @endslot
|
|
|
|
|
|
+ @slot('script')
|
|
|
|
|
|
+ @endslot
|
|
|
|
|
|
+@endcomponent
|
|
|
|