table.blade.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. @php
  2. $__id = 'grid-'.\Illuminate\Support\Str::random(8);
  3. @endphp
  4. @if ($grid->option('show_toolbar')
  5. && ($grid->getTools()->has() || $grid->allowExportBtn() || $grid->allowCreateBtn() || $grid->allowQuickCreateBtn() || $grid->allowResponsive() || !empty($title)))
  6. <div class="box-header " >
  7. @if(!empty($title))
  8. <h4 class="pull-left" style="margin:5px 10px 0;">
  9. {!! $title !!}&nbsp;
  10. @if(!empty($description))
  11. <small>{!! $description!!}</small>
  12. @endif
  13. </h4>
  14. <div class="pull-right" data-responsive-table-toolbar="{{$__id}}">
  15. {!! $grid->renderTools() !!} {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!}
  16. </div>
  17. @else
  18. <div class="pull-right" data-responsive-table-toolbar="{{$__id}}">
  19. {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!}
  20. </div>
  21. {!! $grid->renderTools() !!}
  22. @endif
  23. </div>
  24. @endif
  25. {!! $grid->renderFilter() !!}
  26. {!! $grid->renderHeader() !!}
  27. <div class="card-body panel-collapse collapse in table-responsive" {!! $grid->option('show_bordered') ? 'style="padding:3px 10px 10px"' : '' !!}>
  28. <table class=" table table-hover responsive {{ $grid->option('show_bordered') ? 'table-bordered' : $grid->option('table_header_style') }} " id="{{$__id}}">
  29. <thead>
  30. @if ($headers = $grid->getMutipleHeaders())
  31. <tr>
  32. @foreach($headers as $header)
  33. {!! $header->render() !!}
  34. @endforeach
  35. </tr>
  36. @endif
  37. <tr>
  38. @foreach($grid->getColumns() as $column)
  39. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->sorter() !!}</th>
  40. @endforeach
  41. </tr>
  42. </thead>
  43. <tbody>
  44. @foreach($grid->rows() as $row)
  45. <tr {!! $row->getRowAttributes() !!}>
  46. @foreach($grid->getColumnNames() as $name)
  47. <td {!! $row->getColumnAttributes($name) !!}>
  48. {!! $row->column($name) !!}
  49. </td>
  50. @endforeach
  51. </tr>
  52. @endforeach
  53. @if ($grid->rows()->isEmpty())
  54. <tr>
  55. <td colspan="{!! count($grid->getColumnNames()) !!}">
  56. <div style="margin:5px 0 0 10px;"><span class="help-block" style="margin-bottom:0"><i class="fa fa-info-circle"></i>&nbsp;{{ trans('admin.no_data') }}</span></div>
  57. </td>
  58. </tr>
  59. @endif
  60. </tbody>
  61. </table>
  62. </div>
  63. {!! $grid->renderFooter() !!}
  64. @if ($paginator = $grid->paginator())
  65. <div class="box-footer clearfix " style="padding-bottom:5px;">
  66. {!! $paginator !!}
  67. </div>
  68. @else
  69. <div class="box-footer clearfix text-80 " style="height:48px;line-height:25px;">
  70. @if ($grid->rows()->isEmpty())
  71. {!! trans('admin.pagination.range', ['first' => '<b>0</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  72. @else
  73. {!! trans('admin.pagination.range', ['first' => '<b>1</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  74. @endif
  75. </div>
  76. @endif