index.blade.php 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {{-- Вьюха: список услуг в административной панели --}}
  2. @extends('admin.layout')
  3. @section('title', 'Услуги')
  4. @section('content_header')
  5. <div class="d-flex justify-content-between align-items-center">
  6. <h1 class="m-0">Услуги</h1>
  7. <a href="{{ route('admin.services.create') }}" class="btn btn-primary btn-sm">
  8. <i class="fas fa-plus"></i> Добавить услугу
  9. </a>
  10. </div>
  11. @stop
  12. @section('breadcrumb')
  13. <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Главная</a></li>
  14. <li class="breadcrumb-item active">Услуги</li>
  15. @stop
  16. @section('content')
  17. @if(session('success'))
  18. <div class="alert alert-success alert-dismissible">
  19. <button type="button" class="close" data-dismiss="alert">&times;</button>
  20. {{ session('success') }}
  21. </div>
  22. @endif
  23. <div class="card card-outline card-primary">
  24. <div class="card-body p-0">
  25. @if($services->isEmpty())
  26. <div class="p-4 text-muted text-center">
  27. Услуг пока нет. <a href="{{ route('admin.services.create') }}">Добавить первую</a>
  28. </div>
  29. @else
  30. <table class="table table-hover mb-0">
  31. <thead>
  32. <tr>
  33. <th style="width:50px">#</th>
  34. <th style="width:40px"></th>
  35. <th>Название</th>
  36. <th>Slug</th>
  37. <th style="width:70px">Статус</th>
  38. <th style="width:110px"></th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. @foreach($services as $svc)
  43. <tr>
  44. <td class="text-muted">{{ $svc->sort_order }}</td>
  45. <td style="font-size:20px;line-height:1">{{ $svc->icon ?: '—' }}</td>
  46. <td>
  47. <strong>{{ $svc->title }}</strong>
  48. @if($svc->excerpt)
  49. <div class="text-muted small text-truncate" style="max-width:420px">
  50. {{ $svc->excerpt }}
  51. </div>
  52. @endif
  53. </td>
  54. <td><code class="small">{{ $svc->slug }}</code></td>
  55. <td>
  56. @if($svc->is_active)
  57. <span class="badge badge-success">активна</span>
  58. @else
  59. <span class="badge badge-secondary">скрыта</span>
  60. @endif
  61. </td>
  62. <td>
  63. <a href="{{ route('admin.services.edit', $svc) }}"
  64. class="btn btn-xs btn-default" title="Редактировать">
  65. <i class="fas fa-edit"></i>
  66. </a>
  67. <form action="{{ route('admin.services.destroy', $svc) }}"
  68. method="POST" class="d-inline"
  69. onsubmit="return confirm('Удалить услугу «{{ addslashes($svc->title) }}»?')">
  70. @csrf @method('DELETE')
  71. <button class="btn btn-xs btn-outline-danger" title="Удалить">
  72. <i class="fas fa-trash"></i>
  73. </button>
  74. </form>
  75. </td>
  76. </tr>
  77. @endforeach
  78. </tbody>
  79. </table>
  80. @endif
  81. </div>
  82. </div>
  83. @stop