diff --git a/frontend/classes.py b/frontend/classes.py
index b1adb1c..d614155 100644
--- a/frontend/classes.py
+++ b/frontend/classes.py
@@ -7,12 +7,31 @@ class NavSection:
def add_item(self, item):
self.items.append(item)
- def get_html(self):
- pass
+ def get_html(self, active=None):
+ html = f"""
+
+
+ """
+
+ self.items.sort(key=lambda x: x.order)
+
+ for item in self.items:
+ html += f"""
+
+
+
+
+ {item.name}
+
+
+ """
+
+ return html
class NavItem:
- def __init__(self, name, url, icon="fas fa-fw fa-smile", title=None):
+ def __init__(self, name, url, icon="fas fa-fw fa-smile", title=None, order=100):
self.name = name
self.url = url
self.icon = icon
- self.title = title or name
\ No newline at end of file
+ self.title = title or name
+ self.order = order
\ No newline at end of file
diff --git a/frontend/features.py b/frontend/features.py
index e69de29..32b4990 100644
--- a/frontend/features.py
+++ b/frontend/features.py
@@ -0,0 +1,29 @@
+from frontend.classes import NavSection, NavItem
+
+from django.urls import reverse_lazy
+
+mood_section = NavSection("Mood")
+
+mood_items = {
+ "mood_status_list": NavItem("Status List", reverse_lazy("mood:status_list")),
+ "mood_activity_list": NavItem("Activities", reverse_lazy("mood:activity_list")),
+ "mood_mood_list": NavItem("Moods", reverse_lazy("mood:mood_list")),
+ "mood_notification_list": NavItem("Notifications", reverse_lazy("mood:notification_list")),
+ "mood_statistics": NavItem("Statistics", reverse_lazy("mood:statistics"))
+}
+
+for _, item in mood_items.items():
+ mood_section.add_item(item)
+
+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 = [mood_section, dreams_section]
\ No newline at end of file
diff --git a/frontend/templatetags/navigation.py b/frontend/templatetags/navigation.py
index c6406e5..15505da 100644
--- a/frontend/templatetags/navigation.py
+++ b/frontend/templatetags/navigation.py
@@ -12,6 +12,10 @@ def sidebar_nav():
for module in settings.CORE_MODULES + settings.ENABLED_MODULES:
try:
features = import_module(f"{module}.features")
+ try:
+ sections += features.NAV_SECTIONS
+ except:
+ pass
except:
pass
@@ -24,73 +28,4 @@ def sidebar_nav():
-
-
-
-
-
-
-
-
- Status List
-
-
-
-
-
-
- Activities
-
-
-
-
-
-
- Moods
-
-
-
-
-
-
- Notifications
-
-
-
-
-
-
- Statistics
-
-
-
-
-
-
-
-
-
-
-
-
- Dream List
-
-
-
-
-
-
- Themes
-
-
-
-
-
-
- Notifications
-
- """
\ No newline at end of file
+ """ + section.get_html() for section in sections
\ No newline at end of file