@extends('layouts/layoutMaster')

@section('title', '' . $stavka->naslov)

@section('vendor-style')
<link rel="stylesheet" href="{{asset('assets/vendor/libs/quill/typography.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/quill/katex.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/quill/editor.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/select2/select2.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/dropzone/dropzone.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/flatpickr/flatpickr.css')}}" />
<link rel="stylesheet" href="{{asset('assets/vendor/libs/tagify/tagify.css')}}" />
@endsection

@section('vendor-script')
<script src="{{asset('assets/vendor/libs/quill/katex.js')}}"></script>
<script src="{{asset('assets/vendor/libs/quill/quill.js')}}"></script>
<script src="{{asset('assets/vendor/libs/select2/select2.js')}}"></script>
<script src="{{asset('assets/vendor/libs/dropzone/dropzone.js')}}"></script>
<script src="{{asset('assets/vendor/libs/jquery-repeater/jquery-repeater.js')}}"></script>
<script src="{{asset('assets/vendor/libs/flatpickr/flatpickr.js')}}"></script>
<script src="{{asset('assets/vendor/libs/tagify/tagify.js')}}"></script>
@endsection

@section('page-script')
<script src="{{asset('assets/js/app-ecommerce-product-add.js')}}"></script>
@endsection

@section('content')
<h4 class="py-3 mb-0">
    <span class="text-muted fw-light">Novosti /</span><span class="fw-medium"> {{$stavka->naslov}}</span>
</h4>

<div class="app-ecommerce">
    <form method="POST" action="{{route('admin.novosti.update', $stavka->id)}}" onsubmit="return true"
        enctype="multipart/form-data">
        @csrf
        @method('PUT')
        <!-- Add Product -->
        <div
            class="d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center mb-3">

            <div class="d-flex flex-column justify-content-center">
                <h4 class="mb-1 mt-3">Uredi novost</h4>
                <p class="text-muted">Ovdje možete urediti sadržaj novosti</p>
            </div>
            <div class="d-flex align-content-center flex-wrap gap-3">
                <button type="submit" class="btn btn-primary">Spremi</button>
            </div>

        </div>

        <div class="row">

            <!-- First column-->
            <div class="col-12 col-lg-12">

                <div class="row">
                    <div class="col-lg-7">
                        <div class="card mb-4">
                            <div class="card-header">
                                <h5 class="card-tile mb-0">Sadržaj</h5>
                            </div>
                            <div class="card-body">
                                <div class="mb-3">
                                    <label class="form-label" for="naslov ">Naslov</label>
                                    <input type="text" class="form-control" id="naslov" name="naslov"
                                        value="{{$stavka->naslov}}">
                                </div>
                                <div class="mb-3"><label class="form-label" for="kategorija">Kategorija</label>
                                    <input type="text" class="form-control" id="kategorija" name="kategorija"
                                        value="{{$stavka->kategorija}}">
                                </div>
                                <div class="mb-3">
                                    <label class="form-label" for="kategorija">Sadržaj</label>
                                    <textarea class="form-control" name="sadrzaj" id="sadrzaj"
                                        rows="5">{{$stavka->sadrzaj}}</textarea>

                                </div>

                            </div>
                        </div>

                        <div class="card mb-4">
                            <div class="card-header">
                                <h5 class="card-tile mb-0">Dodaj novu sliku (500 x 500px)</h5>
                            </div>
                            <div class="card-body">
                                <input type="file" id="slika" class="form-control" name="slika" />
                            </div>
                        </div>
                    </div>
                    <!-- /Product Information -->
                    <!-- Media -->
                    <div class="col-lg-5">
                        <div class="card mb-4">
                            <div class="card-header">
                                <h5 class="card-tile mb-0">Slika proizvoda</h5>
                            </div>
                            <div class="card-body">
                                <img src="{{ asset($stavka->slika) }}" alt="">
                            </div>
                        </div>
                    </div>
                </div>

            </div>

        </div>
    </form>
</div>

@endsection