diff --git a/src/dgsi/templates/_index_link.html b/src/dgsi/templates/_index_link.html index ae98b12..c89b0cf 100644 --- a/src/dgsi/templates/_index_link.html +++ b/src/dgsi/templates/_index_link.html @@ -1,4 +1,4 @@ - + {% if link.icon %}{% endif %} {{ link.text }} diff --git a/src/dgsi/views.py b/src/dgsi/views.py index 239f30d..0d142fb 100644 --- a/src/dgsi/views.py +++ b/src/dgsi/views.py @@ -24,34 +24,32 @@ class Link(NamedTuple): icon: str | None = None +AUTHENTICATED_LINKS: list[Link] = [ + Link("is-primary", "dgsi:dgn-profile", _("Mon profil"), "user-filled"), + Link("is-primary", "dgsi:dgn-legal_documents", _("Documents Légaux"), "script"), +] + +ADMIN_LINKS: list[Link] = [ + Link( + "is-danger", + "dgsi:dgn-create_user", + _("Créer un nouveau compte Kanidm"), + "user-plus", + ), + Link( + "is-warning", "admin:index", _("Interface d'administration"), "settings-filled" + ), +] + + class IndexView(TemplateView): template_name = "dgsi/index.html" def get_context_data(self, **kwargs: Any) -> dict[str, Any]: return super().get_context_data( links={ - "authenticated": [ - Link( - "is-primary", - "dgsi:dgn-profile", - _("Mon profil"), - "user-filled", - ), - ], - "admin": [ - Link( - "is-danger", - "dgsi:dgn-create_user", - _("Créer un nouveau compte Kanidm"), - "user-plus", - ), - Link( - "is-warning", - "admin:index", - _("Interface d'administration"), - "settings-filled", - ), - ], + "authenticated": AUTHENTICATED_LINKS, + "admin": ADMIN_LINKS, }, **kwargs, )