@extends('dashboard')

@section('page_title')
    List $MODEL_NAME_PLURAL_CAMEL$
@stop

@section('breadcrumb')
    <li class="active">$MODEL_NAME$</li>
@stop

@section('css')
    <link href="/theme/admin-lte/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
    <style>
        .action li {
            display: inline;
            padding-left:3px;
        }
    </style>
@stop

@section('js')
    <script src="/theme/DataTables/media/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.rawgit.com/DataTables/Plugins/master/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
    <script>
    $(document).ready(function() {
        $('#table1').dataTable({
            "responsive" : true,
            "paging":   true,
            "ordering": true,
            "info":     true,
            "order": [[ $UPDATE_AT_FIELD_POSITION$, "desc" ]]
        });
    });
    </script>
@stop


@section('content')

    @include('flash::message')

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <i class="fa fa-plus-circle"></i>
                    {!! link_to(route('admin.$MODEL_NAME_PLURAL_CAMEL$.create'), 'New $MODEL_NAME_CAMEL$', ['id' => 'create$MODEL_NAME$']) !!}
                </div>
                
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">

                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-striped table-bordered table-hover dataTable no-footer" id="table1" role="grid" aria-describedby="dataTables-example_info">
                                        <thead>
                                            <tr role="row">
                                                <!-- <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 171px;">
                                                    Title
                                                </th> -->
                                                $FIELD_HEADERS$
                                                <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 171px;">
                                                    Created at
                                                </th>
                                                <th style="width: 108px;">&nbsp;</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @foreach ($$MODEL_NAME_PLURAL_CAMEL$ as $$MODEL_NAME_CAMEL$)
                                                <tr class="gradeA odd" role="row">
                                                    <!-- <td class="sorting_1">{{$$MODEL_NAME_CAMEL$->title}}</td> -->
                                                    $FIELD_BODY$
                                                    <td class="center">{{$$MODEL_NAME_CAMEL$->updated_at->format('Y-m-d')}}</td>
                                                    <td class="center">
                                                        <a href="{{route('$MODEL_NAME_PLURAL_CAMEL$.show', $$MODEL_NAME_CAMEL$->id)}}" title="Show" alt="Show">
                                                            <i class='fa fa-eye' style="color:black;;margin-right:5px"></i>
                                                        </a>
                                                        <a href="{{route('admin.$MODEL_NAME_PLURAL_CAMEL$.edit', $$MODEL_NAME_CAMEL$->id)}}" title="Edit" alt="Edit">
                                                            <i class='fa fa-pencil-square-o' style="color:black;margin-right:5px"></i>
                                                        </a>
                                                        <!-- <i class="fa fa-times"></i> -->
                                                        <span class="delete">
                                                            {!! Form::open(['route' => ['admin.$MODEL_NAME_PLURAL_CAMEL$.destroy', $$MODEL_NAME_CAMEL$->id], 'method' => 'delete', 'style' => 'float:right']) !!}
                                                                <!-- <span>{!! Form::submit('Borrar', ['class' => 'delButton']) !!}</span> -->
                                                                <button type="submit" style="margin-left:-95%;" onclick="return confirm('Are you sure wants to delete this $MODEL_NAME$?')">
                                                                    <i class="delButton fa fa-times"></i>
                                                                </button>
                                                            {!! Form::close() !!}
                                                        </span>
                                                    </td>
                                                </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.panel-body -->
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
@endsection