@{
    var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>@ViewBag.Title | IW4MAdmin</title>
    <meta property="og:title" content="@ViewBag.Title | IW4MAdmin">
    <meta property="og:type" content="website">
    <meta property="og:image" content="@ViewBag.Url/images/icon.png">
    <meta property="og:description" content="@ViewBag.Description">
    <meta property="og:url" content="@ViewBag.Url">
    <meta name="description" content="@ViewBag.Description">
    <meta name="keywords" content="@ViewBag.Keywords">
    <link rel="icon" type="image/png" href="~/images/icon.png">

    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    <environment include="Development">
        <link rel="stylesheet" href="~/dynamic/css/global.css" />
    </environment>
    <environment include="Production">
        <link rel="stylesheet" href="~/dynamic/css/global.min.css" />
    </environment>
</head>
<body>
    <header>
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
            @Html.ActionLink((string)ViewBag.CustomBranding, "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarCollapse">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_HOME"], "Index", "Home", new { area = "" }, new { @class = "nav-link" })</li>
                    <li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_PENALTIES"], "List", "Penalty", new { area = "" }, new { @class = "nav-link" })</li>
                    <li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_PRIVILEGED"], "PrivilegedAsync", "Client", new { area = "" }, new { @class = "nav-link" })</li>
                    <li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_HELP"], "Help", "Home", new { area = "" }, new { @class = "nav-link" })</li>
                    @foreach (var _page in ViewBag.Pages)
                    {
                        <li class="nav-item text-center text-lg-left">
                            <a class="nav-link" href="@_page.Location">@_page.Name</a>
                        </li>
                    }
                    <li class="nav-item text-center text-lg-left"></li>
                    @if (!string.IsNullOrEmpty(ViewBag.SocialLink))
                    {
                        <li class="nav-item text-center text-lg-left"><a href="@ViewBag.SocialLink" class="nav-link" target="_blank">@ViewBag.SocialTitle</a></li>
                    }
                    @if (ViewBag.Authorized)
                    {
                        <li class="nav-link dropdown text-center text-lg-left p-0">
                            <a href="#" class="nav-link oi oi-person dropdown-toggle oi-fix-navbar w-100" id="account_dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></a>

                            <div class="dropdown-menu p-0" aria-labelledby="account_dropdown">
                                <a asp-controller="Console" asp-action="Index" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_CONSOLE"]</a>
                                <a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@ViewBag.User.ClientId" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_PROFILE"]</a>
                                @if (ViewBag.User.Level >= SharedLibraryCore.Database.Models.EFClient.Permission.Owner)
                                {
                                    <a asp-controller="Configuration" asp-action="Edit" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_EDIT_CONFIGURATION"]</a>
                                }
                                <a asp-controller="Admin" asp-action="AuditLog" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_AUDIT_LOG"]</a>
                                <a class="dropdown-item bg-dark text-muted text-center text-lg-left profile-action" href="#" data-action="RecentClients" title="@loc["WEBFRONT_ACTION_RECENT_CLIENTS"]">@loc["WEBFRONT_ACTION_RECENT_CLIENTS"]</a>
                                <a class="dropdown-item bg-dark text-muted text-center text-lg-left profile-action" href="#" data-action="GenerateLoginToken" title="@loc["WEBFRONT_ACTION_TOKEN"]">@loc["WEBFRONT_ACTION_TOKEN"]</a>
                                <a asp-controller="Account" asp-action="LogoutAsync" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_LOGOUT"]</a>
                            </div>
                        </li>
                    }
                    else
                    {
                        <li class="nav-item text-center text-md-left">
                            <a href="#" id="profile_action_login_btn" class="nav-link profile-action oi oi-key oi-fix-navbar w-100" title="Login" data-action="login" aria-hidden="true"></a>
                        </li>
                    }
                </ul>
                <form class="form-inline text-primary pt-3 pb-3" method="get" action="/Client/FindAsync">
                    <input id="client_search" name="clientName" class="form-control mr-lg-2 w-100" type="text" placeholder="@loc["WEBFRONT_NAV_SEARCH"]" />
                </form>
            </div>
        </nav>
    </header>

    <!-- loading icon -->
    <div class="oi oi-loop-circular layout-loading-icon"></div>

    <!-- Main Modal -->
    <div class="modal fade" id="mainModal" tabindex="-1" role="dialog" aria-labelledby="mainModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content bg-dark">
                <div class="modal-header">
                    <h5 class="modal-title" id="mainModalLabel"></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true" class="text-danger">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                </div>
            </div>
        </div>
    </div>
    <!-- End Main Modal -->
    <!-- Action Modal -->
    <div class="modal fade" id="actionModal" tabindex="-1" role="dialog" aria-labelledby="actionModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content bg-dark">
                <div class="modal-header">
                    <h5 class="modal-title" id="actionModalLabel">IW4MAdmin</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true" class="text-danger">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="modal-message text-danger mb-3"></div>
                    <div class="modal-body-content"></div>
                </div>
                <!--<div class="modal-footer">
                    <button type="button" class="btn btn-primary">Action</button>
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                </div>-->
            </div>
        </div>
    </div>
    <div id="target_id">
        @RenderSection("targetid", required: false)
    </div>
    <!-- End Action Modal -->

    <div class="@(ViewBag.IsFluid ?? false ? "container-fluid" : "container") pt-4 pb-4 pl-3 pr-3 pr-lg-4 pl-lg-4">
        @RenderBody()
        <footer id="footer_text">
            <div class="d-lg-none d-block text-center pt-4 pb-4">
                <a href="https://github.com/RaidMax/IW4M-Admin/releases" target="_blank">
                    @Program.Manager.Version
                </a>
                <br />
                <span class="text-muted">Developed by RaidMax</span>
            </div>
            <div class="footer-mobile d-lg-block d-none text-center">
                <a href="https://github.com/RaidMax/IW4M-Admin/releases" target="_blank">
                    @Program.Manager.Version
                </a>
                <br />
                <span class="text-muted">Developed by RaidMax</span>
            </div>
        </footer>
    </div>
    <environment include="Development">
        <script type="text/javascript" src="~/lib/jquery/dist/jquery.js"></script>
        <script type="text/javascript" src="~/lib/popper.js/dist/umd/popper.js"></script>
        <script type="text/javascript" src="~/lib/moment.js/moment.js"></script>
        <script type="text/javascript" src="~/lib/moment-timezone/moment-timezone.js"></script>
        <script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
        <script type="text/javascript" src="~/lib/canvas.js/canvasjs.js"></script>
        <script type="text/javascript" src="~/js/action.js"></script>
        <script type="text/javascript" src="~/js/search.js"></script>
    </environment>
    <environment include="Production">
        <script type="text/javascript" src="~/js/global.min.js"></script>
    </environment>
    <script>
        let _localizationTmp = @Html.Raw(Json.Serialize(ViewBag.Localization));
        const _localization = [];
        $.each(_localizationTmp.set, function (key, value) {
            _localization[key] = value;
            });
    </script>
    @RenderSection("scripts", required: false)
</body>
</html>