diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 709683f..dbe4df9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,25 @@ - - - - - - + + + + + + + + + + + + + + + + + @@ -20,6 +31,9 @@ + + + - + - + diff --git a/BestNotesProject/__pycache__/settings.cpython-38.pyc b/BestNotesProject/__pycache__/settings.cpython-38.pyc index e0a9351..3d5303c 100644 Binary files a/BestNotesProject/__pycache__/settings.cpython-38.pyc and b/BestNotesProject/__pycache__/settings.cpython-38.pyc differ diff --git a/BestNotesProject/__pycache__/urls.cpython-38.pyc b/BestNotesProject/__pycache__/urls.cpython-38.pyc index d327180..03fff54 100644 Binary files a/BestNotesProject/__pycache__/urls.cpython-38.pyc and b/BestNotesProject/__pycache__/urls.cpython-38.pyc differ diff --git a/BestNotesProject/settings.py b/BestNotesProject/settings.py index fbc485d..385d1cf 100644 --- a/BestNotesProject/settings.py +++ b/BestNotesProject/settings.py @@ -27,9 +27,12 @@ DEBUG = True ALLOWED_HOSTS = [] + +STATIC_URL = '/static/' # -LOGIN_REDIRECT_URL = '/bestnotes/profesor/' -LOGOUT_REDIRECT_URL = '/bestnotes/' +LOGIN_REDIRECT_URL = '/bestnotes/' +LOGOUT_REDIRECT_URL = '/bestnotes/accounts/login/' + # Application definition INSTALLED_APPS = [ diff --git a/BestNotesProject/static/images/bg_notes.jpg b/BestNotesProject/static/images/bg_notes.jpg new file mode 100644 index 0000000..3e657e4 Binary files /dev/null and b/BestNotesProject/static/images/bg_notes.jpg differ diff --git a/BestNotesProject/urls.py b/BestNotesProject/urls.py index 9856b50..79d2524 100644 --- a/BestNotesProject/urls.py +++ b/BestNotesProject/urls.py @@ -15,8 +15,10 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include +from bestnotes.views import homepage urlpatterns = [ path('bestnotes/', include('bestnotes.urls')), + path('', homepage, name='homepage'), path('admin/', admin.site.urls), ] diff --git a/bestnotes/__pycache__/admin.cpython-38.pyc b/bestnotes/__pycache__/admin.cpython-38.pyc index 4ba9b12..6d225d1 100644 Binary files a/bestnotes/__pycache__/admin.cpython-38.pyc and b/bestnotes/__pycache__/admin.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/models.cpython-38.pyc b/bestnotes/__pycache__/models.cpython-38.pyc index 45a4397..1eb4246 100644 Binary files a/bestnotes/__pycache__/models.cpython-38.pyc and b/bestnotes/__pycache__/models.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/urls.cpython-38.pyc b/bestnotes/__pycache__/urls.cpython-38.pyc index 06e79ab..32bfb75 100644 Binary files a/bestnotes/__pycache__/urls.cpython-38.pyc and b/bestnotes/__pycache__/urls.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/views.cpython-38.pyc b/bestnotes/__pycache__/views.cpython-38.pyc index b63e7ad..4c8494c 100644 Binary files a/bestnotes/__pycache__/views.cpython-38.pyc and b/bestnotes/__pycache__/views.cpython-38.pyc differ diff --git a/bestnotes/admin.py b/bestnotes/admin.py index 6b4570b..4036e30 100644 --- a/bestnotes/admin.py +++ b/bestnotes/admin.py @@ -2,6 +2,8 @@ from django.contrib import admin # Register your models here. from django.contrib import admin -from .models import StudentProfile +from .models import StudentProfile, Subject, Topic -admin.site.register(StudentProfile) \ No newline at end of file +admin.site.register(StudentProfile) +admin.site.register(Subject) +admin.site.register(Topic) \ No newline at end of file diff --git a/bestnotes/migrations/0002_subject_topic.py b/bestnotes/migrations/0002_subject_topic.py new file mode 100644 index 0000000..6fe04b2 --- /dev/null +++ b/bestnotes/migrations/0002_subject_topic.py @@ -0,0 +1,31 @@ +# Generated by Django 2.2.7 on 2019-12-01 22:21 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('bestnotes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Subject', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bestnotes.StudentProfile')), + ], + ), + migrations.CreateModel( + name='Topic', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('add_date', models.DateField()), + ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bestnotes.Subject')), + ], + ), + ] diff --git a/bestnotes/migrations/__pycache__/0002_subject_topic.cpython-38.pyc b/bestnotes/migrations/__pycache__/0002_subject_topic.cpython-38.pyc new file mode 100644 index 0000000..bd6dba5 Binary files /dev/null and b/bestnotes/migrations/__pycache__/0002_subject_topic.cpython-38.pyc differ diff --git a/bestnotes/models.py b/bestnotes/models.py index 52d5eb6..112a068 100644 --- a/bestnotes/models.py +++ b/bestnotes/models.py @@ -33,4 +33,16 @@ def create_studentprofile(sender, instance, created, **kwargs): @receiver(post_save, sender=User) def save_studentprofile(sender, instance, **kwargs): - instance.studentprofile.save() \ No newline at end of file + instance.studentprofile.save() + + +class Subject(models.Model): + name = models.CharField(max_length=30) + student = models.ForeignKey(StudentProfile, on_delete=models.CASCADE) + +class Topic(models.Model): + name = models.CharField(max_length=30) + subject = models.ForeignKey(Subject, on_delete=models.CASCADE) + add_date = models.DateField() + + diff --git a/bestnotes/static/bg_notes.jpg b/bestnotes/static/bg_notes.jpg new file mode 100644 index 0000000..2707b2f Binary files /dev/null and b/bestnotes/static/bg_notes.jpg differ diff --git a/bestnotes/static/homepage.css b/bestnotes/static/homepage.css new file mode 100644 index 0000000..e69de29 diff --git a/bestnotes/static/laptop.jpg b/bestnotes/static/laptop.jpg new file mode 100644 index 0000000..5b9b6ea Binary files /dev/null and b/bestnotes/static/laptop.jpg differ diff --git a/bestnotes/static/laptop.png b/bestnotes/static/laptop.png new file mode 100644 index 0000000..566d5d9 Binary files /dev/null and b/bestnotes/static/laptop.png differ diff --git a/bestnotes/static/login.css b/bestnotes/static/login.css new file mode 100644 index 0000000..b04cf19 --- /dev/null +++ b/bestnotes/static/login.css @@ -0,0 +1,47 @@ +.login-container{ + margin-top: 5%; + text-align: center; +} +.logo{ + color:white; + margin-bottom: 5%; +} + + +.login-form-2{ + border-radius: 5%; + padding: 5%; + background: #0062cc; + box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 9px 26px 0 rgba(0, 0, 0, 0.19); +} +.input-group-text{ + font-size: 1.5rem; + min-width: 50px; +} + +.icon{ + text-align: center; +} + + +.login-form-2 h1{ + text-align: center; + color: #fff; +} +.login-container form{ + padding: 8%; +} +.btnSubmit +{ + width: 50%; + border-radius: 1rem; + padding: 1.5%; + border: none; + cursor: pointer; +} + +.login-form-2 .btnSubmit{ + font-weight: 600; + color: #0062cc; + background-color: #fff; +} \ No newline at end of file diff --git a/bestnotes/static/navbar.css b/bestnotes/static/navbar.css new file mode 100644 index 0000000..1225a3e --- /dev/null +++ b/bestnotes/static/navbar.css @@ -0,0 +1,9 @@ +.nolink{ + text-decoration: none; + color:white; +} + +.nolink:hover{ + text-decoration: none; + color:white; +} \ No newline at end of file diff --git a/bestnotes/static/subject.css b/bestnotes/static/subject.css new file mode 100644 index 0000000..e69de29 diff --git a/bestnotes/templates/homepage.html b/bestnotes/templates/homepage.html index 34ac0c7..e14d60d 100644 --- a/bestnotes/templates/homepage.html +++ b/bestnotes/templates/homepage.html @@ -10,7 +10,28 @@ {% include 'navbar.html' %} -
+
+
+
+ +
+ +
+
+
+ +
+
+

