
@{
    Layout = null;
}

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>atakanozban.com Admin Panel</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" />
    <style>
        html, body {
            height: 100%;
            background-color: #212529;
        }

        .admin-sidebar {
            width: 260px;
            min-height: 100vh;
        }

        .admin-sidebar .nav-link {
            color: rgba(255, 255, 255, .7);
            border-radius: .5rem;
        }

            .admin-sidebar .nav-link i {
                width: 1.25rem;
                text-align: center;
            }

            .admin-sidebar .nav-link:hover {
                color: #fff;
                background-color: rgba(255, 255, 255, .08);
            }

            .admin-sidebar .nav-link.active {
                color: #fff;
                background-color: #0d6efd;
            }

        .admin-content {
            flex: 1 1 auto;
            min-width: 0;
        }

        .admin-user-toggle {
            color: #fff;
            text-decoration: none;
        }

            .admin-user-toggle:hover {
                color: #fff;
            }
    </style>
</head>
<body>
    @{
        var currentPath = (Request.Url != null ? Request.Url.AbsolutePath : "").ToLowerInvariant();
        Func<string, bool> isActive = path => currentPath.StartsWith(path.ToLowerInvariant());
        var isDashboard = currentPath == "/admin" || currentPath == "/admin/" || currentPath.StartsWith("/admin/index");
    }
    <div class="d-flex">
        <div class="admin-sidebar d-flex flex-column flex-shrink-0 p-3 text-bg-dark">
            <a href="/admin" class="d-flex align-items-center mb-3 text-white text-decoration-none">
                <i class="fa-solid fa-shield-halved fs-4 me-2"></i>
                <span class="fs-4">Admin Panel</span>
            </a>
            <hr class="text-white-50" />

            <ul class="nav nav-pills flex-column mb-auto">
                <li class="nav-item">
                    <a href="/admin" class="nav-link @(isDashboard ? "active" : "")">
                        <i class="fa-solid fa-gauge me-2"></i>Dashboard
                    </a>
                </li>
                <li class="nav-item">
                    <a href="/admin/myprojects" class="nav-link @(isActive("/admin/myprojects") ? "active" : "")">
                        <i class="fa-solid fa-diagram-project me-2"></i>My Projects
                    </a>
                </li>
                <li class="nav-item">
                    <a href="/admin/affiliatelinks" class="nav-link @(isActive("/admin/affiliatelinks") ? "active" : "")">
                        <i class="fa-solid fa-link me-2"></i>Affiliate Links
                    </a>
                </li>
                <li class="nav-item">
                    <a href="/admin/socialicons" class="nav-link @(isActive("/admin/socialicons") || isActive("/admin/newsocialicon") || isActive("/admin/socialiconget") ? "active" : "")">
                        <i class="fa-solid fa-share-nodes me-2"></i>Social Icons
                    </a>
                </li>
                <li class="nav-item">
                    <a href="/admin/wallpaper" class="nav-link @(isActive("/admin/wallpaper") ? "active" : "")">
                        <i class="fa-solid fa-image me-2"></i>Wallpaper
                    </a>
                </li>
            </ul>

            <hr class="text-white-50" />

            <div class="dropdown">
                <a href="#" class="admin-user-toggle d-flex align-items-center dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                    <i class="fa-solid fa-circle-user fs-3 me-2"></i>
                    <strong>@(User?.Identity?.Name ?? "Admin")</strong>
                </a>
                <ul class="dropdown-menu dropdown-menu-dark text-small shadow">
                    <li><a class="dropdown-item" href="/admin/usersettings"><i class="fa-solid fa-user-gear me-2"></i>User Settings</a></li>
                    <li><a class="dropdown-item" href="/" target="_blank"><i class="fa-solid fa-arrow-up-right-from-square me-2"></i>Go to site</a></li>
                    <li><hr class="dropdown-divider" /></li>
                    <li><a class="dropdown-item" href="/login/logout"><i class="fa-solid fa-right-from-bracket me-2"></i>Sign out</a></li>
                </ul>
            </div>
        </div>

        <div class="admin-content p-4">
            @RenderBody()
        </div>
    </div>

    <div class="modal fade" id="pasteImageModal" tabindex="-1" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content bg-dark text-white border border-secondary">
                <div class="modal-header border-secondary">
                    <h5 class="modal-title">Paste Image</h5>
                    <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body text-center">
                    <div id="pasteImageTarget" contenteditable="true" spellcheck="false"
                         class="border border-secondary rounded p-5 mb-3 text-white-50"
                         style="outline:none;cursor:text;min-height:120px;display:flex;align-items:center;justify-content:center;">
                        Click here, then press Ctrl+V to paste your image
                    </div>
                    <img id="pasteImageModalPreview" style="display:none;max-width:100%;max-height:220px;border-radius:6px;" />
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script>
    <script src="@Url.Content("~/web_atakanozbancom/assets/js/paste-upload.js")"></script>
</body>
</html>
