index.blade.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-2">
  4. <div class="col-md-6">
  5. <h3>Округа</h3>
  6. </div>
  7. <div class="col-md-6 text-end">
  8. <button type="button" class="btn btn-sm btn-success me-2" data-bs-toggle="modal" data-bs-target="#importModal">
  9. Импорт
  10. </button>
  11. <form action="{{ route('admin.district.export') }}" method="post" class="d-inline">
  12. @csrf
  13. <button type="submit" class="btn btn-sm btn-outline-success me-2">Экспорт</button>
  14. </form>
  15. <button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
  16. Добавить
  17. </button>
  18. </div>
  19. </div>
  20. @include('partials.table', [
  21. 'id' => $id,
  22. 'header' => $header,
  23. 'strings' => $districts,
  24. 'routeName' => 'admin.district.show',
  25. 'searchFields' => $searchFields,
  26. 'sortBy' => $sortBy,
  27. 'orderBy' => $orderBy,
  28. 'filters' => [],
  29. 'ranges' => [],
  30. 'dates' => [],
  31. 'enableColumnFilters' => false,
  32. ])
  33. <!-- Модальное окно добавления -->
  34. <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="addDistrictModalLabel" aria-hidden="true">
  35. <div class="modal-dialog">
  36. <div class="modal-content">
  37. <div class="modal-header">
  38. <h1 class="modal-title fs-5" id="addDistrictModalLabel">Добавить округ</h1>
  39. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  40. </div>
  41. <div class="modal-body">
  42. <form action="{{ route('admin.district.store') }}" method="post">
  43. @csrf
  44. @include('partials.input', ['name' => 'shortname', 'title' => 'Сокращение', 'required' => true])
  45. @include('partials.input', ['name' => 'name', 'title' => 'Название', 'required' => true])
  46. @include('partials.submit', ['name' => 'Добавить'])
  47. </form>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <!-- Модальное окно импорта -->
  53. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="importDistrictModalLabel" aria-hidden="true">
  54. <div class="modal-dialog">
  55. <div class="modal-content">
  56. <div class="modal-header">
  57. <h1 class="modal-title fs-5" id="importDistrictModalLabel">Импорт округов</h1>
  58. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  59. </div>
  60. <div class="modal-body">
  61. <form action="{{ route('admin.district.import') }}" method="post" enctype="multipart/form-data">
  62. @csrf
  63. <div class="mb-3">
  64. <p class="text-muted small">
  65. Формат файла: XLSX с колонками: ID, Сокращение, Название.<br>
  66. Первая строка — заголовки.
  67. </p>
  68. </div>
  69. @include('partials.input', ['name' => 'import_file', 'type' => 'file', 'title' => 'XLSX файл', 'required' => true])
  70. @include('partials.submit', ['name' => 'Импорт'])
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. @endsection