From 1cb6a995d4d2564bbf9395783ed8c9901eed0ef5 Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Thu, 25 Apr 2019 18:07:10 +0200 Subject: [PATCH] Correctors are not allowed anymore to see the chat : https://trackers.pilotsystems.net/probarreau/0467 --- .../templates/teleforma/inc/chat_room.html | 29 +++++++++++-------- teleforma/templatetags/teleforma_tags.py | 11 +++++++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/teleforma/templates/teleforma/inc/chat_room.html b/teleforma/templates/teleforma/inc/chat_room.html index b31b8e90..7121065d 100644 --- a/teleforma/templates/teleforma/inc/chat_room.html +++ b/teleforma/templates/teleforma/inc/chat_room.html @@ -2,17 +2,22 @@ {% load telemeta_utils %} {% load teleforma_tags %} -
-

rss{% trans title %}

+{% show_chat user as display_chat %} +{% if display_chat %} + +
+

rss{% trans title %}

-
Loading...
-
{% csrf_token %} - -
- - -
-
- +
Loading...
+
{% csrf_token %} + +
+ + +
+
+
-
+
+{% endif %} diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index ed8ef8ef..0ee535f8 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -183,6 +183,17 @@ def get_telecaster(): def get_googletools(): return 'googletools' in settings.INSTALLED_APPS +@register.assignment_tag +def show_chat(user): + """ everybody should see the chat panel, except the correctors """ + professor = user.professor.all() + if user.is_superuser or professor: + return True + if user.quotas.all(): + return False + return True + + @register.filter def get_audio_id(media): if media.conference: -- 2.39.5