table.blade.php 3.2 KB

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