Simplify chat views

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-04-27 19:12:11 +02:00
parent a121d1042b
commit 181bb86e49
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 2 additions and 18 deletions

View File

@ -2,14 +2,13 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.urls import path
from django.utils.translation import gettext_lazy as _
from django.views.generic import TemplateView
from .views import ChatView
app_name = 'chat'
urlpatterns = [
path('', ChatView.as_view(), name='chat'),
path('', TemplateView.as_view(template_name="chat/chat.html", extra_context={'title': _("Chat")}), name='chat'),
path('fullscreen/', TemplateView.as_view(template_name="chat/fullscreen.html"), name='fullscreen'),
]

View File

@ -1,15 +0,0 @@
# Copyright (C) 2024 by Animath
# 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
class ChatView(LoginRequiredMixin, TemplateView):
"""
This view is the main interface of the chat system, which is working
with Javascript and websockets.
"""
template_name = "chat/chat.html"
extra_context = {'title': _("Chat")}