index.blade.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-2">
  4. <div class="col-md-4">
  5. <h3>Площадки</h3>
  6. </div>
  7. <div class="col-md-4 text-center">
  8. @include('partials.year-switcher')
  9. </div>
  10. <div class="col-md-4 text-end">
  11. @if(hasRole('admin'))
  12. <a href="{{ route('order.create') }}" class="btn btn-sm btn-primary">Создать</a>
  13. @endif
  14. @if(hasRole('admin,manager'))
  15. <button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#exportOrdersModal">Экспорт</button>
  16. @endif
  17. </div>
  18. </div>
  19. @include('partials.table', [
  20. 'id' => $id,
  21. 'header' => $header,
  22. 'strings' => $orders,
  23. 'statuses' => $statuses,
  24. 'routeName' => 'order.show',
  25. ])
  26. @include('partials.pagination', ['items' => $orders])
  27. @if(hasRole('admin,manager'))
  28. <div class="modal fade" id="exportOrdersModal" tabindex="-1" aria-labelledby="exportOrdersModalLabel" aria-hidden="true">
  29. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  30. <div class="modal-content">
  31. <div class="modal-header">
  32. <h1 class="modal-title fs-5" id="exportOrdersModalLabel">Экспорт площадок</h1>
  33. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  34. </div>
  35. <div class="modal-body">
  36. <form action="{{ route('order.export') }}" method="post">
  37. @csrf
  38. @include('partials.checkbox', ['title' => 'С учётом текущего фильтра и поиска', 'name' => 'withFilter', 'type' => 'checkbox', 'value' => 'yes', 'checked' => false])
  39. <div class="d-none">
  40. @if(request()->s)
  41. @include('partials.input', ['name' => 's', 'title' => 'поиск', 'value' => request()->s])
  42. @endif
  43. @if(request()->sortBy)
  44. @include('partials.input', ['name' => 'sortBy', 'title' => 'sortBy', 'value' => request()->sortBy])
  45. @endif
  46. @if(request()->has('order'))
  47. @include('partials.input', ['name' => 'order', 'title' => 'order', 'value' => request()->order])
  48. @endif
  49. @if(request()->filters)
  50. @foreach(request()->filters as $filterName => $filterValue)
  51. @include('partials.input', ['name' => 'filters[' . $filterName .']', 'title' => $filterName, 'value' => $filterValue])
  52. @endforeach
  53. @endif
  54. </div>
  55. @include('partials.submit', ['name' => 'Экспорт'])
  56. </form>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. @endif
  62. @endsection