table.blade.php 3.1 KB

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