1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-24 19:40:31 +02:00

Add fullscreen mode for chat

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-04-27 16:16:57 +02:00
parent 39085a6303
commit badbb2567e
4 changed files with 44 additions and 20 deletions

View File

@ -2,10 +2,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.translation import gettext_lazy as _
from django.views.generic import TemplateView
from chat.models import Channel
class ChatView(LoginRequiredMixin, TemplateView):
"""
@ -13,9 +12,4 @@ class ChatView(LoginRequiredMixin, TemplateView):
with Javascript and websockets.
"""
template_name = "chat/chat.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
from asgiref.sync import async_to_sync
context['channels'] = async_to_sync(Channel.get_accessible_channels)(self.request.user, 'read')
return context
extra_context = {'title': _("Chat")}