1
0

table-panel.blade.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @props([
  2. 'title',
  3. 'thead_style' => 'default',
  4. 'theads' => [],
  5. 'count' => null,
  6. 'pagination' => null,
  7. 'grid' => '',
  8. 'filters' => null,
  9. 'body' => null,
  10. 'actions' => null,
  11. 'thead' => null,
  12. 'tbody' => null,
  13. 'deleteConfig' => null,
  14. ])
  15. <div class="panel" {!! $deleteConfig ? 'data-delete-config=' . json_encode($deleteConfig, JSON_THROW_ON_ERROR) : '' !!}>
  16. <div class="panel-heading">
  17. <h1 class="panel-title">{!! $title !!}</h1>
  18. @if ($actions)
  19. <div class="panel-actions">{{ $actions }}</div>
  20. @endif
  21. </div>
  22. <div class="panel-body {{ $grid ? 'row' : '' }}">
  23. @if ($filters)
  24. <form class="form-row {{ $grid ? 'col-12' : '' }}">
  25. {!! $filters !!}
  26. <div class="form-group btn-group col-auto">
  27. <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
  28. <button class="btn btn-danger" type="button" onclick="resetSearchForm()">{{ trans('common.reset') }}</button>
  29. </div>
  30. </form>
  31. @endif
  32. {!! $body !!}
  33. {!! $grid ? "<div class='$grid'>" : '' !!}
  34. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  35. <thead class="thead-{{ $thead_style }}">
  36. <tr>
  37. @forelse($theads as $key => $value)
  38. <th>
  39. @if (is_string($key))
  40. @sortablelink($key, $value)
  41. @else
  42. {{ $value }}
  43. @endif
  44. </th>
  45. @empty
  46. {!! $thead !!}
  47. @endforelse
  48. </tr>
  49. </thead>
  50. <tbody>
  51. {!! $tbody !!}
  52. </tbody>
  53. </table>
  54. {!! $grid ? '</div>' : '' !!}
  55. </div>
  56. @if ($count && $pagination)
  57. <div class="panel-footer">
  58. <div class="row">
  59. <div class="col-sm-4">{!! $count !!}</div>
  60. <div class="col-sm-8">
  61. <nav class="Page navigation float-right">{!! $pagination !!}</nav>
  62. </div>
  63. </div>
  64. </div>
  65. @endif
  66. </div>