@model Disco.Web.Models.Job.ShowModel
@{
    Authorization.Require(Claims.Job.Show);
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents))
{
    <div id="jobDetailTab-Components" class="jobPart">
        @Html.Partial(MVC.Job.Views.JobParts.Components)
    </div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance))
{
    <div id="jobDetailTab-NonWarrantyFinance" class="jobPart">
        @Html.Partial(MVC.Job.Views.JobParts.NonWarrantyFinance)
    </div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs))
{
    <div id="jobDetailTab-NonWarrantyRepairs" class="jobPart">
        @Html.Partial(MVC.Job.Views.JobParts.Repairs)
    </div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance))
{
    <div id="jobDetailTab-NonWarrantyInsurance" class="jobPart">
        @Html.Partial(MVC.Job.Views.JobParts.Insurance)
    </div>
}
@if (Authorization.HasAny(Claims.Job.ShowNonWarrantyComponents, Claims.Job.ShowNonWarrantyFinance, Claims.Job.ShowNonWarrantyRepairs, Claims.Job.ShowNonWarrantyInsurance))
{
    <script type="text/javascript">
        var addTabItems = '';
        @if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents)){<text>addTabItems += '<li><a href="#jobDetailTab-Components">Components [@(Model.Job.JobComponents.Count)]</a></li>';</text>}
        @if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyFinance">Finance</a></li>';</text>}
        @if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyRepairs">Repairs</a></li>';</text>}
        @if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyInsurance">Insurance</a></li>';</text>}
        $('#jobDetailTabItems').append(addTabItems);
    </script>
}