@{
    var allGroups = new List<ControlGroup>();
    allGroups.AddRange(ControlPages.ControlGroups);
    var collapsed = false;
    bool.TryParse(Request.QueryString["collapsed"], out collapsed);
    var bodyCss = collapsed ? "collapsed" : "";

    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;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
    <title>C1 ASP.NET MVC</title>
    <link rel="apple-touch-icon" sizes="180x180" href="@Url.Content("~/Content/favicon/apple-touch-icon.png")">
    <link rel="icon" type="image/png" href="@Url.Content("~/Content/favicon/favicon-32x32.png")" sizes="32x32">
    <link rel="icon" type="image/png" href="@Url.Content("~/Content/favicon/favicon-16x16.png")" sizes="16x16">
    <link rel="manifest" href="@Url.Content("~/Content/favicon/manifest.json")">
    <link rel="mask-icon" href="@Url.Content("~/Content/favicon/safari-pinned-tab.svg")" color="#503b75">
    <link href="@Url.Content("~/Content/css/jquery-ui.min.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Scripts/uilayout/source/stable/layout-default.css")" rel="stylesheet" />
    @Html.C1().Styles()
    @Styles.Render("~/Content/css/bootstrap/css/BootStrapCss")
    @Styles.Render("~/Content/css/explorer")
    @RenderSection("Styles", false)
    @Html.C1().Scripts().Basic().FlexViewer().Olap()
    @RenderSection("Scripts", false)
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/common.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/MultiLevelMenu.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/uilayout/source/stable/jquery.layout_and_plugins.min.js")"></script>

    <!-- Google Tag Manager -->
    <script>
        (function (w, d, s, l, i) {
            w[l] = w[l] || [];
            w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
            var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s),
                dl = l != 'dataLayer' ? '&l=' + l : '';
            j.async = true;
            j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-WT462SJ');
    </script>
    <!-- End Google Tag Manager -->
</head>
<body>
    <!-- Google Tag Manager (noscript) -->
    <noscript>
        <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WT462SJ"
                height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <!-- End Google Tag Manager (noscript) -->
    <div class="flex vertical" style="width:100%;height:100%">
        <div class="header flex horizontal">
            <div class="list-icon wide-screen">
                <i class="glyphicon glyphicon-list"></i>
            </div>
            <div class="list-icon narrow-screen">
                <i class="glyphicon glyphicon-list"></i>
            </div>
            <div class="company-icon auto">
                <img src="@Url.Content("~/Content/images/AcmeLogo-vertical-100px.png")" style="width:88px;" />
            </div>
        </div>
        <div class="body flex horizontal auto @bodyCss">
            <div class="nav wide-screen">
                <div class="expanded">@Html.Partial("_Nav", true)</div>
                <div class="collapsed">@Html.Partial("_Nav", false)</div>
            </div>
            <div class="view auto">
                @RenderBody()
            </div>
        </div>
    </div>
    <div class="hide">
        <div class="narrow-screen dropdown-nav">
            @Html.Partial("_Nav", true)
        </div>
    </div>
</body>
</html>
