@extends('layouts.admin.theme')
@section('title', env('APP_NAME') . ' :: ' . __('Nova legislação'))

@section('content')
    @include('errors.messageFlash')

    <div class="card shadow-sm">
        @php $headLine = "<i class='fa-solid fa-plus'></i> " . __('Nova legislação'); @endphp
        @include('components.buttons._headLineButtonsBackAdd', [
            'headLine' => __($headLine),
            'routeBack' => 'admin.legislacao.index',
            'routeBackParams' => request()->only(['q', 'page', 'ano', 'tipo', 'status', 'sort_by', 'sort_dir']),
            'nameBack' => __('Legislações'),
            'permission' => 'GERENCIADOR_DE_LEGISLACAO',
        ])
        <div class="card-body">
            <form id="legislacao-main-form" method="post"
                action="{{ route('admin.legislacao.store', request()->only(['q', 'page', 'ano', 'tipo', 'status', 'sort_by', 'sort_dir'])) }}"
                enctype="multipart/form-data">
                @csrf
                @include('admin.legislacao._form')
            </form>
        </div>
    </div>
@endsection

@push('scripts')
    {{-- Tom Select em public/pmar/lib (public/vendor é ignorado pelo .gitignore) --}}
    <link rel="stylesheet" href="{{ asset('pmar/lib/tom-select/tom-select.bootstrap5.min.css') }}">
    <link rel="stylesheet" href="{{ asset('pmar/css/admin/legislacao/categorias-tom-select.css') }}">
@endpush

@push('after-scripts')
    <script src="{{ asset('pmar/lib/tom-select/tom-select.complete.min.js') }}"></script>
    <script src="{{ asset('pmar/js/admin/legislacao-boletim-api-select.js') }}" defer></script>
    <script src="{{ asset('pmar/js/admin/legislacao-form.js') }}" defer></script>
@endpush
