| {% extends "admin/base.html" %}
|
|
|
| {% block title %}Dashboard{% endblock %}
|
|
|
| {% block content %}
|
| <div class="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800">
|
|
|
| <nav class="glass-nav sticky top-0 z-50 shadow-lg">
|
| <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| <div class="flex justify-between h-16">
|
| <div class="flex items-center space-x-3">
|
| <div class="w-10 h-10 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg">
|
| <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
| </svg>
|
| </div>
|
| <h1 class="text-2xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400 bg-clip-text text-transparent">Arxiver Admin</h1>
|
| </div>
|
| <div class="flex items-center space-x-2">
|
| <a href="/admin/dashboard" class="px-4 py-2 rounded-lg font-medium bg-gradient-to-r from-blue-600 to-blue-700 dark:from-blue-500 dark:to-blue-600 text-white shadow-md hover:shadow-lg transform hover:scale-105 transition-all">
|
| Dashboard
|
| </a>
|
| <a href="/admin/users" class="px-4 py-2 rounded-lg font-medium text-gray-700 dark:text-gray-300 hover:bg-white/50 dark:hover:bg-gray-800/50 transition-all">
|
| Users
|
| </a>
|
| <a href="/admin/services" class="px-4 py-2 rounded-lg font-medium text-gray-700 dark:text-gray-300 hover:bg-white/50 dark:hover:bg-gray-800/50 transition-all">
|
| Services
|
| </a>
|
| <a href="/admin/resources" class="px-4 py-2 rounded-lg font-medium text-gray-700 dark:text-gray-300 hover:bg-white/50 dark:hover:bg-gray-800/50 transition-all">
|
| Resources
|
| </a>
|
| <button onclick="toggleTheme()" class="p-2 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50 transition-all ml-2">
|
| <svg class="w-5 h-5 text-gray-700 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path class="dark:hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
|
| <path class="hidden dark:block" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path>
|
| </svg>
|
| </button>
|
| <a href="/admin/logout" class="px-4 py-2 rounded-lg font-medium bg-gradient-to-r from-red-500 to-red-600 hover:from-red-600 hover:to-red-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 transition-all ml-2">
|
| Logout
|
| </a>
|
| </div>
|
| </div>
|
| </div>
|
| </nav>
|
|
|
|
|
| <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
|
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
|
| <div class="glass-card rounded-2xl shadow-xl p-6 hover:scale-105 transition-transform duration-300">
|
| <div class="flex items-center justify-between">
|
| <div>
|
| <p class="text-sm font-semibold text-gray-600 dark:text-gray-400 mb-2">Total Users</p>
|
| <p class="text-4xl font-bold bg-gradient-to-r from-blue-600 to-cyan-500 dark:from-blue-400 dark:to-cyan-400 bg-clip-text text-transparent">{{ user_count }}</p>
|
| </div>
|
| <div class="bg-gradient-to-br from-blue-500 to-cyan-500 rounded-2xl p-4 shadow-lg">
|
| <svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"></path>
|
| </svg>
|
| </div>
|
| </div>
|
| </div>
|
|
|
| <div class="glass-card rounded-2xl shadow-xl p-6 hover:scale-105 transition-transform duration-300">
|
| <div class="flex items-center justify-between">
|
| <div>
|
| <p class="text-sm font-semibold text-gray-600 dark:text-gray-400 mb-2">Total Services</p>
|
| <p class="text-4xl font-bold bg-gradient-to-r from-green-600 to-emerald-500 dark:from-green-400 dark:to-emerald-400 bg-clip-text text-transparent">{{ service_count }}</p>
|
| </div>
|
| <div class="bg-gradient-to-br from-green-500 to-emerald-500 rounded-2xl p-4 shadow-lg">
|
| <svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
| </svg>
|
| </div>
|
| </div>
|
| </div>
|
|
|
| <div class="glass-card rounded-2xl shadow-xl p-6 hover:scale-105 transition-transform duration-300">
|
| <div class="flex items-center justify-between">
|
| <div>
|
| <p class="text-sm font-semibold text-gray-600 dark:text-gray-400 mb-2">Total Resources</p>
|
| <p class="text-4xl font-bold bg-gradient-to-r from-purple-600 to-pink-500 dark:from-purple-400 dark:to-pink-400 bg-clip-text text-transparent">{{ resource_count }}</p>
|
| </div>
|
| <div class="bg-gradient-to-br from-purple-500 to-pink-500 rounded-2xl p-4 shadow-lg">
|
| <svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
|
| </svg>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
|
|
|
|
| <div class="glass-card rounded-2xl shadow-xl overflow-hidden">
|
| <div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 bg-gradient-to-r from-white/50 to-gray-50/50 dark:from-gray-800/50 dark:to-gray-900/50">
|
| <div class="flex items-center justify-between">
|
| <h2 class="text-xl font-bold text-gray-900 dark:text-white">Recent Users</h2>
|
| <a href="/admin/users" class="text-sm font-semibold text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors flex items-center space-x-1">
|
| <span>View All</span>
|
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
| </svg>
|
| </a>
|
| </div>
|
| </div>
|
| <div class="overflow-x-auto">
|
| <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
| <thead class="bg-gray-50/50 dark:bg-gray-800/50">
|
| <tr>
|
| <th class="px-6 py-3 text-left text-xs font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider">ID</th>
|
| <th class="px-6 py-3 text-left text-xs font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Email</th>
|
| <th class="px-6 py-3 text-left text-xs font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Name</th>
|
| <th class="px-6 py-3 text-left text-xs font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Role</th>
|
| <th class="px-6 py-3 text-left text-xs font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Created</th>
|
| </tr>
|
| </thead>
|
| <tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
| {% for user in users %}
|
| <tr class="hover:bg-white/30 dark:hover:bg-gray-800/30 transition-colors">
|
| <td class="px-6 py-4 whitespace-nowrap text-sm font-semibold text-gray-900 dark:text-white">
|
| {{ user.id }}
|
| </td>
|
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300">
|
| {{ user.email }}
|
| </td>
|
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300">
|
| {{ user.full_name or '-' }}
|
| </td>
|
| <td class="px-6 py-4 whitespace-nowrap">
|
| <span class="px-3 py-1 inline-flex text-xs leading-5 font-bold rounded-full {% if user.role.value == 'admin' %}bg-gradient-to-r from-purple-500 to-pink-500 text-white{% else %}bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300{% endif %} shadow-sm">
|
| {{ user.role.value }}
|
| </span>
|
| </td>
|
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
| {{ user.created_at.strftime('%Y-%m-%d %H:%M') if user.created_at else '-' }}
|
| </td>
|
| </tr>
|
| {% endfor %}
|
| </tbody>
|
| </table>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
| {% endblock %}
|
|
|