@extends(Auth::check() && Auth::user()->role->layout == 1 ? 'layouts.admin' : 'layouts.employee')

@section('content')
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                {{trans('general.boats')}} Eliminadas
            </h1>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    @include('alert.success')
                    @include('alert.errorlist')
                    <a href="{{ asset('/boats') }}" type="button" class="btn btn-default btn-flat margin"> Embarcaciones</a>

                    <div class="box box-success">
                        <div class="box-header">
                            <h3 class="box-title">{{trans('general.lista')}} {{trans('general.boats')}}</h3>
                            <div class="box-tools">
                                {!! Form::open(['url' => '/boats/search', 'method' => 'get']) !!}
                                <div class="input-group input-group-sm" style="width: 150px;">
                                    {!! Form::text('term', null, ['class' => 'form-control pull-right', 'placeholder' => 'Search']) !!}
                                    <div class="input-group-btn">
                                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                                {!! Form::close() !!}
                            </div>
                        </div>
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover">
                                <tr>
                                    <th>ID</th>
                                    <th>{{trans('general.boat')}}</th>
                                    <th>{{trans('general.boatnumber')}}</th>
                                    <th>{{trans('general.tipo')}}</th>
                                    <th>{{trans('general.port')}}</th>

                                    @if(Auth::user()->role->role_permission('edit_boat') || Auth::user()->role->role_permission('delete_boat'))
                                        <th>Action</th>
                                    @endif
                                </tr>
                                @foreach($boats as $boat)
                                    <tr>
                                        <td>{{ $boat->id }}</td>
                                        <td>{{ $boat->name}}</td>
                                        <td>{{ $boat->number }}</td>
                                        <td>{{ $boat->boattype->name }}</td>
                                        <td>{{ $boat->port ? $boat->port->name :'' }}</td>

                                        @if(Auth::user()->role->role_permission('edit_boat') || Auth::user()->role->role_permission('delete_boat'))
                                            <td>
                                                <div class="btn-group">
                                                    @if(Auth::user()->role->role_permission('edit_boat'))
                                                        <a href="{{ asset('boats/deleted/'.$boat->id.'/restore') }}" title="Restore" class="btn btn-default btn-sm">Restore</a>
                                                    @endif
                                                </div>
                                            </td>
                                        @endif
                                    </tr>
                                @endforeach
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
@endsection