@extends('admin.layouts.app')

@section('title')
    {{ $title }}
@endsection

@section('content')
    <div class="content">
        <div class="box box-primary">
            <div class="box-body">
                <div class="row" style="padding-left: 20px">
                    <dl class="dl-horizontal">
                        @include('admin.leads.show_fields')
                    </dl>
                    {!! Form::open(['route' => ['admin.leads.destroy', $lead->id], 'method' => 'delete']) !!}
                    <div class='btn-group'>
                        @ability('super-admin' ,'leads.show')
                        <a href="{!! route('admin.leads.index') !!}" class="btn btn-default">
                            <i class="glyphicon glyphicon-arrow-left"></i> Back
                        </a>
                        @endability
                    </div>
                    <div class='btn-group'>
                        @ability('super-admin' ,'leads.edit')
                        <a href="{{ route('admin.leads.edit', $lead->id) }}" class='btn btn-default'>
                            <i class="glyphicon glyphicon-edit"></i> Edit
                        </a>
                        @endability
                    </div>
                    <div class='btn-group'>
                        @ability('super-admin' ,'leads.destroy')
                        {!! Form::button('<i class="glyphicon glyphicon-trash"></i> Delete', [
                            'type' => 'submit',
                            'class' => 'btn btn-danger',
                            'onclick' => "confirmDelete($(this).parents('form')[0]); return false;"
                        ]) !!}
                        @endability
                    </div>
                    {!! Form::close() !!}
                </div>
            </div>
        </div>
    </div>


    <div class="content">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">Lead history #{{$lead->id}} </h3>
            </div>
            <div class="box-body">
                <div class="row">

                    <div class="col-sm-12 datatable-action-urls"
                         data-action-create="{{route('admin.lead-histories.create', ['lead_id'=> $lead->id])}}">
                        @push('css')
                            @include('admin.layouts.datatables_css')
                        @endpush

                        {!! $dataTable->table(['width' => '100%']) !!}

                        @push('scripts')
                            @include('admin.layouts.datatables_js')
                            {!! $dataTable->scripts() !!}
                        @endpush
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection