From 74adb6f19b169bf3246c2dcfd96b0756c07613e9 Mon Sep 17 00:00:00 2001 From: Piotr Kopycki Date: Thu, 23 Dec 2021 14:03:12 +0100 Subject: [PATCH] Home page update --- config/settings.py | 6 +++--- config/views.py | 5 ++++- static/style.css | 15 +++++++++++++++ templates/base.html | 27 ++++++++++++++++----------- templates/home.html | 25 ++++++++++--------------- 5 files changed, 48 insertions(+), 30 deletions(-) diff --git a/config/settings.py b/config/settings.py index 8a9df16..fef4f84 100644 --- a/config/settings.py +++ b/config/settings.py @@ -116,9 +116,9 @@ REST_FRAMEWORK = { "DEFAULT_PERMISSION_CLASSES": ( "rest_framework.permissions.IsAuthenticated", ), - # "DEFAULT_AUTHENTICATION_CLASSES": ( - # "rest_framework_simplejwt.authentication.JWTAuthentication", - # ), + "DEFAULT_AUTHENTICATION_CLASSES": ( + "rest_framework_simplejwt.authentication.JWTAuthentication", + ), "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "DEFAULT_FILTER_BACKENDS": ( "django_filters.rest_framework.DjangoFilterBackend", diff --git a/config/views.py b/config/views.py index 9623ff2..9fdf12e 100644 --- a/config/views.py +++ b/config/views.py @@ -1,14 +1,17 @@ from django.shortcuts import render, redirect from django.template import loader from django.contrib.auth.decorators import login_required +from trials.models import Test @login_required def home(request): + context = {} + context['tests'] = Test.objects.all # context = { # 'latest_question_list': latest_question_list, # } - return render(request, 'home.html') + return render(request, 'home.html', context) def welcome(request): diff --git a/static/style.css b/static/style.css index 442b19c..5df02bf 100644 --- a/static/style.css +++ b/static/style.css @@ -23,6 +23,16 @@ color: #00916E; } +.sidenav p { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 20px; + color: #FEEFE5; + display: block; + line-height: 1.6; + text-transform: uppercase; +} + .sidenav-footer { } @@ -32,6 +42,11 @@ padding: 0px 10px; } +.main h1 { + text-align: center; + text-transform: uppercase; +} + .authContent { top: 50%; left: 50%; diff --git a/templates/base.html b/templates/base.html index 8bb1cab..746ce22 100644 --- a/templates/base.html +++ b/templates/base.html @@ -43,17 +43,22 @@
Home - About - Category1 - Category2 - Category3 - Category4 - Category5 - Category6 - Category7 - Category8 - Category9 - Category10 + Create test + Your tests +

Categories

+ Język polski + Język angielski + Język niemiecki + Matematyka + Informatyka + Fizyka + Chemia + Biologia + Geografia + Historia +

Account

+ Settings + Logout
diff --git a/templates/home.html b/templates/home.html index fdeba24..37833a2 100644 --- a/templates/home.html +++ b/templates/home.html @@ -3,20 +3,15 @@ {% block title %}Home{% endblock %} {% block content %} -

Welcome in SOITA/h1> - - {% for test in tests.all %} - - - {% endfor %} - - - - - - - +

Welcome in SOITA

+ {% for test in tests %} +

+ {{test.name}} +
+ Passing score: {{test.passing_score}} +
+ Category: {{test.category.name}} +

+ {% endfor %} {% endblock %}