From 46634b1e1cdf6be075d04f8b2865fe1414b8e175 Mon Sep 17 00:00:00 2001 From: juhnsa Date: Wed, 12 Mar 2025 19:16:08 +0100 Subject: [PATCH 1/3] Initiale Play App erstellen und integrieren --- core/core/settings.py | 1 + core/play/__init__.py | 0 core/play/admin.py | 3 +++ core/play/apps.py | 6 ++++++ core/play/migrations/__init__.py | 0 core/play/models.py | 3 +++ core/play/tests.py | 3 +++ core/play/views.py | 3 +++ 8 files changed, 19 insertions(+) create mode 100644 core/play/__init__.py create mode 100644 core/play/admin.py create mode 100644 core/play/apps.py create mode 100644 core/play/migrations/__init__.py create mode 100644 core/play/models.py create mode 100644 core/play/tests.py create mode 100644 core/play/views.py diff --git a/core/core/settings.py b/core/core/settings.py index 2abadc4..ae0192c 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -35,6 +35,7 @@ INSTALLED_APPS = [ 'homepage.apps.HomepageConfig', 'components.apps.ComponentsConfig', 'accounts.apps.AccountsConfig', + 'play.apps.PlayConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/core/play/__init__.py b/core/play/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/play/admin.py b/core/play/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/core/play/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/core/play/apps.py b/core/play/apps.py new file mode 100644 index 0000000..9e9b72f --- /dev/null +++ b/core/play/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class PlayConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'play' diff --git a/core/play/migrations/__init__.py b/core/play/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/play/models.py b/core/play/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/core/play/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/core/play/tests.py b/core/play/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/core/play/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/core/play/views.py b/core/play/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/core/play/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. From 13cbaaa6dc6551a2d6892d7d241aedb2b4dea933 Mon Sep 17 00:00:00 2001 From: juhnsa Date: Wed, 12 Mar 2025 20:16:00 +0100 Subject: [PATCH 2/3] Templates hinzufuegen; Spiel beitreten seite stylen --- core/core/urls.py | 2 +- core/play/urls.py | 9 +++++ core/play/views.py | 5 +++ core/static/css/t-input.css | 4 +++ core/templates/play/game/score_overview.html | 0 .../play/game/wait_for_other_players.html | 0 core/templates/play/join_game.html | 35 +++++++++++++++++++ core/templates/play/lobby.html | 15 ++++++++ 8 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 core/play/urls.py create mode 100644 core/templates/play/game/score_overview.html create mode 100644 core/templates/play/game/wait_for_other_players.html create mode 100644 core/templates/play/join_game.html create mode 100644 core/templates/play/lobby.html diff --git a/core/core/urls.py b/core/core/urls.py index 6835e00..0eda9f8 100644 --- a/core/core/urls.py +++ b/core/core/urls.py @@ -21,6 +21,6 @@ urlpatterns = [ path('admin/', admin.site.urls), path('account/', include('accounts.urls')), path('', include('homepage.urls')), - path('play/', include('components.urls')), + path('play/', include('play.urls')), path('library/', include('library.urls')), ] diff --git a/core/play/urls.py b/core/play/urls.py new file mode 100644 index 0000000..f69a807 --- /dev/null +++ b/core/play/urls.py @@ -0,0 +1,9 @@ +from django.urls import path +from . import views + +app_name = 'play' + +urlpatterns = [ + path('lobby', views.lobby, name='lobby'), + path('join', views.join_game, name='join_game'), +] \ No newline at end of file diff --git a/core/play/views.py b/core/play/views.py index 91ea44a..b0daa44 100644 --- a/core/play/views.py +++ b/core/play/views.py @@ -1,3 +1,8 @@ from django.shortcuts import render # Create your views here. +def lobby(request): + return render(request, 'play/lobby.html') + +def join_game(request): + return render(request, 'play/join_game.html') \ No newline at end of file diff --git a/core/static/css/t-input.css b/core/static/css/t-input.css index 6be4a59..13759aa 100644 --- a/core/static/css/t-input.css +++ b/core/static/css/t-input.css @@ -1,5 +1,9 @@ @import 'tailwindcss'; +qp-container { + @apply max-w-xl w-full mx-auto; +} + nav div ul.qp-nav-list li { @apply text-white hover:scale-110 hover:border-b-2 hover:border-white transition duration-200; } diff --git a/core/templates/play/game/score_overview.html b/core/templates/play/game/score_overview.html new file mode 100644 index 0000000..e69de29 diff --git a/core/templates/play/game/wait_for_other_players.html b/core/templates/play/game/wait_for_other_players.html new file mode 100644 index 0000000..e69de29 diff --git a/core/templates/play/join_game.html b/core/templates/play/join_game.html new file mode 100644 index 0000000..526050e --- /dev/null +++ b/core/templates/play/join_game.html @@ -0,0 +1,35 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+

Spiel beitreten

+
+ {% csrf_token %} +
+ + +
+
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/core/templates/play/lobby.html b/core/templates/play/lobby.html new file mode 100644 index 0000000..39e8212 --- /dev/null +++ b/core/templates/play/lobby.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} + +{% block content %} +
+

Bundeslaender Deutschland Quiz

+
+
    +
  • Spieler 1
  • +
  • Spieler 2
  • +
  • Spieler 3
  • +
+
+ +
+{% endblock %} \ No newline at end of file From b6991c2cbdfaa90be2e83e197060e2c23088e866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhn-Vitus=20Sa=C3=9F?= Date: Sat, 15 Mar 2025 11:31:25 +0100 Subject: [PATCH 3/3] Update REQUIREMENTS --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 31cf3eb..b387401 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ django~=5.1.4 +channels~=4.2.0 +daphne~=4.1.2 \ No newline at end of file