From 1c610e494fbae55e0f1116e85cd9ff35cbaac548 Mon Sep 17 00:00:00 2001 From: Vincent Agnano Date: Thu, 25 Mar 2021 17:40:16 +0100 Subject: [PATCH] access to groups management can be restricted to admin through config --- copanier/config.py | 1 + copanier/templates/base.html | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/copanier/config.py b/copanier/config.py index c813fff..8b60cad 100644 --- a/copanier/config.py +++ b/copanier/config.py @@ -12,6 +12,7 @@ SMTP_PASSWORD = "" SMTP_LOGIN = "" FROM_EMAIL = "" STAFF = [] +HIDE_GROUPS_LINK = False LOCALE = "fr_FR.UTF-8" #LOCALE = "en_US.UTF-8" SITE_NAME = "Copanier" diff --git a/copanier/templates/base.html b/copanier/templates/base.html index 76a9f02..ba7fbc2 100644 --- a/copanier/templates/base.html +++ b/copanier/templates/base.html @@ -43,9 +43,11 @@  Nouvelle distribution {% endif %} + {% if request.user and (request.user.is_staff or not config.HIDE_GROUPS_LINK) %}
  •  Gérer les groupes
  • + {% endif %}
  •  Se déconnecter
  • @@ -65,8 +67,8 @@ - - + + {% if message %} @@ -78,6 +80,6 @@ theme: "dark" }); - {% endif %} + {% endif %}