diff --git a/core/azure_auth.py b/core/azure_auth.py index 64ad1f5..2dee84e 100644 --- a/core/azure_auth.py +++ b/core/azure_auth.py @@ -5,6 +5,13 @@ import base64 from core.models import Berichtsheft from core.reports import DailyReport, WeeklyReport, choose_report_kind import core.util +from enum import Enum + + +class Roles(Enum): + TRAINEE = "trainee" + MANAGER = "manager" + ADMIN = "admin" class AzureUser: @@ -59,3 +66,8 @@ class AzureUser: new_year, new_week = core.util.next_date(new_year, new_week) return count + + @property + def role(self) -> Roles: + # TODO : Implement + return Roles.TRAINEE diff --git a/core/styles.py b/core/styles.py index 1600293..ea7dce0 100644 --- a/core/styles.py +++ b/core/styles.py @@ -2,7 +2,7 @@ STYLE = { "red_btn": "text-white bg-red-700 hover:bg-red-800 focus:outline-none focus:ring-4 focus:ring-red-300 font-medium rounded-full text-sm px-5 py-2.5 text-center me-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900", - "card": "bg-white drop-shadow-md p-4 mx-auto mt-5 aspect-[2/3] hover:drop-shadow-xl hover:scale-[0.85] scale-[0.8] lg:hover:scale-[0.95] lg:scale-[0.9] transition-all duration-50 transform ease-in-out w-60 sm:w-80", + "card": "bg-white drop-shadow-md p-4 mx-auto mt-5 aspect-[2/3] hover:drop-shadow-xl hover:scale-[0.85] scale-[0.8] lg:hover:scale-[0.95] lg:scale-[0.9] transition-all duration-50 transform ease-in-out w-60 sm:w-80 flex items-center justify-center", "text-input": "w-full p-2 border border-gray-300 rounded-lg focus:ring focus:ring-blue-400 mb-5", } diff --git a/core/templates/component/report.html b/core/templates/component/report.html index 05d8bd4..1bac2d5 100644 --- a/core/templates/component/report.html +++ b/core/templates/component/report.html @@ -1,5 +1,5 @@ - + diff --git a/core/templates/index.html b/core/templates/index.html index ade5705..7655f66 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -24,11 +24,11 @@ {% for report in reports %} {% if forloop.first %} {% if report.week != week_now %} - + {% endif %} {% endif %} {% include 'component/report.html' with report=report %} diff --git a/core/templates/settings.html b/core/templates/settings.html new file mode 100644 index 0000000..9d14eb4 --- /dev/null +++ b/core/templates/settings.html @@ -0,0 +1,8 @@ +{{ title|safe }} + +
+ Benutzer: +
+ +{{ user.display_name }}
+{{ user.role.value|capfirst }}
diff --git a/core/templates/shell.html b/core/templates/shell.html index b1a26fb..a4402a5 100644 --- a/core/templates/shell.html +++ b/core/templates/shell.html @@ -8,7 +8,7 @@