@extends('layouts/layoutMaster')
@section('title', 'Novosti')

@section('vendor-style')
<link rel="stylesheet" href="{{asset('assets/vendor/libs/datatables-bs5/datatables.bootstrap5.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/select2/select2.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/@form-validation/umd/styles/index.min.css')}}" />
@endsection

@section('vendor-script')
<script src="{{asset('assets/vendor/libs/moment/moment.js')}}"></script>
<script src="{{asset('assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js')}}"></script>
<script src="{{asset('assets/vendor/libs/select2/select2.js')}}"></script>
<script src="{{asset('assets/vendor/libs/@form-validation/umd/bundle/popular.min.js')}}"></script>
<script src="{{asset('assets/vendor/libs/@form-validation/umd/plugin-bootstrap5/index.min.js')}}"></script>
<script src="{{asset('assets/vendor/libs/@form-validation/umd/plugin-auto-focus/index.min.js')}}"></script>
<script src="{{asset('assets/vendor/libs/cleavejs/cleave.js')}}"></script>
<script src="{{asset('assets/vendor/libs/cleavejs/cleave-phone.js')}}"></script>
@endsection

@section('page-script')
<script src="{{asset('assets/js/novosti/lista.js')}}"></script>
@endsection

@section('content')
<h4 class="py-3 mb-2">
    <span class="text-muted fw-light">Novosti /</span> Sve novosti
</h4>


<!-- customers List Table -->
<div class="card">

    <div class="card-datatable table-responsive">
        <table class="datatables-customers table border-top">
            <thead>
                <tr>
                    <th>Naslov</th>
                    <th>Kategorija</th>
                    <th>Kreirano</th>
                    <th>Akcije</th>
                </tr>
            </thead>
        </table>
    </div>
    <!-- Offcanvas to add new customer -->
    <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasEcommerceCustomerAdd"
        aria-labelledby="offcanvasEcommerceCustomerAddLabel">
        <div class="offcanvas-header">
            <h5 id="offcanvasEcommerceCustomerAddLabel" class="offcanvas-title">Dodavanje novosti</h5>
            <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
        </div>
        <div class="offcanvas-body mx-0 flex-grow-0">
            <form class="klijentNovi pt-0" id="klijentNovi" method="POST" action="{{route('admin.novosti.novi')}}"
                onsubmit="return true" enctype="multipart/form-data">
                @csrf
                <div class="ecommerce-customer-add-basic mb-3">
                    <h6 class="mb-3">Informacije o proizvodu</h6>
                    <div class="mb-3">
                        <label class="form-label" for="naslov">Naslov*</label>
                        <input type="text" class="form-control" id="naslov" placeholder="Akcija od 31.10." name="naslov"
                            aria-label="Akcija od 31.10." />
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="kategorija">Kategorija*</label>
                        <input type="text" id="kategorija" class="form-control" placeholder="Akcije" aria-label="Akcije"
                            name="kategorija" />
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="sadrzaj">Sadržaj</label>
                        <textarea type="text" id="sadrzaj" class="form-control" name="sadrzaj"></textarea>
                    </div>
                    <div>
                        <label class="form-label" for="slika">Slika (343 x 174 px)</label>
                        <input type="file" id="slika" class="form-control" name="slika" />
                    </div>
                </div>

                <div class="pt-3">
                    <button type="submit" class="btn btn-primary me-sm-3 me-1 data-submit">Dodaj</button>
                    <button type="reset" class="btn btn-label-danger" data-bs-dismiss="offcanvas">Odustani</button>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection