File size: 2,667 Bytes
a593a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!-- templates/admin/layout.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Admin - Veggie Mart</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <style>

    @keyframes fadeSlideIn {

      from {

        opacity: 0;

        transform: translateY(10px);

      }

      to {

        opacity: 1;

        transform: translateY(0);

      }

    }



    .animate-fade-slide {

      animation: fadeSlideIn 0.6s ease-out forwards;

    }



    :root {

      --main-green: #079B6E;

    }

  </style>
</head>
<body class="bg-gray-100 min-h-screen text-gray-800">

  <!-- Header -->
  <header class="bg-[var(--main-green)] text-white p-4 shadow-lg">
    <div class="container mx-auto flex justify-between items-center">
      <a href="{{ url_for('admin_dashboard') }}" class="text-2xl font-bold hover:opacity-90 transition duration-300">
        Admin Panel
      </a>
      {% if session.get('admin_logged_in') %}
      <nav>
        <ul class="flex space-x-5">
          <li>
            <a href="{{ url_for('admin_dashboard') }}"

               class="transition-transform duration-300 hover:scale-105 hover:underline">Dashboard</a>
          </li>
          <li>
            <a href="{{ url_for('admin_products') }}"

               class="transition-transform duration-300 hover:scale-105 hover:underline">Products</a>
          </li>
          <li>
            <a href="{{ url_for('admin_orders') }}"

               class="transition-transform duration-300 hover:scale-105 hover:underline">Orders</a>
          </li>
          <li>
            <a href="{{ url_for('home') }}" target="_blank"

               class="transition-transform duration-300 hover:scale-105 hover:underline">View Site</a>
          </li>
          <li>
            <a href="{{ url_for('admin_logout') }}"

               class="transition-transform duration-300 hover:scale-105 hover:underline text-red-200 hover:text-white">Logout</a>
          </li>
        </ul>
      </nav>
      {% endif %}
    </div>
  </header>

  <!-- Main Content -->
  <main class="container mx-auto p-4 mb-48 animate-fade-slide">
    {% with messages = get_flashed_messages() %}
      {% if messages %}
        {% for message in messages %}
          <div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4 shadow-md">
            {{ message }}
          </div>
        {% endfor %}
      {% endif %}
    {% endwith %}
  
    {% block content %}{% endblock %}
  </main>
 
</body>
</html>