index.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. @component('panel.layouts.component', ['title' => 'دسته بندی '])
  2. @slot('style')
  3. <style>
  4. .btnSearch {margin-top: 10px;}
  5. .searchNaum {margin: 20px;}
  6. </style>
  7. @endslot
  8. @slot('subject')
  9. <h1><i class="fa fa-users"></i> دسته بندی </h1>
  10. <p>لیست دسته بندی های تعریف شده برای مدیریت سطوح دسترسی.</p>
  11. @endslot
  12. @slot('breadcrumb')
  13. <li class="breadcrumb-item">دسته بندی</li>
  14. @endslot
  15. @slot('content')
  16. <div class="row">
  17. <div class="col-md-12">
  18. @component('product::components.message')
  19. @endcomponent
  20. @component('components.collapse-card' , ['title' => 'جست جو دسته بندی'])
  21. @slot('body')
  22. <form method="GET" action="">
  23. <div class="form-row">
  24. <div class="col">
  25. <label for="categories">{{ __(' نام دسته بندی:') }}</label>
  26. <input type="text" class="form-control" placeholder="محصول..."
  27. name="categoryName" value="{{ request()->query('categoryName') }}">
  28. </div>
  29. <div class="col">
  30. <label for="categories">{{ __(' slug:') }}</label>
  31. <input type="text" class="form-control" placeholder="دسته بندی..."
  32. name="categorySlug"
  33. value="{{ request()->query('categorySlug') }}">
  34. </div>
  35. <div class="col">
  36. <label for="categories">{{ __(' نام ثبت کننده:') }}</label>
  37. <input type="text" class="form-control" placeholder="ایجاد کننده دسته بندی..."
  38. name="creatorId" value="{{ request()->query('creatorId') }}">
  39. </div>
  40. </div>
  41. <button type="submit" class="btn btn-primary float-left btnSearch" id="show">جستجو
  42. </button>
  43. @if($categories->total() > 0)
  44. <p class="searchNaum">نتایج یافت شده:{{$categories->total()}}</p>
  45. @endif
  46. </form>
  47. <div class="mt-4">
  48. <a href="{{ route('categories.create') }}" type="button" class="btn btn-primary"><i
  49. class="fa fa-plus"></i> ایجاد دسته بندی</a>
  50. </div>
  51. @component('components.table')
  52. @slot('thead')
  53. <tr>
  54. <th>شماره دسته بندی</th>
  55. <th>نام دسته بندی</th>
  56. <th>slug</th>
  57. <th>نوع دسته بندی</th>
  58. <th> parent</th>
  59. <th>توضیحات دسته بندی</th>
  60. <th> اضافه کننده دسته بندی</th>
  61. <th> مدیریت</th>
  62. </tr>
  63. @endslot
  64. @slot('tbody')
  65. @forelse ($categories as $category)
  66. <tr>
  67. <td>{{$category->id}}</td>
  68. <td>{{$category->title}}</td>
  69. <td>{{$category->slug}}</td>
  70. <td>{{$category->category_type}}</td>
  71. <td>{{$category->parent}}</td>
  72. <td><?php echo mb_substr(strip_tags($category->discription), 0, 15, 'UTF8') . '...'?></td>
  73. <td>{{$category->user->name}}</td>
  74. <td class="d-flex">
  75. <a href="{{route('categories.edit', $category->id)}}"
  76. class="btn btn-sm btn-primary mr-2">ویرایش</a>
  77. <form action="{{route('categories.destroy', $category->id)}}" method="POST" onsubmit="return confirm('آیا مطمئن هستید؟');">
  78. @csrf
  79. @method('DELETE')
  80. <button type="submit" class="btn btn-sm btn-danger">حذف</button>
  81. </form>
  82. </td>
  83. </tr>
  84. @empty
  85. <tr>
  86. <td colspan="5" class="text-center">موردی برای نمایش وجود ندارد.</td>
  87. </tr>
  88. @endforelse
  89. @endslot
  90. @endcomponent
  91. {{--Paginate section--}}
  92. {{ $categories->withQueryString()->links() }}
  93. @endslot
  94. @endcomponent
  95. </div>
  96. </div>
  97. @endslot
  98. @slot('script')
  99. @endslot
  100. @endcomponent