edit.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @component('panel.layouts.component', ['title' => 'ویرایش دسته جدید'])
  2. @slot('style')
  3. <style>
  4. .card-header {
  5. text-align: center !important;
  6. }
  7. .form-control {
  8. background-color: hsl(315, 22%, 86%);
  9. }
  10. .required {
  11. color: red;
  12. }
  13. .py-5 {
  14. padding-top: 0 !important;
  15. }
  16. </style>
  17. @endslot
  18. @slot('subject')
  19. <h1><i class="fa fa-users"></i> ویرایش دسته بندی </h1>
  20. @endslot
  21. {{-- @slot('breadcrumb')--}}
  22. {{-- <a href=""><li class="breadcrumb-item"> دسته بندی / </li></a>--}}
  23. {{-- <a href=""><li class="breadcrumb-item">&nbsp; ویرایش دسته بندی/ </li></a>--}}
  24. {{-- <li class="breadcrumb-item">&nbsp; {{$category->title}} </li>--}}
  25. {{-- @endslot--}}
  26. @slot('breadcrumb')
  27. <li class="breadcrumb-item"> {{$category->title}} </li>
  28. <li class="breadcrumb-item">&nbsp; ویرایش دسته بندی&nbsp;/ </li>
  29. <a href="{{ route('categories.index') }}" ><li class="breadcrumb-item"> &nbsp;دسته بندی </li></a>
  30. @endslot
  31. @slot('content')
  32. <div class="auth-background h-auto py-5">
  33. @component('product::components.message')
  34. @endcomponent
  35. <div class="container py-5">
  36. <div class="row align-items-center">
  37. <div class="col-lg-12 col-md-12 mx-auto">
  38. <div class="card">
  39. <div class="card-header"><strong>{{ __('ویرایش دسته بندی ') }}</strong></div>
  40. <div class="card-body mx-lg-5 px-lg-3">
  41. <form method="POST" action="{{ route('categories.update',$category->id) }}">
  42. @csrf
  43. @if ($category)
  44. @method('PUT')
  45. @endif
  46. <div class="form-group">
  47. <label for="title">{{ __('category.title') }}</label><i class="required">&nbsp; *</i>
  48. <input id="title" type="text"
  49. class="form-control @error('title') is-invalid @enderror" name="title"
  50. value="{{$category->title}}" autocomplete="title" autofocus>
  51. @error('title')
  52. <span class="invalid-feedback" role="alert">
  53. <strong>{{ $message }}</strong>
  54. </span>
  55. @enderror
  56. </div>
  57. <div class="form-row">
  58. <div class="form-group col-lg-4">
  59. <label for="slug">{{ __('category.slug') }}</label>
  60. <input id="slug" type="text"
  61. class="form-control @error('slug') is-invalid @enderror"
  62. name="slug" value="{{$category->slug}}"
  63. autocomplete="slug" autofocus>
  64. @error('slug')
  65. <span class="invalid-feedback" role="alert">
  66. <strong>{{ $message }}</strong>
  67. </span>
  68. @enderror
  69. </div>
  70. <div class="col-lg-4">
  71. <label>دسته بندی والد:</label>
  72. <select name="parent_id"
  73. class="form-control select2 @error('parent_id') is-invalid @enderror" >
  74. <option value="0">--</option>
  75. {!! category_select_options( $categories, $category->parent_id ) !!}
  76. </select>
  77. @error('parent_id')
  78. <span class="invalid-feedback" role="alert">
  79. <strong>{{ $message }}</strong>
  80. </span>
  81. @enderror
  82. </div>
  83. <div class="form-group col-lg-4">
  84. <label for="category_type">{{ __('category.category_type') }}</label><i class="required">&nbsp; *</i>
  85. <select id="category_type" type="text"
  86. class="form-control @error('category_type') is-invalid @enderror"
  87. name="category_type"
  88. autocomplete="category_type">
  89. <option value="">انتخاب کنید</option>
  90. <option value="0" @if ($category->category_type === 'محصولات') selected='selected'@endif>محصولات</option>
  91. <option value="1" @if ($category->category_type === 'اخبار') selected='selected'@endif>اخبار</option>
  92. <option value="2" @if ($category->category_type === 'مطالب') selected='selected'@endif>مطالب</option>
  93. </select>
  94. @error('category_type')
  95. <span class="invalid-feedback" role="alert">
  96. <strong>{{ $message }}</strong>
  97. </span>
  98. @enderror
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label for="discription">{{ __('category.discription') }}</label><i class="required">&nbsp; *</i>
  103. <textarea id="discription" type="text"
  104. class="form-control editor @error('discription') is-invalid @enderror"
  105. name="discription"
  106. autocomplete="discription">{{$category->discription}}</textarea>
  107. @error('discription')
  108. <span class="invalid-feedback" role="alert">
  109. <strong>{{ $message }}</strong>
  110. </span>
  111. @enderror
  112. </div>
  113. <div class="form-group mb-0">
  114. <div class="">
  115. <button type="submit" class="btn btn-primary">
  116. {{ __('ویرایش دسته بندی') }}
  117. </button>
  118. <a href={{ route('categories.index') }} type="button"
  119. class="btn btn-warning">
  120. انصراف</a>
  121. </div>
  122. </div>
  123. </form>
  124. </div>
  125. <div class="card-footer">
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. @endslot
  133. @slot('script')
  134. @endslot
  135. @endcomponent