@using TightWiki.Models
@model TightWiki.Models.ViewModels.Admin.ExceptionViewModel
@{
    Layout = "/Views/Shared/_Layout.cshtml";
    var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
}

<h3>
    Exception
</h3>

<p>
    Server and page exception.<br /><br />
</p>

@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
    <div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
    <div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}

@using (Html.BeginForm(null, null, FormMethod.Get, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
{
    <table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
        <tr><td><strong>Id</strong></td></tr>
        <tr><td>@Model.Exception.Id</td></tr>
        <tr><td><strong>Date / Time</strong></td></tr>
        <tr><td>@Model.Exception.CreatedDate</td></tr>
        @if (string.IsNullOrEmpty(Model.Exception.Text) == false)
        {
            <tr><td><strong>Text</strong></td></tr>
            <tr><td>@Model.Exception.Text</td></tr>
        }
        @if (string.IsNullOrEmpty(Model.Exception.ExceptionText) == false)
        {
            <tr><td><strong>Exception</strong></td></tr>
            <tr><td>@Model.Exception.ExceptionText</td></tr>
        }
        @if (string.IsNullOrEmpty(Model.Exception.StackTrace) == false)
        {
            <tr><td><strong>Stack Trace</strong></td></tr>
            <tr><td>@Model.Exception.StackTrace</td></tr>
        }
    </table>
}
