data-table.blade.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <div class="dcat-box custom-data-table dt-bootstrap4">
  2. @if ($grid->allowToolbar())
  3. <div class="custom-data-table-header">
  4. <div class="table-responsive">
  5. <div class="top" style="padding: 0">
  6. @if(!empty($title))
  7. <h4 style="margin:5px 10px 0;">
  8. {!! $title !!}&nbsp;
  9. @if(!empty($description))
  10. <small>{!! $description!!}</small>
  11. @endif
  12. </h4>
  13. <div data-responsive-table-toolbar="{{$tableId}}">
  14. {!! $grid->renderTools() !!} {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!} {!! $grid->renderQuickSearch() !!}
  15. </div>
  16. @else
  17. <div>
  18. {!! $grid->renderTools() !!} {!! $grid->renderQuickSearch() !!}
  19. </div>
  20. <div data-responsive-table-toolbar="{{$tableId}}">
  21. {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!}
  22. </div>
  23. @endif
  24. </div>
  25. </div>
  26. </div>
  27. @endif
  28. {!! $grid->renderFilter() !!}
  29. {!! $grid->renderHeader() !!}
  30. <div class="table-responsive table-wrapper">
  31. <table
  32. class="table custom-data-table dataTable dt-checkboxes-select
  33. {{ $grid->option('table_class') }}
  34. {{ $grid->option('show_bordered') ? 'table-bordered complex-headers' : '' }} "
  35. id="{{ $tableId }}"
  36. >
  37. <thead>
  38. @if ($headers = $grid->getComplexHeaders())
  39. <tr>
  40. @foreach($headers as $header)
  41. {!! $header->render() !!}
  42. @endforeach
  43. </tr>
  44. @endif
  45. <tr>
  46. @foreach($grid->columns() as $column)
  47. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  48. @endforeach
  49. </tr>
  50. </thead>
  51. @if ($grid->hasQuickCreate())
  52. {!! $grid->renderQuickCreate() !!}
  53. @endif
  54. <tbody>
  55. @foreach($grid->rows() as $row)
  56. <tr {!! $row->rowAttributes() !!}>
  57. @foreach($grid->getColumnNames() as $name)
  58. <td {!! $row->columnAttributes($name) !!}>
  59. {!! $row->column($name) !!}
  60. </td>
  61. @endforeach
  62. </tr>
  63. @endforeach
  64. @if ($grid->rows()->isEmpty())
  65. <tr>
  66. <td colspan="{!! count($grid->getColumnNames()) !!}">
  67. <div style="margin:5px 0 0 10px;"><span class="help-block" style="margin-bottom:0"><i class="feather icon-alert-circle"></i>&nbsp;{{ trans('admin.no_data') }}</span></div>
  68. </td>
  69. </tr>
  70. @endif
  71. </tbody>
  72. </table>
  73. </div>
  74. {!! $grid->renderFooter() !!}
  75. @if ($paginator = $grid->paginator())
  76. <div class="box-footer clearfix " style="padding-bottom:5px;">
  77. {!! $paginator->render() !!}
  78. </div>
  79. @else
  80. <div class="box-footer clearfix text-80 " style="height:48px;line-height:25px;">
  81. @if ($grid->rows()->isEmpty())
  82. {!! trans('admin.pagination.range', ['first' => '<b>0</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  83. @else
  84. {!! trans('admin.pagination.range', ['first' => '<b>1</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  85. @endif
  86. </div>
  87. @endif
  88. </div>