@extends('layouts.app')

@section('content')

<div id="app">
    <div class="d-sm-flex flex-wrap">
        <div class="card m-3 flex-fill">
            <div class="card-header text-right">
                <button type="button" class="btn btn-default xs-toggle" data-toggle="collapse" data-target="#assetTab">
                    <span class="sr-only">Toggle Navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <ul class="nav nav-pills card-header-pills nav-justified xs-collapse collapse" id="assetTab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="assetinfo-tab" data-toggle="pill" href="#assetinfo" role="tab" aria-controls="assetinfo" aria-selected="true">Hardware</a>
                    </li>
                    @if($workOrder->asset->group !== null)
                    <li class="nav-item">
                        <a class="nav-link" id="group-tab" data-toggle="pill" href="#group" role="tab" aria-controls="group" aria-selected="false">Group</a>
                    </li>
                    @endif
                    <li class="nav-item">
                        <a class="nav-link" id="credentials-tab" data-toggle="pill" href="#credentials" role="tab" aria-controls="credentials" aria-selected="false">Credentials</a>
                    </li>
                </ul>
            </div>
            <div class="card-body">
                <div class="tab-content">
                    <div class="tab-pane active" id="assetinfo" role="tabpanel" aria-labelledby="assetinfo-tab">
                        <assetinfo asset="{{$workOrder->asset}}"></assetinfo>
                        <a href="{{ route('editasset', ['asset' => $workOrder->asset]) }}" class="btn btn-primary">Edit</a>
                    </div>
                    @if($workOrder->asset->group !== null)
                    <div class="tab-pane" id="group" role="tabpanel" aria-labelledby="group-tab">
                        Name: {{$workOrder->asset->group->pcgroupname}}
                    </div>
                    @endif
                    <div class="tab-pane" id="credentials" role="tabpanel" aria-labelledby="credentials-tab">
                        TODO
                    </div>
                </div>
            </div>
        </div>
        <div class="card m-3 flex-fill">
            <div class="card-header text-right">
                <button type="button" class="btn btn-default xs-toggle" data-toggle="collapse" data-target="#workorderTab">
                    <span class="sr-only">Toggle Navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <ul class="nav nav-pills card-header-pills nav-justified xs-collapse collapse" id="workorderTab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="workorderinfo-tab" data-toggle="pill" href="#workorderinfo" role="tab" aria-controls="workorderinfo" aria-selected="true">Work Order Info</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="attachments-tab" data-toggle="pill" href="#attachments" role="tab" aria-controls="attachments" aria-selected="false">Attachments</a>
                    </li>
                </ul>
            </div>
            <div class='card-body'>
                <div class='tab-content'>
                    <div class="tab-pane active" id="workorderinfo" role="tabpanel" aria-labelledby="workorderinfo-tab">
                        <woinfo work-order="{{$workOrder}}"></woinfo>
                        <a href="{{ route('editwo', ['workOrder' => $workOrder]) }}" class="btn btn-primary">Edit</a>
                    </div>
                    <div class="tab-pane" id="attachments" role="tabpanel" aria-labelledby="attachments-tab">
                        TODO 2
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection