data-table.blade.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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" style="{!! $grid->option('show_bordered') ? 'padding:3px 10px 0;margin-bottom:10px!important' : '' !!}">
  31. <table
  32. class="table custom-data-table dataTable dt-checkboxes-select
  33. {{ $grid->getComplexHeaders() ? 'complex-headers' : ''}}
  34. {{ $grid->option('table_class') }}
  35. {{ $grid->option('show_bordered') ? 'table-bordered' : '' }} "
  36. id="{{ $tableId }}"
  37. >
  38. <thead>
  39. @if ($headers = $grid->getComplexHeaders())
  40. <tr>
  41. @foreach($headers as $header)
  42. {!! $header->render() !!}
  43. @endforeach
  44. </tr>
  45. @endif
  46. <tr>
  47. @foreach($grid->columns() as $column)
  48. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  49. @endforeach
  50. </tr>
  51. </thead>
  52. @if ($grid->hasQuickCreate())
  53. {!! $grid->renderQuickCreate() !!}
  54. @endif
  55. <tbody>
  56. @foreach($grid->rows() as $row)
  57. <tr {!! $row->rowAttributes() !!}>
  58. @foreach($grid->getColumnNames() as $name)
  59. <td {!! $row->columnAttributes($name) !!}>
  60. {!! $row->column($name) !!}
  61. </td>
  62. @endforeach
  63. </tr>
  64. @endforeach
  65. @if ($grid->rows()->isEmpty())
  66. <tr>
  67. <td colspan="{!! count($grid->getColumnNames()) !!}">
  68. <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>
  69. </td>
  70. </tr>
  71. @endif
  72. </tbody>
  73. </table>
  74. </div>
  75. {!! $grid->renderFooter() !!}
  76. @if ($paginator = $grid->paginator())
  77. <div class="box-footer clearfix " style="padding-bottom:5px;">
  78. {!! $paginator->render() !!}
  79. </div>
  80. @else
  81. <div class="box-footer clearfix text-80 " style="height:48px;line-height:25px;">
  82. @if ($grid->rows()->isEmpty())
  83. {!! trans('admin.pagination.range', ['first' => '<b>0</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  84. @else
  85. {!! trans('admin.pagination.range', ['first' => '<b>1</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  86. @endif
  87. </div>
  88. @endif
  89. </div>