@extends('adminlte::page')
@section('title','Baneri')

@section('content_header')
<h1 class="m-0 text-dark">Baneri</h1>
<a href="{{ URL::route('admin\banners-create') }}"
    class="btn btn-default">{{ Lang::get('Dodaj novi baner') }}</a>
@stop

@section('content')
<table id="data-table" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>{{ Lang::get('ID') }}</th>
            <th>{{ Lang::get('Uvod') }}</th>
            <th>{{ Lang::get('Tekst linka') }}</th>
            <th>{{ Lang::get('Slika') }}</th>
            <th>{{ Lang::get('Kreirano') }}</th>
            <th>{{ Lang::get('Objavljeno') }}</th>
            <th>{{ Lang::get('Akcija') }}</th>
        </tr>
    </thead>
    <tbody>
        @foreach ($banners as $item)
        <tr>
            <?php
                if($item->status_id == 1){
                    $published = "Objavljeno";
                }else{
                    $published = "Neobjavljeno";
                }
            ?>
            <td>{{ $item->id }}</td>
            <td>{{ $item->introduction }}</td>
            <td>{{ $item->link_to_follow}}</td>
            <td><img style="height:100px; width:100px" src="/{{$item->image_path}}"></td>
            <td>{{ $item->created_at }}</td>
            <td>{{ $published }}</td>
            <td>
                <div class="btn-group">
                    <button data-toggle="dropdown" class="btn btn-xs dropdown-toggle" data-original-title="" title="">
                        {{ Lang::get('Izaberi') }} <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu pull-right">
                        <li>
                            <a class="font-weight-bold"
                                href="#">{{ Lang::get('Izmijeni') }}</a>
                        </li>
                    </ul>
                </div>
            </td>

        </tr>
        @endforeach
    </tbody>
</table>
{{ $banners->links() }}
@endsection
@section('js')
@section('plugins.Datatables', true)
<script>
    $(document).ready(function() {

            $('#data-table').DataTable({
                "paging": false,
                "lengthChange": false,
                "searching": true,
                "ordering": true,
                "info": false,
                "autoWidth": false
            });
    } );


</script>
@endsection
