| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- @extends('layouts.app')
- @section('content')
- <div class="row mb-2">
- <div class="col-md-6">
- <h3>Округа</h3>
- </div>
- <div class="col-md-6 text-end">
- <button type="button" class="btn btn-sm btn-success me-2" data-bs-toggle="modal" data-bs-target="#importModal">
- Импорт
- </button>
- <form action="{{ route('admin.district.export') }}" method="post" class="d-inline">
- @csrf
- <button type="submit" class="btn btn-sm btn-outline-success me-2">Экспорт</button>
- </form>
- <button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
- Добавить
- </button>
- </div>
- </div>
- @include('partials.table', [
- 'id' => $id,
- 'header' => $header,
- 'strings' => $districts,
- 'routeName' => 'admin.district.show',
- 'searchFields' => $searchFields,
- 'sortBy' => $sortBy,
- 'orderBy' => $orderBy,
- 'filters' => [],
- 'ranges' => [],
- 'dates' => [],
- 'enableColumnFilters' => false,
- ])
- <!-- Модальное окно добавления -->
- <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="addDistrictModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="addDistrictModalLabel">Добавить округ</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('admin.district.store') }}" method="post">
- @csrf
- @include('partials.input', ['name' => 'shortname', 'title' => 'Сокращение', 'required' => true])
- @include('partials.input', ['name' => 'name', 'title' => 'Название', 'required' => true])
- @include('partials.submit', ['name' => 'Добавить'])
- </form>
- </div>
- </div>
- </div>
- </div>
- <!-- Модальное окно импорта -->
- <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="importDistrictModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="importDistrictModalLabel">Импорт округов</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('admin.district.import') }}" method="post" enctype="multipart/form-data">
- @csrf
- <div class="mb-3">
- <p class="text-muted small">
- Формат файла: XLSX с колонками: ID, Сокращение, Название.<br>
- Первая строка — заголовки.
- </p>
- </div>
- @include('partials.input', ['name' => 'import_file', 'type' => 'file', 'title' => 'XLSX файл', 'required' => true])
- @include('partials.submit', ['name' => 'Импорт'])
- </form>
- </div>
- </div>
- </div>
- </div>
- @endsection
|