diff --git a/bestnotes/templates/notes.html b/bestnotes/templates/notes.html
new file mode 100644
index 0000000..8bf2cb6
--- /dev/null
+++ b/bestnotes/templates/notes.html
@@ -0,0 +1,37 @@
+{% extends 'base.html' %}
+{% load static %}
+{% block css %}
+
+{% endblock %}
+{% block content %}
+{% include 'navbar.html' %}
+
+
+
+
+
+
Dostępne notatki
+
+ {% for note in notes%}
+ {% if user.id != note.user.user.id %}
+ {{ note.name }}
+ {% endif %}
+ {% endfor %}
+
+
+
+
Twoje notatki
+
+ {% for note in notes%}
+ {% if user.id == note.user.user.id %}
+ {{ note.name }}
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
+{% endblock %}
diff --git a/bestnotes/templates/subjects.html b/bestnotes/templates/subjects.html
index a063669..f78dc08 100644
--- a/bestnotes/templates/subjects.html
+++ b/bestnotes/templates/subjects.html
@@ -25,18 +25,18 @@
Liczba dostępnych przedmiotów: 3/5
- Sztuczna inteligencja
-
+ Programowanie
+
- Systemy informatyczne
-
+ Matematyka
+
- Programowanie
-
+ Systemy informatyczne
+
diff --git a/bestnotes/urls.py b/bestnotes/urls.py
index 4e4bb0d..e57149e 100644
--- a/bestnotes/urls.py
+++ b/bestnotes/urls.py
@@ -11,5 +11,5 @@ urlpatterns = [
path('note/', views.note_id, name="note"),
path('notes/', views.notes_all, name="notes"),
- path('notes/', views.notes_name, name="notes_name")
+ path('notes/', views.notes_name, name="notes_id")
]
diff --git a/bestnotes/views.py b/bestnotes/views.py
index 9748aa4..83d7720 100644
--- a/bestnotes/views.py
+++ b/bestnotes/views.py
@@ -29,14 +29,14 @@ def note_id(request,id):
#Give all notes connected with subject name and pass it to html
-def notes_name(request,subject_name):
+def notes_name(request,subject_id):
all_notes = Note.objects.all()
- subject_notes = all_notes.filter(topic__subject__name=subject_name) #Get all notes with subject name
+ subject_notes = all_notes.filter(topic__subject__id=subject_id) #Get all notes with subject name
context = {
'notes' : subject_notes
}
#Change website here
- return render(request, "test.html", context)
+ return render(request, "notes.html", context)
def notes_all(request):
all_notes = Note.objects.all()
diff --git a/db.sqlite3 b/db.sqlite3
index 1562781..250dbc4 100644
Binary files a/db.sqlite3 and b/db.sqlite3 differ