✨ Add comprehensive admin panel with user management
Features added: - Admin authentication system with is_admin field - Complete admin dashboard with user statistics - User management (create, edit, delete, toggle admin) - Protected admin routes with @admin_required decorator - Security features (prevent self-deletion, last admin protection) - Responsive admin UI with Bootstrap integration - Database migration script for admin field - Admin navigation link for authorized users Technical improvements: - Enhanced 3-column dashboard layout (tables | editor | saved queries) - Removed plus button and made right sidebar more compact - Admin user (admin/admin123) automatically created with admin privileges - Full CRUD operations for user management - Flash messages for user feedback - Form validation and error handling
This commit is contained in:
@@ -23,8 +23,16 @@
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
<div class="navbar-nav ms-auto">
|
||||
{% if current_user.is_admin %}
|
||||
<a class="nav-link me-3" href="{{ url_for('admin.admin_dashboard') }}">
|
||||
<i class="fas fa-users-cog"></i> Admin
|
||||
</a>
|
||||
{% endif %}
|
||||
<span class="navbar-text me-3">
|
||||
<i class="fas fa-user"></i> {{ current_user.username }}
|
||||
{% if current_user.is_admin %}
|
||||
<span class="badge bg-danger ms-1">Admin</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
<a class="nav-link" href="{{ url_for('auth.logout') }}">
|
||||
<i class="fas fa-sign-out-alt"></i> Abmelden
|
||||
|
||||
Reference in New Issue
Block a user