File size: 3,164 Bytes
a65786e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!-- admin/base.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ _('Admin Panel') }} | {{ school_name }}</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body class="bg-gray-100">
    <div class="flex h-screen">
        <!-- Sidebar -->
        <div class="bg-blue-800 text-white w-64 flex-shrink-0">
            <div class="p-4 border-b border-blue-700">
                <h1 class="text-xl font-bold">{{ _('Admin Panel') }}</h1>
                <p class="text-sm text-blue-200">{{ school_name }}</p>
            </div>
            <nav class="p-2">
                <a href="{{ url_for('admin_dashboard') }}" class="block py-2 px-4 rounded hover:bg-blue-700 {{ 'bg-blue-700' if request.endpoint == 'admin_dashboard' }}">
                    <i class="fas fa-tachometer-alt mr-2"></i> {{ _('Dashboard') }}
                </a>
                <a href="{{ url_for('admin_applications') }}" class="block py-2 px-4 rounded hover:bg-blue-700 {{ 'bg-blue-700' if request.endpoint.startswith('admin_application') }}">
                    <i class="fas fa-file-alt mr-2"></i> {{ _('Applications') }}
                </a>
                <a href="{{ url_for('admin_settings') }}" class="block py-2 px-4 rounded hover:bg-blue-700 {{ 'bg-blue-700' if request.endpoint == 'admin_settings' }}">
                    <i class="fas fa-cog mr-2"></i> {{ _('Settings') }}
                </a>
                <a href="{{ url_for('admin_logout') }}" class="block py-2 px-4 rounded hover:bg-blue-700 text-red-200 hover:text-white">
                    <i class="fas fa-sign-out-alt mr-2"></i> {{ _('Logout') }}
                </a>
            </nav>
        </div>
        
        <!-- Main Content -->
        <div class="flex-1 overflow-auto">
            <header class="bg-white shadow-sm p-4 flex justify-between items-center">
                <h2 class="text-xl font-semibold text-gray-800">{% block admin_title %}{% endblock %}</h2>
                <div class="text-sm text-gray-600">
                    {{ _('Logged in as') }} <span class="font-medium">admin</span>
                </div>
            </header>
            
            <main class="p-6">
                {% with messages = get_flashed_messages(with_categories=true) %}
                    {% if messages %}
                        {% for category, message in messages %}
                            <div class="mb-4 p-4 rounded {% if category == 'error' %}bg-red-100 text-red-800{% else %}bg-green-100 text-green-800{% endif %}">
                                {{ message }}
                            </div>
                        {% endfor %}
                    {% endif %}
                {% endwith %}
                
                {% block admin_content %}{% endblock %}
            </main>
        </div>
    </div>
</body>
</html>