Stwórz najlepszą wersję mobilnych notatek

+
+ +
+
+
+

Dziel się notatkami ze znajomymi

+
+ +
diff --git a/bestnotes/templates/navbar.html b/bestnotes/templates/navbar.html index fce2e9f..204447e 100644 --- a/bestnotes/templates/navbar.html +++ b/bestnotes/templates/navbar.html @@ -7,12 +7,13 @@ \ No newline at end of file diff --git a/bestnotes/templates/przedmiot.html b/bestnotes/templates/subject.html similarity index 93% rename from bestnotes/templates/przedmiot.html rename to bestnotes/templates/subject.html index df9ce99..2bf0b0f 100644 --- a/bestnotes/templates/przedmiot.html +++ b/bestnotes/templates/subject.html @@ -1,6 +1,8 @@ {% extends 'base.html' %} {% load static %} - +{% block css %} + +{% endblock %} {% block content %} {% include 'navbar.html' %}
diff --git a/bestnotes/templates/profesor.html b/bestnotes/templates/subjects.html similarity index 89% rename from bestnotes/templates/profesor.html rename to bestnotes/templates/subjects.html index d05929d..a063669 100644 --- a/bestnotes/templates/profesor.html +++ b/bestnotes/templates/subjects.html @@ -26,17 +26,17 @@ Liczba dostępnych przedmiotów: 3/5
  • Sztuczna inteligencja

    - +
  • Systemy informatyczne

    - +
  • Programowanie

    - +
  • diff --git a/bestnotes/urls.py b/bestnotes/urls.py index 8cb8afd..9caec86 100644 --- a/bestnotes/urls.py +++ b/bestnotes/urls.py @@ -6,6 +6,6 @@ urlpatterns = [ path('', views.homepage, name='homepage'), #path('/', views.login), path('accounts/', include("django.contrib.auth.urls")), - path('profesor/', views.profesor, name="profesor"), - path('profesor/', views.profesor_id), + path('subject/', views.subject, name="subject"), + path('subject/', views.subject_id, name="subjectid"), ] diff --git a/bestnotes/views.py b/bestnotes/views.py index 48d7eab..7fac749 100644 --- a/bestnotes/views.py +++ b/bestnotes/views.py @@ -7,11 +7,10 @@ from django.http import HttpResponse def homepage(request): #return HttpResponse("BestNotes' index will be here.") return render(request, "homepage.html", {}) -def login(request): - return render(request, "login.html", {}) -def profesor(request): - return render(request, "profesor.html", {}) -def profesor_id(request,id): - return render(request, "przedmiot.html", {'id': id}) \ No newline at end of file +def subject(request): + return render(request, "subjects.html", {}) + +def subject_id(request,id): + return render(request, "subject.html", {'id': id}) \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 7fbbc60..e2c3816 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/images/bg_notes.jpg b/images/bg_notes.jpg new file mode 100644 index 0000000..3e657e4 Binary files /dev/null and b/images/bg_notes.jpg differ