<!DOCTYPE html>
<html>
<head>
    <title>WIXON Blog - Admin</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/css/uikit.min.css"/>
    <link rel="stylesheet" href="/static/css/admin.css"/>
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/js/uikit.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/js/uikit-icons.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script>
    {% block staticfiles %}{% endblock %}
</head>
<body class="admin-body">
    <div class="admin__wrap">
        <!-- Sidebar -->
        <nav class="admin__sidebar">
            <div class="admin__logo">
                <a href="/admin/">
                    <img src="/static/images/logo.png" alt="WIXON Admin" />
                </a>
                <span>Admin Panel</span>
            </div>

            <ul class="admin__menu">
                <li>
                    <a href="/admin/" class="{% if request.path == '/admin/' %}active{% endif %}">
                        <span uk-icon="icon: home"></span>
                        <span>대시보드</span>
                    </a>
                </li>
                <li>
                    <a href="/admin/posts" class="{% if '/admin/posts' in request.path %}active{% endif %}">
                        <span uk-icon="icon: file-text"></span>
                        <span>포스트 관리</span>
                    </a>
                </li>
                <li>
                    <a href="/admin/members" class="{% if '/admin/members' in request.path %}active{% endif %}">
                        <span uk-icon="icon: users"></span>
                        <span>회원 관리</span>
                    </a>
                </li>
            </ul>

            <div class="admin__user">
                <span class="user__name">{{ g.user_info.mb_name }}</span>
                <a href="/">사이트로 이동</a>
                <a href="/logout">로그아웃</a>
            </div>
        </nav>

        <!-- Main Content -->
        <main class="admin__content">
            {% with messages = get_flashed_messages() %}
                {% if messages %}
                    <div class="uk-alert-primary" uk-alert>
                        <a class="uk-alert-close" uk-close></a>
                        {{ messages[0] }}
                    </div>
                {% endif %}
            {% endwith %}

            {% block content %}{% endblock %}
        </main>
    </div>

    {% block scripts %}{% endblock %}
</body>
</html>
