junaidte14's picture
deploying v1
0ad3564
Raw History Blame Contribute Delete
8.81 kB
<!DOCTYPE html>
<html lang="en" class="h-full bg-gray-100">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Admin Dashboard{% endblock %}</title>
<!-- 1. Load the tailwind tags at the top of the file -->
{% load static tailwind_tags %}
<!-- 2. Replace CDN script with this tag -->
{% tailwind_css %}
<!-- Alpine.js for interactivity -->
<script defer src="{% static 'js/alpine.min.js' %}"></script>
<!-- Chart.js for analytics -->
<script src="{% static 'js/chart.umd.min.js' %}"></script>
<!-- Lucide Icons -->
<script src="{% static 'js/lucide.min.js' %}"></script>
<style>
/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
{% block extra_head %}{% endblock %}
</head>
<body class="h-full">
<div class="min-h-full">
<!-- Navigation -->
<nav class="bg-white border-b border-gray-200">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="flex h-16 justify-between">
<div class="flex">
<div class="flex flex-shrink-0 items-center">
<h1 class="text-xl font-bold text-gray-900">Admin Dashboard</h1>
</div>
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<a href="{% url 'dashboard:home' %}"
class="{% if request.resolver_match.url_name == 'home' %}border-purple-500 text-gray-900{% else %}border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700{% endif %} inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
Dashboard
</a>
<a href="{% url 'dashboard:users' %}"
class="{% if request.resolver_match.url_name == 'users' %}border-purple-500 text-gray-900{% else %}border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700{% endif %} inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
Users
</a>
<a href="{% url 'dashboard:conversations' %}"
class="{% if request.resolver_match.url_name == 'conversations' %}border-purple-500 text-gray-900{% else %}border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700{% endif %} inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
Conversations
</a>
<a href="{% url 'rag:dashboard' %}"
class="{% if 'rag' in request.resolver_match.url_name %}border-purple-500 text-gray-900{% else %}border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700{% endif %} inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
RAG
</a>
<a href="{% url 'dashboard:agents' %}"
class="{% if 'agent' in request.resolver_match.url_name %}border-purple-500 text-gray-900{% else %}border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700{% endif %} inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
Agents
</a>
{% if user.is_superuser %}
<a href="/admin/"
class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium">
Django Admin
</a>
{% endif %}
</div>
</div>
<div class="hidden sm:ml-6 sm:flex sm:items-center">
<!-- User dropdown -->
<div class="relative ml-3" x-data="{ open: false }">
<div>
<button @click="open = !open" type="button"
class="flex items-center max-w-xs rounded-full bg-white text-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2"
id="user-menu-button">
<span class="sr-only">Open user menu</span>
<div class="h-8 w-8 rounded-full bg-purple-600 flex items-center justify-center text-white font-semibold">
{{ user.username|first|upper }}
</div>
<span class="ml-2 text-sm font-medium text-gray-700">{{ user.username }}</span>
</button>
</div>
<div x-show="open"
@click.away="open = false"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
role="menu">
<a href="{% url 'dashboard:settings' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem">Settings</a>
<form method="post" action="{% url 'auth:logout' %}">
{% csrf_token %}
<button type="submit" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem">Sign out</button>
</form>
</div>
</div>
</div>
</div>
</div>
</nav>
<!-- Messages -->
{% if messages %}
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 mt-4">
{% for message in messages %}
<div class="rounded-md {% if message.tags == 'error' %}bg-red-50 border border-red-200{% elif message.tags == 'success' %}bg-green-50 border border-green-200{% else %}bg-blue-50 border border-blue-200{% endif %} p-4 mb-4">
<div class="flex">
<div class="flex-shrink-0">
{% if message.tags == 'error' %}
<i data-lucide="alert-circle" class="h-5 w-5 text-red-400"></i>
{% elif message.tags == 'success' %}
<i data-lucide="check-circle" class="h-5 w-5 text-green-400"></i>
{% else %}
<i data-lucide="info" class="h-5 w-5 text-blue-400"></i>
{% endif %}
</div>
<div class="ml-3">
<p class="text-sm font-medium {% if message.tags == 'error' %}text-red-800{% elif message.tags == 'success' %}text-green-800{% else %}text-blue-800{% endif %}">
{{ message }}
</p>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<!-- Page content -->
<main class="py-10">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
{% block content %}{% endblock %}
</div>
</main>
</div>
<!-- Initialize Lucide icons -->
<script>
lucide.createIcons();
</script>
{% block extra_js %}{% endblock %}
</body>
</html>