diff --git a/src/dgsi/mixins.py b/src/dgsi/mixins.py index 90deae0..77da158 100644 --- a/src/dgsi/mixins.py +++ b/src/dgsi/mixins.py @@ -14,3 +14,7 @@ class StaffRequiredMixin(UserPassesTestMixin): assert isinstance(self.request.user, User) return self.request.user.is_admin + + def get_context_data(self, **kwargs): + # NOTE: We are only allowed to do this if a class is supplied to the right when constructing the view + return super().get_context_data(admin_view=True, **kwargs) # pyright: ignore diff --git a/src/shared/templates/_hero.html b/src/shared/templates/_hero.html index 78ba4b7..858b1d5 100644 --- a/src/shared/templates/_hero.html +++ b/src/shared/templates/_hero.html @@ -1,6 +1,6 @@ {% load i18n %} -
+
@@ -66,4 +66,15 @@
+ + {% if admin_view %} +
+
+ + + + {% trans "Interface d'administration" %} +
+
+ {% endif %}