From eb78a227c7b0341908ae108be50964b17aaddc79 Mon Sep 17 00:00:00 2001 From: Martin Yanchev Date: Thu, 14 Oct 2021 15:21:30 +0100 Subject: [PATCH] [Fix] Fixing room message form If user is not logged and tries to add a new message the website would break , because the form was visible. Added a if condition that renders either the form or a paraph with link to log in. --- base/templates/base/room.html | 13 +++++++++---- static/styles/style.css | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/base/templates/base/room.html b/base/templates/base/room.html index 713378d43..e405b903a 100644 --- a/base/templates/base/room.html +++ b/base/templates/base/room.html @@ -113,10 +113,15 @@

{{room.name}}

-
- {% csrf_token %} - -
+ {% if request.user.is_authenticated %} +
+ {% csrf_token %} + +
+ {% else %} + + {% endif %} +
diff --git a/static/styles/style.css b/static/styles/style.css index 180678d84..216f6ede9 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -1046,7 +1046,12 @@ a { margin-bottom: 4rem; height: 64%; } +.room__login__message{ + background: var(--color-dark-light); + padding: 0.5rem 1.5rem; + border-radius: 0.7rem; +} .threads h3 { text-transform: uppercase; font-weight: 500;