BES-6 Fix bug with adding notes and bug connected with showing wrong title

This commit is contained in:
Th3NiKo 2020-01-18 19:02:50 +01:00
parent 1553d6be08
commit 25b74a61d3
5 changed files with 4 additions and 7 deletions

View File

@ -6,7 +6,7 @@
{% block content %}
{% 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">
{% 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" %}

View File

@ -2,15 +2,13 @@
<html lang="pl">
{% load static %}
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ 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" type="text/css" href="{% static 'navbar.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>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

View File

@ -16,6 +16,5 @@ urlpatterns = [
path('notes/<subject_id>', views.notes_name, name="notes_id"),
path('create/', views.create_note, name="create_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_id/<note_id>', views.update_note_id, name="update_note_id")
path('update_note/<note_id>', views.update_note, name="update_note")
]

View File

@ -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
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 = {
'subject_name': subject_name,

Binary file not shown.