From 8b49d05e1d0919516947672d21e959c40765b58a Mon Sep 17 00:00:00 2001 From: Tobias Kunze Date: Mon, 7 Apr 2025 22:46:13 +0200 Subject: [PATCH] Use top menu structure --- .../frontend/templates/frontend/base.html | 79 +++++---- .../frontend/templates/includes/header.html | 143 ++++++++++++++++ .../frontend/templates/includes/menu.html | 39 +++++ .../frontend/templates/includes/sidebar.html | 155 ------------------ 4 files changed, 221 insertions(+), 195 deletions(-) create mode 100644 src/servala/frontend/templates/includes/header.html create mode 100644 src/servala/frontend/templates/includes/menu.html delete mode 100644 src/servala/frontend/templates/includes/sidebar.html diff --git a/src/servala/frontend/templates/frontend/base.html b/src/servala/frontend/templates/frontend/base.html index 87c8a1c..f5ce6dd 100644 --- a/src/servala/frontend/templates/frontend/base.html +++ b/src/servala/frontend/templates/frontend/base.html @@ -1,4 +1,4 @@ -{% load static %} +{% load i18n static %} @@ -20,49 +20,48 @@
- {% include 'includes/sidebar.html' %} -
-
- - - -
-
-

- {% block page_title %} - Dashboard - {% endblock page_title %} -

-
-
- {% for message in messages %} - {% include "includes/message.html" %} - {% endfor %} - {% block content %} -
-
- {% block card_header %}{% endblock %} -
-
- {% block card_content %} - {% endblock card_content %} +
+ {% include 'includes/header.html' %} +
+
+

+ {% block page_title %} + Dashboard + {% endblock page_title %} +

+
+
+ {% for message in messages %} + {% include "includes/message.html" %} + {% endfor %} + {% block content %} +
+
+ {% block card_header %}{% endblock %} +
+
+ {% block card_content %} + {% endblock card_content %} +
-
-
- {% endblock content %} + + {% endblock content %} +
-
diff --git a/src/servala/frontend/templates/includes/header.html b/src/servala/frontend/templates/includes/header.html new file mode 100644 index 0000000..9176a98 --- /dev/null +++ b/src/servala/frontend/templates/includes/header.html @@ -0,0 +1,143 @@ +{% load i18n static %} +
+
+
+
+ + {% if request.user.is_authenticated %} + {# request.user.is_authenticated #} + {% if user_organizations.count %} + + + {% else %} + + + {% translate "Create organization" %} + + {% endif %} + {% endif %} +
+
+
+ +
+ + +
+ +
+ {% if request.user and request.user.is_authenticated %} + + {% else %} + + + {% translate 'Login' %} + + {% endif %} + + + +
+
+
+ {% include 'includes/menu.html' %} +
diff --git a/src/servala/frontend/templates/includes/menu.html b/src/servala/frontend/templates/includes/menu.html new file mode 100644 index 0000000..f965fa0 --- /dev/null +++ b/src/servala/frontend/templates/includes/menu.html @@ -0,0 +1,39 @@ +{% load i18n static %} +{% if request.user.is_authenticated and request.organization %} + +{% endif %} + diff --git a/src/servala/frontend/templates/includes/sidebar.html b/src/servala/frontend/templates/includes/sidebar.html deleted file mode 100644 index 2da0eba..0000000 --- a/src/servala/frontend/templates/includes/sidebar.html +++ /dev/null @@ -1,155 +0,0 @@ -{% load i18n static %} -