data-table.blade.php 4.0 KB

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