index.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. 'nav' => $nav ?? null,
  33. ])
  34. <!-- Модальное окно добавления -->
  35. <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="addDistrictModalLabel" aria-hidden="true">
  36. <div class="modal-dialog">
  37. <div class="modal-content">
  38. <div class="modal-header">
  39. <h1 class="modal-title fs-5" id="addDistrictModalLabel">Добавить округ</h1>
  40. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  41. </div>
  42. <div class="modal-body">
  43. <form action="{{ route('admin.district.store') }}" method="post">
  44. @csrf
  45. @include('partials.input', ['name' => 'shortname', 'title' => 'Сокращение', 'required' => true])
  46. @include('partials.input', ['name' => 'name', 'title' => 'Название', 'required' => true])
  47. @include('partials.submit', ['name' => 'Добавить'])
  48. </form>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <!-- Модальное окно импорта -->
  54. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="importDistrictModalLabel" aria-hidden="true">
  55. <div class="modal-dialog">
  56. <div class="modal-content">
  57. <div class="modal-header">
  58. <h1 class="modal-title fs-5" id="importDistrictModalLabel">Импорт округов</h1>
  59. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  60. </div>
  61. <div class="modal-body">
  62. <form action="{{ route('admin.district.import') }}" method="post" enctype="multipart/form-data">
  63. @csrf
  64. <div class="mb-3">
  65. <p class="text-muted small">
  66. Формат файла: XLSX с колонками: ID, Сокращение, Название.<br>
  67. Первая строка — заголовки.
  68. </p>
  69. </div>
  70. @include('partials.input', ['name' => 'import_file', 'type' => 'file', 'title' => 'XLSX файл', 'required' => true])
  71. @include('partials.submit', ['name' => 'Импорт'])
  72. </form>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. @endsection