Enhance UI and functionality for admin dashboard and user management
- Update `_base_context` to include `active_nav` for dynamic navigation highlighting. - Revamp `base.html` to improve header layout and navigation links for better user experience. - Redesign `dashboard.html` to include statistics for new and edited articles, enhancing visibility of content changes. - Improve `users.html` layout for user management, adding detailed user roles and status indicators. - Update CSS styles for a cohesive design across the application, introducing new color variables and layout adjustments.
This commit is contained in:
@@ -93,10 +93,15 @@ def _bootstrap_admin() -> None:
|
||||
|
||||
|
||||
def _base_context(request: Request, user: User, db: Session) -> dict:
|
||||
path = request.url.path
|
||||
active_nav = "dashboard"
|
||||
if path.startswith("/admin/users"):
|
||||
active_nav = "users"
|
||||
return {
|
||||
"user": user,
|
||||
"csrf_token": request.cookies.get(CSRF_COOKIE_NAME) or ensure_csrf_cookie(request),
|
||||
"smtp": get_smtp_settings(db),
|
||||
"active_nav": active_nav,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user