@{
    var controllerName = ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
    var actionName = ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString();
    var currentPage = ControlPages.GetControlPage(controllerName, actionName);
    ViewBag.ControllerName = controllerName;
    ViewBag.ActionName = actionName;
    ViewBag.PageText = ControlPages.GetPageText(controllerName, actionName);
    ViewBag.Title = string.Format("{0} - {1}", controllerName, ViewBag.PageText);
    ViewBag.DemoDescription = ViewBag.DemoDescription ?? true;
    ViewBag.DemoSettings = ViewBag.DemoSettings ?? false;
    ViewBag.DemoLog = ViewBag.DemoLog ?? false;
    ViewBag.DemoSource = ViewBag.DemoSource ?? true;

    var group = ControlPages.GetControlPageGroup(controllerName);
    ViewBag.DocLink = group.Documentation;

    var pages = group.Pages;
    ViewBag.CurrentPageIndex = group.GetSelectedPageIndex(actionName);

    foreach (var page in pages)
    {
        page.Path = Url.Action(page.Name, controllerName).ToString();
    }

    ViewBag.Pages = pages;

    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Styles{
    @RenderSection("Styles", false)
}

@section Scripts{
    @RenderSection("Scripts", false)
}
<div class="c1-table maxsize">
    <div class="c1-row">
        <div class="c1-col nav">@Html.Partial("_Nav", true)</div>
        <div class="c1-col nav collapsed">@Html.Partial("_Nav", false)</div>
        <div class="c1-col">
            <div class="view">
                @RenderBody()
            </div>
        </div>
    </div>
</div>
