From 70e901dfbfc42c426a04a107506236cce37df59f Mon Sep 17 00:00:00 2001 From: ben8 Date: Fri, 14 Feb 2025 17:31:34 +0100 Subject: [PATCH] Components App mit base.html und answer.html --- .gitignore | 3 +- .vscode/settings.json | 3 ++ .../templates/components/answer.html | 21 +++++++++ .../components/templates/components/base.html | 45 +++++++++++++++++++ core/components/urls.py | 13 ++++++ core/components/views.py | 2 + core/core/urls.py | 1 + 7 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 core/components/templates/components/answer.html create mode 100644 core/components/templates/components/base.html create mode 100644 core/components/urls.py diff --git a/.gitignore b/.gitignore index 8de75bd..cd6601b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ __pycache__ .venv -db.sqlite3 \ No newline at end of file +db.sqlite3 +tailwindcss-windows-x64.exe \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/core/components/templates/components/answer.html b/core/components/templates/components/answer.html new file mode 100644 index 0000000..184f10f --- /dev/null +++ b/core/components/templates/components/answer.html @@ -0,0 +1,21 @@ +{% extends 'components/base.html' %} +{% load static %} +{% block title %}Antwort{% endblock %} +{% block content %} + +{% if %} + + + + + + +{% else %} + + + + + +{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/core/components/templates/components/base.html b/core/components/templates/components/base.html new file mode 100644 index 0000000..d41f338 --- /dev/null +++ b/core/components/templates/components/base.html @@ -0,0 +1,45 @@ + + + + + + + + + +
Frage: Wie hoch ist der Eiffelturm insgesamt? +
+ +
+ Zeit: 60s + Deine Punkte: 60 +
+ + +
+ + + + +
+ + +
+ + {% block content %} + {% endblock %} + +
+
+ +
+ qivip + +
+ +
+ + +   + \ No newline at end of file diff --git a/core/components/urls.py b/core/components/urls.py new file mode 100644 index 0000000..2db77c3 --- /dev/null +++ b/core/components/urls.py @@ -0,0 +1,13 @@ +from django.urls import path # type: ignore +from . import views + + +app_name = 'components' # Namensraum zum verhindern von Konflikten zwischen Apps +# +# Wichtig: Damit Links funktionieren müssen diese so eingebunden werden: {% url 'accounts:login' %} statt {% url 'login' %} +# + +urlpatterns = [ + path('play/', views.play, name='play'), + +] \ No newline at end of file diff --git a/core/components/views.py b/core/components/views.py index 91ea44a..adea529 100644 --- a/core/components/views.py +++ b/core/components/views.py @@ -1,3 +1,5 @@ from django.shortcuts import render # Create your views here. +def play(request): + return render(request, 'components/answer.html') \ No newline at end of file diff --git a/core/core/urls.py b/core/core/urls.py index 488e1e4..fc6a9ac 100644 --- a/core/core/urls.py +++ b/core/core/urls.py @@ -21,4 +21,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('account/', include('accounts.urls')), path('', include('homepage.urls')), + path('play/', include('components.urls')), ]