Commit f921955d authored by ibooking-sigurd's avatar ibooking-sigurd
Browse files

Fix three more bugs.

Unneccesary newline in backend.
Tags in table (diets.js) in frontend.
parent 513fae70
......@@ -2,9 +2,7 @@
"""
from rest_framework import generics, mixins, permissions, filters
from rest_framework.parsers import (
JSONParser,
)
from rest_framework.parsers import (JSONParser)
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
......@@ -23,13 +21,14 @@ from diets.permissions import (
from rest_framework.permissions import (AllowAny)
from diets.mixins import CreateListModelMixin
from diets.models import Diet, Mealtype, MealtypeInstance, DietFile, DietInstance
from diets.serializers import (DietSerializer,
DietInstanceSerializer,
MealtypeSerializer,
RememberMeSerializer,
MealtypeInstanceSerializer,
DietFileSerializer
)
from diets.serializers import (
DietSerializer,
DietInstanceSerializer,
MealtypeSerializer,
RememberMeSerializer,
MealtypeInstanceSerializer,
DietFileSerializer
)
from django.core.exceptions import PermissionDenied
from rest_framework_simplejwt.tokens import RefreshToken
from rest_framework.response import Response
......
......@@ -46,10 +46,10 @@
</div>
<div class="d-flex">
<table class="mb-1 text-start">
<tr><td>Date:</td><td></td></tr>
<tr><td>Time:</td><td></td></tr>
<tr><td>Owner:</td><td></td></tr>
<tr><td>Mealtypes:</td><td></td></tr>
<tr><th id="date">Date:</th><td></td></tr>
<tr><th id="time">Time:</th><td></td></tr>
<tr><th id="owner">Owner:</th><td></td></tr>
<tr><th id="mealtypes">Mealtypes:</th><td></td></tr>
</table>
</div>
</a>
......
......@@ -22,10 +22,10 @@ async function fetchDiets(ordering) {
let table = aDiet.querySelector("table");
let rows = table.querySelectorAll("tr");
rows[0].querySelectorAll("td")[1].textContent = localDate.toLocaleDateString(); // Date
rows[1].querySelectorAll("td")[1].textContent = localDate.toLocaleTimeString(); // Time
rows[2].querySelectorAll("td")[1].textContent = diet.owner_username; //Owner
rows[3].querySelectorAll("td")[1].textContent = diet.mealtype_instances.length; // Mealtypes
rows[0].querySelectorAll("td")[0].textContent = localDate.toLocaleDateString(); // Date
rows[1].querySelectorAll("td")[0].textContent = localDate.toLocaleTimeString(); // Time
rows[2].querySelectorAll("td")[0].textContent = diet.owner_username; //Owner
rows[3].querySelectorAll("td")[0].textContent = diet.mealtype_instances.length; // Mealtypes
container.appendChild(aDiet);
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment