BES-6 Fix bug with adding notes and bug connected with showing wrong title
This commit is contained in:
parent
1553d6be08
commit
25b74a61d3
@ -6,7 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
{% include 'navbar.html' %}
|
{% include 'navbar.html' %}
|
||||||
|
|
||||||
<form action={% url 'update_note_id' note_id=note.id %} method="post">{% csrf_token %}
|
<form action={% url 'create_note' %} method="post">{% csrf_token %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{% render_field form.name class="form-control mb-2 mt-4 bg-dark text-light" id="name" placeholder="Wpisz nazwe notatki" %}
|
{% render_field form.name class="form-control mb-2 mt-4 bg-dark text-light" id="name" placeholder="Wpisz nazwe notatki" %}
|
||||||
{% render_field form.subject class="form-control mb-2 bg-dark text-light" name="subject" id="subject" placeholder="Wpisz przedmiot" %}
|
{% render_field form.subject class="form-control mb-2 bg-dark text-light" name="subject" id="subject" placeholder="Wpisz przedmiot" %}
|
||||||
|
@ -2,15 +2,13 @@
|
|||||||
<html lang="pl">
|
<html lang="pl">
|
||||||
{% load static %}
|
{% load static %}
|
||||||
<head>
|
<head>
|
||||||
<!-- Required meta tags -->
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
{{ form.media }}
|
{{ form.media }}
|
||||||
<!-- Bootstrap CSS -->
|
|
||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'navbar.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'navbar.css' %}">
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'all.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'all.css' %}">
|
||||||
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
|
<script src="https://cdn.tiny.cloud/1/r9o35nobg5gdj46hhxw3ohwbjh4yct23kx405ozckt8fj2k2/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||||
|
|
||||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
|
@ -16,6 +16,5 @@ urlpatterns = [
|
|||||||
path('notes/<subject_id>', views.notes_name, name="notes_id"),
|
path('notes/<subject_id>', views.notes_name, name="notes_id"),
|
||||||
path('create/', views.create_note, name="create_note"),
|
path('create/', views.create_note, name="create_note"),
|
||||||
path('delete_note/<note_id>', views.delete_note, name="delete_note"),
|
path('delete_note/<note_id>', views.delete_note, name="delete_note"),
|
||||||
path('update_note/<note_id>', views.update_note, name="update_note"),
|
path('update_note/<note_id>', views.update_note, name="update_note")
|
||||||
path('update_note_id/<note_id>', views.update_note_id, name="update_note_id")
|
|
||||||
]
|
]
|
||||||
|
@ -59,7 +59,7 @@ def topics_by_subject_id(request,subject_id):
|
|||||||
topics_under_subject = all_topics.filter(subject__id=subject_id) #get topics under given subject
|
topics_under_subject = all_topics.filter(subject__id=subject_id) #get topics under given subject
|
||||||
|
|
||||||
if len(topics_under_subject) > 0:
|
if len(topics_under_subject) > 0:
|
||||||
subject_name = all_topics[0].subject.name # Get note with given id
|
subject_name = topics_under_subject[0].subject.name # Get note with given id
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'subject_name': subject_name,
|
'subject_name': subject_name,
|
||||||
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Loading…
Reference in New Issue
Block a user