@extends('system.layout.main', [
    'header' => true,
    // 'ngController' => "CostController"
])
@php
    $pageTitle = 'Cấu hình tự động fulfill';
@endphp

@section('title')
    <title>{{ $pageTitle }}</title>
@endsection

@section('script')
@endsection

@section('css')
@endsection

@section('content')
<section class="content-header">
    <h1>{{ $pageTitle }}</h1>
</section>
<section class="content">
    <div class="box no-border">
        <div class="box-body">



    <div class="table-responsive">
        <table class="table table-hover">
            <tr>
                <th>ID</th>
                <th>Category</th>
                <th>Color</th>
                <th>Size</th>
                <th>Type</th>
                <th>Style</th>
                <th>Printing Service</th>
                <th>Enable</th>
                <th>Blueprint</th>
                <th>print_provider_id</th>
                <th>variant_id</th>
                <th>resolution</th>
                <th>Updated at</th>
                <th>Edit</th>
            </tr>
            @foreach ($templates as $key => $template)

                <tr>
                    <td>{{ $template->id }}</td>
                    <td>{{ $template->category_id }}</td>
                    <td>{{ $template->color }}</td>
                    <td>{{ $template->size }}</td>
                    <td>{{ $template->type }}</td>
                    <td>{{ $template->style }}</td>
                    <td>{{ $template->printing_service }}</td>
                    <td>
                        <a href="{{ $template->toggleUrl() }}">
                            {!! $template->enable ? '<span class="text-success">Enable</span>' : '<span class="text-danger">Disabled</span>' !!}
                        </a>
                    </td>
                    <td>{{ $template->blueprint_id }}</td>
                    <td>{{ $template->print_provider_id }}</td>
                    <td>{{ $template->variant_id }}</td>
                    <td>{{ $template->resolution }}</td>
                    <td>{{ $template->updated_at->diffforhumans() }}</td>
                    <td><a href="{{ $template->editUrl() }}">Edit</a></td>
                </tr>
            @endforeach

        </table>
        {{ $templates->render() }}
        {{-- <a href="/print-suppliers/template/enable">
            <button class="btn btn-danger" type="submit" >Enable all</button>
        </a>
        <a href="/print-suppliers/template/auto-resolution">
            <button class="btn btn-danger" type="submit" >Auto Resolution</button>
        </a> --}}

        </div>
    </div>
    </div>

</section>
@endsection
