diff --git a/django/play/views.py b/django/play/views.py index 8feb7a8..6887cc0 100644 --- a/django/play/views.py +++ b/django/play/views.py @@ -3,6 +3,7 @@ from django.shortcuts import render, redirect, get_object_or_404, reverse from play.models import QuizGame, QuizGameParticipant from library.models import QivipQuiz, QivipQuestion from django.http import HttpResponseRedirect, HttpResponseNotFound +from django.contrib import messages import json @@ -102,8 +103,7 @@ def join_game(request): return redirect('play:create_participant', join_code=join_code) return redirect('play:lobby', join_code=join_code) except QuizGame.DoesNotExist: - # TODO: Mit message eine Fehlermeldung weitergeben (und im entsprechenden Template Designen) - pass + messages.error(request, "Dieses Spiel existiert nicht.") return render(request, 'play/join_game.html') def finished(request, join_code): diff --git a/django/static/css/t-input.css b/django/static/css/t-input.css index 5dbd930..726280d 100644 --- a/django/static/css/t-input.css +++ b/django/static/css/t-input.css @@ -55,9 +55,14 @@ a.qp-a-button-small { +ul.messages li { + @apply p-3 rounded-full bg-gray-200 hover:scale-105 transition duration-200 font-black + focus:outline-none focus:ring-2 focus:ring-blue-400 focus:bg-blue-100; +} - - +ul.messages li.error { + @apply bg-red-200; +} diff --git a/django/templates/play/join_game.html b/django/templates/play/join_game.html index 81aa04d..47db8d2 100644 --- a/django/templates/play/join_game.html +++ b/django/templates/play/join_game.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content %} -