Commit a137dea7 authored by LiniEisha's avatar LiniEisha Committed by I.K Seneviratne

IT17098960 is committing from IT17100908 user's branch.

parent e9aaea3d
...@@ -9,6 +9,8 @@ from rest_framework import status ...@@ -9,6 +9,8 @@ from rest_framework import status
from rest_framework.views import APIView from rest_framework.views import APIView
from rest_framework.parsers import MultiPartParser, FormParser from rest_framework.parsers import MultiPartParser, FormParser
from . import record
from rest_framework.views import * from rest_framework.views import *
class StudentAPIView(APIView): class StudentAPIView(APIView):
...@@ -160,3 +162,12 @@ class FileView(APIView): ...@@ -160,3 +162,12 @@ class FileView(APIView):
return Response(file_serializer.errors, status=status.HTTP_400_BAD_REQUEST) return Response(file_serializer.errors, status=status.HTTP_400_BAD_REQUEST)
# this API will initiate the lecture
class InitiateLecture(APIView):
def get(self, request):
record.initiate()
return Response({
"response": "success"
})
from django.urls import path from django.urls import path
from .api import student_list, student_detail, subject_list, subject_detail, attendance_list, StudentAPIView, StudentDetails from .api import student_list, student_detail, subject_list, subject_detail, attendance_list, StudentAPIView, \
StudentDetails
from django.conf.urls import url from django.conf.urls import url
from .api import FileView from .api import FileView, InitiateLecture
from . import views
urlpatterns = [ urlpatterns = [
path('students/', student_list), path('students/', student_list),
...@@ -10,8 +12,12 @@ urlpatterns = [ ...@@ -10,8 +12,12 @@ urlpatterns = [
path('subjects/<str:pk>', subject_detail), path('subjects/<str:pk>', subject_detail),
path('attendance/', attendance_list), path('attendance/', attendance_list),
path('student/', StudentAPIView.as_view()), path('student/', StudentAPIView.as_view()),
path('initiate-lecture', views.initiate_lecture),
# class based # class based
path('student/', StudentAPIView.as_view()), path('student/', StudentAPIView.as_view()),
path('student/<str:pk>', StudentDetails.as_view()), path('student/<str:pk>', StudentDetails.as_view()),
url(r'^upload/$', FileView.as_view(), name='file-upload') url(r'^upload/$', FileView.as_view(), name='file-upload'),
# this url will initiate the lecture
url(r'^process-initiate-lecture/$', InitiateLecture.as_view())
] ]
from django.shortcuts import render
def initiate_lecture(request):
return render(request, "AttendanceApp/Initiate_lecture.html")
\ No newline at end of file
...@@ -97,6 +97,19 @@ ...@@ -97,6 +97,19 @@
</div>S </div>S
</li> </li>
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseFour" aria-expanded="true" aria-controls="collapseThree">
<i class="fas fa-fw fa-cog"></i>
<span>Attendance</span>
</a>
<div id="collapseFour" class="collapse" aria-labelledby="headingThree" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<h6 class="collapse-header">Components:</h6>
<a class="collapse-item" href="/attendance/initiate-lecture">initiate lecture</a>
</div>ac
</div>S
</li>
<!-- Nav Item - Utilities Collapse Menu --> <!-- Nav Item - Utilities Collapse Menu -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseUtilities" aria-expanded="true" aria-controls="collapseUtilities"> <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseUtilities" aria-expanded="true" aria-controls="collapseUtilities">
......
Markdown is supported
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