@extends('Vzdelavanie::layout.integrated')

@section('content')
    @parent
    <div class="main-container">
        <section class="bg-white space-sm pb-4">
            <div class="container">
                <div class="row">
                    <div class="col">
                        <div class="media align-items-center">
                            <img src="{{$ucebnica->obrazok}}" alt="" class="avatar avatar-lg">
                            <div class="media-body">
                                <div class="mb-3">
                                    <h1 class="h2 mb-2">{{$ucebnica->nazov}}</h1>
                                    <span>Upraviť učebný materiál</span>
                                </div>
                            </div>
                        </div>
                        @include('flash::message')
                    </div>
                </div>
            </div>
        </section>

        <section class="flush-with-above space-0">
            <div class="bg-white">
                <div class="container">
                    <div class="row">
                        <div class="col">
                            <ul class="nav nav-tabs" id="myTab" role="tablist">
                                <li class="nav-item">
                                    <p class="nav-link active">Učebný materiál</p>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('vzdelavanie.sprava.kniznica.kategoria.ucebnice.sekcia.index', [$kategoria, $ucebnica]) }}" class="nav-link">Sekcie</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <section class="flush-with-above height-80 d-block">
            <div class="tab-content">
                <div class="tab-pane fade active show" id="general" role="tabpanel" aria-labelledby="general-tab">
                    <div class="container">
                        @if($errors->any())
                        <div class="row">
                            <div class="col-12">
                                <div class="alert alert-danger text-small" role="alert">
                                    <i class="icon-shield"></i>
                                    <span>Skontrolujte si prosím zadané údaje, niečo nie je v poriadku.</span>
                                </div>
                            </div>
                        </div>
                        @endif
                        <div class="row">
                            <div class="col-12">
                                @include('Vzdelavanie::pages.sprava.kniznica.ucebne_materialy.partials.form', ['edit' => true])
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    @push('scripts')
        <script src="/vendor/laravel-filemanager/js/stand-alone-button.js"></script>
        <script type="application/javascript">
          $('#lfm').filemanager('file', {prefix: '/file-manager'});
        </script>
    @endpush
@endsection
