list.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. @extends('admin.layout.index')
  2. @push('css-head')
  3. @endpush
  4. @section('content')
  5. <!-- Page header -->
  6. <div class="page-header page-header-light">
  7. <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
  8. <div class="d-flex">
  9. <div class="breadcrumb">
  10. <a href="{{url('/admin')}}" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Dashboard</a>
  11. <span class="breadcrumb-item active">Roles</span>
  12. </div>
  13. </div>
  14. <div class="header-elements d-none">
  15. <div class="breadcrumb justify-content-center">
  16. <a href="{{ url('admin/roles/create') }}" class="breadcrumb-elements-item">
  17. <i class="icon-plus3 mr-2"></i>
  18. Create new
  19. </a>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <!-- /page header -->
  25. <!-- Content area -->
  26. <div class="content">
  27. <div class="card">
  28. <table class="table datatable-basic">
  29. <thead>
  30. <tr>
  31. <th style="width: 5%;">#</th>
  32. <th>Name</th>
  33. <th class="text-center">Actions</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. @foreach($roles as $key => $row)
  38. <tr>
  39. <td>{{ ++$key }}</td>
  40. <td>{{ $row->name }}</td>
  41. <td class="text-center">
  42. <div class="list-icons">
  43. <div class="dropdown">
  44. <a href="#" class="list-icons-item" data-toggle="dropdown">
  45. <i class="icon-menu9"></i>
  46. </a>
  47. <div class="dropdown-menu dropdown-menu-right">
  48. <a href="{{ url('admin/roles/view') }}/{{ $row->id }}" class="dropdown-item">
  49. <i class="icon-eye"></i> View
  50. </a>
  51. <a href="{{ url('admin/roles/edit') }}/{{ $row->id }}" class="dropdown-item">
  52. <i class="icon-pencil7"></i> Edit
  53. </a>
  54. {!! Form::model($roles, ['method' => 'delete', 'url' => ['admin/roles/delete', $row->id], 'class' =>'dropdown-item form-delete']) !!}
  55. {!! Form::hidden('id', $row->id) !!}
  56. <i class="icon-trash"></i> Delete
  57. {!! Form::close() !!}
  58. </div>
  59. </div>
  60. </div>
  61. </td>
  62. </tr>
  63. @endforeach
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <!-- /content area -->
  69. @endsection
  70. @push('scripts')
  71. <script src="{{ asset('/assets/global/js/plugins/notifications/sweet_alert.min.js') }}"></script>
  72. <script src="{{ asset('/assets/global/js/plugins/tables/datatables/datatables.min.js') }}"></script>
  73. <script src="{{ asset('/assets/global/js/demo_pages/datatables_basic.js') }}"></script>
  74. <script type="text/javascript">
  75. $(document).ready(function(){
  76. $('[data-toggle="tooltip"]').tooltip();
  77. });
  78. </script>
  79. <script type="text/javascript">
  80. $('.form-delete').click(function(e){
  81. e.preventDefault();
  82. $form = $(this);
  83. swal({
  84. title: 'Are you sure?',
  85. text: "You won't be able to revert this!",
  86. type: 'warning',
  87. showCancelButton: true,
  88. confirmButtonColor: '#3085d6',
  89. cancelButtonColor: '#d33',
  90. confirmButtonText: 'Yes, delete it!'
  91. }).then((result) => {
  92. if (result.value) {
  93. $form.submit();
  94. }
  95. });
  96. });
  97. </script>
  98. @endpush