Kumi
5c7586bb9a
Introduces DashboardSection class to encapsulate dashboard logic, enabling easier extension and customization. Adds separate mood and dreams dashboard templates to streamline content rendering. Refactors main dashboard template to dynamically render content from enabled modules using a new template tag system, improving flexibility and maintainability.
24 lines
No EOL
696 B
Python
24 lines
No EOL
696 B
Python
from frontend.classes import NavSection, NavItem, DashboardSection
|
|
|
|
from django.urls import reverse_lazy
|
|
|
|
# Sidebar navigation items
|
|
|
|
dreams_section = NavSection("Dreams")
|
|
|
|
dreams_items = {
|
|
"dreams_dream_list": NavItem("Dream List", reverse_lazy("dreams:dream_list")),
|
|
"dreams_theme_list": NavItem("Themes", reverse_lazy("dreams:theme_list")),
|
|
"dreams_notification_list": NavItem("Notifications", reverse_lazy("dreams:notification_list"))
|
|
}
|
|
|
|
for _, item in dreams_items.items():
|
|
dreams_section.add_item(item)
|
|
|
|
NAV_SECTIONS = [dreams_section]
|
|
|
|
# Dashboard sections
|
|
|
|
dreams_section = DashboardSection("Dreams", "dreams/dashboard_section.html")
|
|
|
|
DASHBOARD_SECTIONS = [dreams_section] |