From 2be89b6901b0e0cfbfcabf5e3536b49cec0a9410 Mon Sep 17 00:00:00 2001 From: Piotr Kopycki Date: Thu, 9 Dec 2021 23:25:35 +0100 Subject: [PATCH] Templates update --- config/templates/base.html | 16 ---------- config/templates/index.html | 15 --------- config/urls.py | 5 ++- config/views.py | 21 +++++++++++-- palette.txt | 6 ++++ static/style.css | 62 +++++++++++++++++++++++++++++++++++++ templates/authBase.html | 24 ++++++++++++++ templates/base.html | 60 ++++++++++++++++++++++++++++++++--- templates/index.html | 21 ++++++++----- templates/login.html | 8 +++++ templates/logout.html | 8 +++++ templates/register.html | 8 +++++ 12 files changed, 208 insertions(+), 46 deletions(-) delete mode 100644 config/templates/base.html delete mode 100644 config/templates/index.html create mode 100644 palette.txt create mode 100644 static/style.css create mode 100644 templates/authBase.html create mode 100644 templates/login.html create mode 100644 templates/logout.html create mode 100644 templates/register.html diff --git a/config/templates/base.html b/config/templates/base.html deleted file mode 100644 index 09c3505..0000000 --- a/config/templates/base.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - SOITA | {% block title %}{% endblock %} - - - - - {% block content %} - {% endblock %} - - - - diff --git a/config/templates/index.html b/config/templates/index.html deleted file mode 100644 index 393c280..0000000 --- a/config/templates/index.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Home{% endblock %} - -{% block content %} -

Welcome in SOITA/h1> - {% if user.is_authenticated %} -

Username: {{user.username}}

-

Name: {{user.first_name}} {{user.last_name}}

-

Email: {{user.email}}

- {% else %} - Guest nr 123 - {% endif %} -{% endblock %} - diff --git a/config/urls.py b/config/urls.py index ee67220..49df139 100644 --- a/config/urls.py +++ b/config/urls.py @@ -16,10 +16,13 @@ Including another URLconf from django.contrib import admin from django.urls import include from django.urls import path -from .views import index +from .views import index, login, logout, register urlpatterns = [ path('', index), + path('login/', login), + path('logout/', logout), + path('register/', register), path('users/', include("users.urls")), path('questions/', include("questions.urls")), path('answers/', include("answers.urls")), diff --git a/config/views.py b/config/views.py index 02bfdd5..a8668ef 100644 --- a/config/views.py +++ b/config/views.py @@ -2,9 +2,26 @@ from django.shortcuts import render, redirect from django.template import loader - def index(request): # context = { # 'latest_question_list': latest_question_list, # } - return render(request, 'index.html') \ No newline at end of file + return render(request, 'index.html') + +def login(request): + # context = { + # 'latest_question_list': latest_question_list, + # } + return render(request, 'login.html') + +def logout(request): + # context = { + # 'latest_question_list': latest_question_list, + # } + return render(request, 'logout.html') + +def register(request): + # context = { + # 'latest_question_list': latest_question_list, + # } + return render(request, 'register.html') \ No newline at end of file diff --git a/palette.txt b/palette.txt new file mode 100644 index 0000000..b17e486 --- /dev/null +++ b/palette.txt @@ -0,0 +1,6 @@ +Color palette: +#00916E - Illuminating Emerald +#FEEFE5 - Linen +#FFCF00 - Cyber Yellow +#EE6123 - Orange Panteon +#FA003F - Red Munsell \ No newline at end of file diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..351f299 --- /dev/null +++ b/static/style.css @@ -0,0 +1,62 @@ +.sidenav { + height: 100%; + width: 160px; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #FA003F; + overflow-x: :hidden; + padding-top: 20px; +} + +.sidenav a { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 20px; + color: #FEEFE5; + display: block; + line-height: 1.6; +} + +.sidenav a:hover { + color: #00916E; +} + +.main { + margin-left: 160px; + padding: 0px 10px; +} + +.authBox { + height: 100px; + width: 100px; + background-color: #FEEFE5; + color: #111; + padding: 250px 300px 0px 300px; + position: relative; +} + +.authContent { + background-color:#FA003F + padding: 250px 300px 0px 300px; + height: 100%; + width: 100%; + position: absolute; +} + +.titleBar { + height: 50px; + width: 100%; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #2B3D41; + padding-top: 20px; + text-align: center; + text-decoration: none; + font-size: 30px; + color: #FEEFE5; + display: block; +} \ No newline at end of file diff --git a/templates/authBase.html b/templates/authBase.html new file mode 100644 index 0000000..93dda44 --- /dev/null +++ b/templates/authBase.html @@ -0,0 +1,24 @@ + +{% load static %} + + + + + SOITA | {% block title %}{% endblock %} + + + + +
+ SOITA +
+
+
+ {% block content %} + {% endblock %} +
+
+ + + + diff --git a/templates/base.html b/templates/base.html index 09c3505..8bb1cab 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,15 +1,65 @@ +{% load static %} - + + + + + + + + + + + + + + - SOITA | {% block title %}{% endblock %} - + + + + + + + + + + + + + + + + + + + + SOITA | {% block title %}{% endblock %} + - {% block content %} - {% endblock %} + + +
+ {% block content %} + {% endblock %} +
diff --git a/templates/index.html b/templates/index.html index 393c280..fdeba24 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,12 +4,19 @@ {% block content %}

Welcome in SOITA/h1> - {% if user.is_authenticated %} -

Username: {{user.username}}

-

Name: {{user.first_name}} {{user.last_name}}

-

Email: {{user.email}}

- {% else %} - Guest nr 123 - {% endif %} + + {% for test in tests.all %} + + + {% endfor %} + + + + + + + {% endblock %} diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..8de3b06 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,8 @@ +{% extends "authBase.html" %} + +{% block title %}Login{% endblock %} + +{% block content %} + Login +{% endblock %} + diff --git a/templates/logout.html b/templates/logout.html new file mode 100644 index 0000000..9e910f2 --- /dev/null +++ b/templates/logout.html @@ -0,0 +1,8 @@ +{% extends "authBase.html" %} + +{% block title %}Logout{% endblock %} + +{% block content %} + Logout +{% endblock %} + diff --git a/templates/register.html b/templates/register.html new file mode 100644 index 0000000..f9756d8 --- /dev/null +++ b/templates/register.html @@ -0,0 +1,8 @@ +{% extends "authBase.html" %} + +{% block title %}Create account{% endblock %} + +{% block content %} + Create account +{% endblock %} +