@extends('layouts.layout-2')

@section('content')

    <h4 class="font-weight-bold py-3 mb-1">
        {{ __('Reiseführer Seiten') }}
    </h4>

    <div class="card">
        <div class="card-datatable table-responsive py-2">
            <div class="mr-4 mb-2 text-right">
                {{-- <a href="{{ route('cms_travel_guide_page_detail', ['new']) }}" class="btn btn-sm btn-primary">Neuen Eintrag anlegen</a> --}}
            </div>
            <table class="datatables-travel_guide table table-striped table-bordered">
                <thead>
                <tr>
                    <th style="max-width: 60px;">&nbsp;</th>
                    <th>{{__('Name')}}</th>
                    <th>{{__('slug')}}</th>
                    <th>{{__('keyword')}}</th>
                    <th>{{__(' show_in_navi')}}</th>
                    <th>{{__('sichtbar')}}</th>
                    <th>order</th>
                </tr>
                </thead>
                <tbody>
                @foreach($travel_guide_pages as $value)
                    <tr>
                        <td>

                            <a href="{{ route('cms_travel_guide_page_detail', [$value->id]) }}" class="btn icon-btn btn-sm btn-primary">
                                <span class="fa fa-edit"></span>
                            </a>
                        </td>
                        <td>
                            @if($value->lvl == 1) - @endif
                            @if($value->lvl == 2) &nbsp; -- @endif
                            @if($value->lvl == 3) &nbsp; &nbsp; --- @endif
                                <a href="{{ route('cms_travel_guide_page_detail', [$value->id]) }}">
                                    @if($value->lvl == 1) <strong>@endif{{ $value->title }}</a>@if($value->lvl == 1)</strong>@endif
                        </td>
                        <td>{{ $value->slug }}</td>
                        <td>{{ $value->keyword }}</td>
                        <td data-sort="{{ $value->show_in_navi }}">
                            @if($value->show_in_navi)
                                <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
                            @else
                                <span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
                            @endif
                        </td>
                        <td data-sort="{{ $value->status }}">
                            @if($value->status)
                                <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
                            @else
                                <span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
                            @endif
                        </td>
                        <td>
                            {{ $value->order }}
                            {{-- <a class="text-danger" href="{{ route('cms_travel_guide_delete', [$value->id]) }}"  onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a> --}}
                        </td>
                    </tr>

                @endforeach
                </tbody>
            </table>
            <div class="mt-4 col">
                {{-- <a href="{{ route('cms_travel_guide_page_detail', ['new']) }}" class="btn btn-sm btn-primary">Neuen Eintrag anlegen</a> --}}
            </div>
        </div>
        <script>
            $( document ).ready(function() {
                $('.datatables-travel_guide').dataTable({
                    "bLengthChange": false,
                    "iDisplayLength": 100,
                    "language": {
                        "url": "/js/German.json"
                    },
                });


            });

        </script>
    </div>



@endsection