@model Disco.Web.Models.Job.ProviderJobDetailsModel
@{ Layout = null;

   Authorization.Require(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails);
   
   if (Model.JobDetailsException != null)
   {
    <h3>
        Error:</h3>
    <div>
        <strong>@Model.JobDetailsException.Message</strong>
    </div>
    <a href="#" id="repairJobDetailsErrorShow" class="smallMessage">(show more)</a>
    <div id="repairJobDetailsErrorMore" style="display: none">
        <br />
        <strong>Error Type: </strong>@Model.JobDetailsException.GetType().Name
        <br />
        <strong>Stack Trace:</strong>
        <div class="code">
            @Model.JobDetailsException.StackTrace.ToMultilineString()
        </div>
        @if (Model.JobDetailsException.InnerException != null)
        { 
            <hr />
            <div>
                <strong>Inner Exception:</strong> @Model.JobDetailsException.InnerException.Message<br />
                <strong>Error Type:</strong> @Model.JobDetailsException.GetType().Name<br />
                <strong>Stack Trace:</strong>
                <div class="code">
                    @Model.JobDetailsException.InnerException.StackTrace
                </div>
            </div>
        }
        <script type="text/javascript">
            $(function () {
                $('#repairJobDetailsErrorShow').click(function () {
                    $(this).hide();
                    $('#repairJobDetailsErrorMore').slideDown();
                });
            });
        </script>
    </div>
   }
   else
   {
       if (Model.JobDetailsSupported)
       {
    @Html.PartialCompiled(Model.ViewType, Model.ViewModel)
       }
       else
       { 
    <span class="smallMessage">@Model.JobDetailsNotSupportedMessage</span>
       }
   }
}