@extends('adminlte::page')
@section('title','Meni i stranice')

@section('content_header')
<h1 class="m-0 text-dark">Meni i stranice</h1>
<a href="{{ URL::route('admin\page-create') }}" class="btn btn-default">{{ Lang::get('Dodaj novu stranicu') }}</a>
@stop

@section('content')
<table id="data-table" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>{{ Lang::get('ID') }}</th>
            <th>{{ Lang::get('Naziv') }}</th>
            <th>{{ Lang::get('Predloženi link') }}</th>
            <th>{{ Lang::get('Link') }}</th>
            <th>{{ Lang::get('Roditelj') }}</th>
            <th>{{ Lang::get('Objavljeno') }}</th>
            <th>{{ Lang::get('Akcija') }}</th>
        </tr>
    </thead>
    <tbody>
        @foreach ($data['menu_pages'] as $item)
        <?php if($item->status_id == 1){
                $published = "Objavljeno";
            }else{
                $published = "Neobjavljeno";
            }?>
        <tr>
            <td>{{ $item->id }}</td>
            <td>{{ $item->title_ba }}</td>
            <td>{{ $item->slug }}</td>
            <td>{{ $item->link }}</td>
            <td>{{ $item->parent_name }}</td>
            <td>{{ $published }}</td>
            <td>
                <div class="btn-group">
                    <button id="action-secondary-btn" 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
                                href="">{{ Lang::get('Izmijeni') }}</a>
                        </li>
                        <li>
                            <a href="">{!! Lang::get('Prikaži
                                sve dodatke') !!}</a>
                        </li>
                        <li>
                            <a href="#">{!!
                                Lang::get('Dodaj dodatak') !!}</a>
                        </li>
                        <!-- <li>
                            <a href="">{!! Lang::get('Obriši') !!}</a>
                        </li>!-->
                    </ul>
                </div>
            </td>
        </tr>
        @endforeach
    </tbody>
</table>

@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
