@extends ('layouts/template')

@section('content')
<link href="/select2/select2.min.css" rel="stylesheet" />
<script src="/select2/select2.min.js"></script>

<style>
    #visit-template-segment-template-list .select2-container {
        width: 100% !important;
    }
</style>

<?php
    $routeName = request()->route()->getName();
?>

<div class="p-3 mcp-theme-1" id="visit-template-segment-template-list">
    <a href="{{ route('practice-management.visitTemplates') }}" class="d-block mb-1"><i class="fas fa-arrow-left"></i> Back to Visit Templates</a>
    <div class="card mb-3">
        <div class="card-header">
            <div class="d-flex align-items-center justify-content-between">
                <strong>{{ $visitTemplate->title }}</strong>
                <div>
                    @include('app.practice-management.visit-templates.clone', ['template' => $visitTemplate ])
                    @include('app.practice-management.visit-templates.toggle-mark-as-slim', ['template' => $visitTemplate ])
                    @include('app.practice-management.visit-templates.toggle-always-open', ['template' => $visitTemplate ])
                    @include('app.practice-management.visit-templates.update', ['template' => $visitTemplate ])
                </div>
            </div>
        </div>
        <div class="card-body">
            <div class="d-flex align-items-start">
                <span class="mr-3"><b>Internal Name:</b> {{ $visitTemplate->internal_name }}</span>
                <span class="mr-3"><b>Title:</b> {{ $visitTemplate->title }}</span>
                <span class="mr-3"><b>Created At:</b> {{ friendly_date_time($visitTemplate->created_at) }}</span>
                <span class="mr-3">
                    <b>Status:</b>
                    @if($visitTemplate->is_active)
                    <span class="text-success mr-2">ACTIVE</span>
                    @else
                    <span class="text-danger mr-2">INACTIVE</span>
                    @endif
                    @include('app.practice-management.visit-templates.activate-deactivate', ['template' => $visitTemplate, 'leftPosition' => true ])
                </span>

                <div class="mr-3 d-flex align-items-start">
                    @if($visitTemplate->is_active)
                    @if($visitTemplate->reactivation_memo)
                    <span class="mr-3"><b>Reactivation Memo:</b></span>
                    <div style="width:300px;">
                        <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->reactivation_memo }}</small>
                        @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
                    </div>
                    @endif
                    @else
                    @if($visitTemplate->deactivation_memo)
                    <span class="mr-3"><b>Deactivation Memo:</b></span>
                    <div style="width:300px;">
                        <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->deactivation_memo }}</small>
                        @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
                    </div>
                    @endif
                    @endif
                </div>
            </div>
        </div>
    </div>
    <div class="page-tabs">
        <div class="links">
            <a href="{{ route('practice-management.visitTemplate', $visitTemplate) }}" class="{{ $routeName === 'practice-management.visitTemplate' ? 'active':'' }}">Segment Templates</a>
            <a href="{{ route('practice-management.visitTemplateAccess', $visitTemplate) }}" class="{{ $routeName === 'practice-management.visitTemplateAccess' ? 'active':'' }}">Pro Access</a>
        </div>
        <div class="page-tab">
            @yield('visitTemplateTab')
        </div>
    </div>
</div>
@endsection