Merge branch 'master' into feature/sending-email

This commit is contained in:
Hubert Jankowski 2021-12-11 20:04:44 +01:00
commit f7e2065c58
12 changed files with 308 additions and 3 deletions

6
.gitignore vendored
View File

@ -9,7 +9,8 @@ media
# Backup files #
*.bak
# If you are using PyCharm #
# If you are using PyCharm #
.idea/
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
@ -103,7 +104,8 @@ env/
venv/
ENV/
env.bak/
venv.bak/
venv.bak/
soita-venv/
# mkdocs documentation
/site

View File

@ -68,7 +68,7 @@ ROOT_URLCONF = get_secret("ROOT_URLCONF")
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': os.path.join(BASE_DIR, "templates"),
'DIRS': [os.path.join(BASE_DIR, "templates")],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [

View File

@ -16,8 +16,13 @@ Including another URLconf
from django.contrib import admin
from django.urls import include
from django.urls import path
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")),

27
config/views.py Normal file
View File

@ -0,0 +1,27 @@
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')
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')

6
palette.txt Normal file
View File

@ -0,0 +1,6 @@
Color palette:
#00916E - Illuminating Emerald
#FEEFE5 - Linen
#FFCF00 - Cyber Yellow
#EE6123 - Orange Panteon
#FA003F - Red Munsell

109
static/style.css Normal file
View File

@ -0,0 +1,109 @@
.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;
}
.authContent {
top: 50%;
left: 50%;
position: absolute;
width: 400px;
height: 550px;
padding: 80px 40px;
background-color: #FEEFE5;
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
color: #2B3D41;
}
.authContent h2 {
margin: 0;
padding: 0 0 20px;
text-align: center;
text-transform: uppercase;
}
.authContent p {
margin: 0;
padding: 0;
font-weight: bold;
line-height: 1.5;
}
.authContent input {
width: 100%;
margin-bottom: 20px;
}
.authContent input[type=text],
.authContent input[type=email],
.authContent input[type=password]{
border: none;
border-bottom: 1px solid #2B3D41;;
background: transparent;
outline: none;
height: 35px;
color: #2B3D41;;
}
.authContent input[type=submit]{
height: 30px;
color: #FFF;
font-size: 15px;
background: #00916E;
cursor: pointer;
border-radius: 25px;
border: none;
outline: none;
margin-top: 15px;
}
input[type=checkbox]{
width: 20%;
}
.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;
}
background-color:#FA003F

22
templates/authBase.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<title>SOITA | {% block title %}{% endblock %}</title>
<meta name="description" content="{% block description %}{% endblock %}">
</head>
<body style="background-color: #FA003F">
<div class="titleBar">
SOITA
</div>
<div class="authContent">
{% block content %}
{% endblock %}
</div>
</body>
</html>

66
templates/base.html Normal file
View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<!-- <style type="text/css">-->
<!-- .sidenav {-->
<!-- height: 100%;-->
<!-- width: 160px;-->
<!-- position: fixed;-->
<!-- z-index: 1;-->
<!-- top: 0;-->
<!-- left: 0;-->
<!-- background-color: #111;-->
<!-- overflow-x: :hidden;-->
<!-- padding-top: 20px;-->
<!-- }-->
<!-- .sidenav a {-->
<!-- padding: 6px 8px 6px 16px;-->
<!-- text-decoration: none;-->
<!-- font-size: 20px;-->
<!-- color: #818181;-->
<!-- display: block;-->
<!-- line-height: 1.6;-->
<!-- }-->
<!-- .sidenav a:hover {-->
<!-- color: #f1f1f1;-->
<!-- }-->
<!-- .main {-->
<!-- margin-left: 160px;-->
<!-- padding: 0px 10px;-->
<!-- }-->
<!-- </style>-->
<title>SOITA | {% block title %}{% endblock %}</title>
<meta name="description" content="{% block description %}{% endblock %}">
</head>
<body>
<div class="sidenav">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/tests/category/1">Category1</a>
<a href="/tests/category/2">Category2</a>
<a href="/tests/category/3">Category3</a>
<a href="/tests/category/4">Category4</a>
<a href="/tests/category/5">Category5</a>
<a href="/tests/category/6">Category6</a>
<a href="/tests/category/7">Category7</a>
<a href="/tests/category/8">Category8</a>
<a href="/tests/category/9">Category9</a>
<a href="/tests/category/10">Category10</a>
</div>
<div id="content", name="content", class="main">
{% block content %}
{% endblock %}
</div>
</body>
</html>

22
templates/index.html Normal file
View File

@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}Home{% endblock %}
{% block content %}
<h1>Welcome in SOITA/h1>
<!-- TODO reading all tests from DB-->
{% for test in tests.all %}
<div class="test-infoBox">
<p><a href="/tests/{{test.id}}/show/">{{test.name}}</a></p>
</div>
{% endfor %}
<!-- {% if user.is_authenticated %}-->
<!-- <p>Username: {{user.username}}</p>-->
<!-- <p>Name: {{user.first_name}} {{user.last_name}}</p>-->
<!-- <p>Email: {{user.email}}</p>-->
<!-- {% else %}-->
<!-- Guest nr 123-->
<!-- {% endif %}-->
{% endblock %}

16
templates/login.html Normal file
View File

@ -0,0 +1,16 @@
{% extends "authBase.html" %}
{% block title %}Log In{% endblock %}
{% block content %}
<h2>Log In</h2>
<form action="">
<p>Email</p>
<input type="email" placeholder="Enter Email">
<p>Password</p>
<input type="password" placeholder="Enter Password">
<input type="submit" value="Log in">
<p><input type="checkbox">Remember Me</p>
</form>
{% endblock %}

8
templates/logout.html Normal file
View File

@ -0,0 +1,8 @@
{% extends "authBase.html" %}
{% block title %}Log Out{% endblock %}
{% block content %}
<p>You have been logged out successfully</p>
{% endblock %}

22
templates/register.html Normal file
View File

@ -0,0 +1,22 @@
{% extends "authBase.html" %}
{% block title %}Create account{% endblock %}
{% block content %}
<h2>Register</h2>
<form action="">
<p>First Name</p>
<input type="text" placeholder="Enter First Name">
<p>Last Name</p>
<input type="text" placeholder="Enter Last Name">
<p>Email</p>
<input type="email" placeholder="Enter Email">
<p>Password</p>
<input type="password" placeholder="Enter Password">
<p>Repeat password</p>
<input type="password" placeholder="Enter Password">
<input type="submit" value="Crete account">
<p><input type="checkbox">Remember Me</p>
</form>
{% endblock %}