@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor
@{
    var viewModel = HttpContextAccessor.HttpContext.Items["layoutViewModel"] as bitforum.Models.LayoutViewModel;
}
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - @viewModel.AppConfig.AppName</title>

    <meta name="description" content="bitforum.io 관리자 영역입니다. 외부인은 이용이 불가합니다." />
    <meta name="author" content="www.playr.co.kr" />
    <meta name="copyright" content="playr, 2025" />
    <meta name="referrer" content="no-referrer">

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="ko" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

    <meta name="robots" content="noindex, nofollow" />
    <link rel="stylesheet" href="~/node_modules/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/node_modules/bootstrap-icons/font/bootstrap-icons.min.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/css/admin.css" asp-append-version="true" />

    @await RenderSectionAsync("Styles", required: false)
</head>
<body>
    
    <!-- 좌측 -->
    <aside id="aside">
        <!-- 메뉴 -->
        <ul class="nav flex-column">
            @foreach (var menu in viewModel.Menus)
            {
                @Html.Partial("_MenuItem", menu)
            }
        </ul>
        <footer>ⓒ <a href="https://playr.co.kr" target="_blank" rel="external">PLAYR</a>. All Rights Reserved</footer>
    </aside>

    <!-- 우측 -->
    <main id="main">
        <!-- 상단 -->
        <header id="header">
            <div class="row justify-content-between align-items-center g-0">
                <div class="col">
                    <button type="button" id="btnAsideToggle" class="btn btn-light">
                        <i class="bi bi-arrow-left"></i>
                    </button>
                </div>
                <div class="col text-center">
                    <strong class="logo">
                        <img src="/images/favicon.ico" /> @viewModel.AppConfig.AppName
                    </strong>
                </div>
                <div class="col text-end">
                    <div class="dropdown profile">
                        <button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                            @User.Identity.Name
                        </button>
                        <ul class="dropdown-menu">
                            <li><a href="/Identity/Account/Manage" class="dropdown-item">내 정보</a></li>
                            <li>
                                <form asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="~/" method="post">
                                    <button type="submit" class="dropdown-item">로그아웃</button>
                                </form>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </header>

        <div class="pt-4">
            <!-- 내용 -->
            @RenderBody()
        </div>
    </main>

    <script src="~/node_modules/jquery/dist/jquery.min.js"></script>
    <script src="~/node_modules/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/node_modules/jquery-validation/dist/additional-methods.min.js"></script>
    <script src="~/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/func.js" asp-append-version="true"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>

    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>
