list.blade.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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">Permissions</span>
  12. </div>
  13. </div>
  14. <div class="header-elements d-none">
  15. <div class="breadcrumb justify-content-center">
  16. <a href="{{ url('admin/permissions/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>Parent</th>
  34. <th>Code</th>
  35. <th class="text-center">Actions</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @foreach($permissions as $key => $row)
  40. <tr>
  41. <td>{{ ++$key }}</td>
  42. <td>{{ $row->display_name }}</td>
  43. <td>{{ $row->parent != 0?$row->parentInfo->display_name:'Parent' }}</td>
  44. <td>{{ $row->name }}</td>
  45. <td class="text-center">
  46. <div class="list-icons">
  47. <div class="dropdown">
  48. <a href="#" class="list-icons-item" data-toggle="dropdown">
  49. <i class="icon-menu9"></i>
  50. </a>
  51. <div class="dropdown-menu dropdown-menu-right">
  52. <a href="{{ url('admin/permissions/view') }}/{{ $row->id }}" class="dropdown-item">
  53. <i class="icon-eye"></i> View
  54. </a>
  55. <a href="{{ url('admin/permissions/edit') }}/{{ $row->id }}" class="dropdown-item">
  56. <i class="icon-pencil7"></i> Edit
  57. </a>
  58. {!! Form::model($permissions, ['method' => 'delete', 'url' => ['admin/permissions/delete', $row->id], 'class' =>'dropdown-item form-delete']) !!}
  59. {!! Form::hidden('id', $row->id) !!}
  60. <i class="icon-trash"></i> Delete
  61. {!! Form::close() !!}
  62. </div>
  63. </div>
  64. </div>
  65. </td>
  66. </tr>
  67. @endforeach
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. <!-- /content area -->
  73. @endsection
  74. @push('scripts')
  75. <script src="{{ asset('/assets/global/js/plugins/notifications/sweet_alert.min.js') }}"></script>
  76. <script src="{{ asset('/assets/global/js/plugins/tables/datatables/datatables.min.js') }}"></script>
  77. <script src="{{ asset('/assets/global/js/demo_pages/datatables_basic.js') }}"></script>
  78. <script type="text/javascript">
  79. $(document).ready(function(){
  80. $('[data-toggle="tooltip"]').tooltip();
  81. });
  82. </script>
  83. <script type="text/javascript">
  84. $('.form-delete').click(function(e){
  85. e.preventDefault();
  86. $form = $(this);
  87. swal({
  88. title: 'Are you sure?',
  89. text: "You won't be able to revert this!",
  90. type: 'warning',
  91. showCancelButton: true,
  92. confirmButtonColor: '#3085d6',
  93. cancelButtonColor: '#d33',
  94. confirmButtonText: 'Yes, delete it!'
  95. }).then((result) => {
  96. if (result.value) {
  97. $form.submit();
  98. }
  99. });
  100. });
  101. </script>
  102. @endpush