Commit af702936 authored by Emmanuel Linus T. Evangelista's avatar Emmanuel Linus T. Evangelista
parents f50c87d9 db3358f3
......@@ -17,7 +17,7 @@
<div class = "block">
<h2> {{a.course}} </h2>
<li>
<a href="{% url 'Assignments:assignment-detail' a.pk%}"> {{a.name}} </a>
<a href="/assignment/{{ a.pk }}/details"> {{a.name}} </a>
</li>
</div>
{%endfor%}
......
......@@ -3,9 +3,8 @@ from . import views
from .views import MainView, AssignmentListView, AssignmentDetailView
urlpatterns = [
path('', MainView.as_view(), name='index'),
path('assignment', AssignmentListView.as_view(), name='assignment-list'),
path('assignment/<int:pk>/details', AssignmentDetailView.as_view(), name ='assignment-detail'),
path('', MainView.as_view(), name='assignments'),
path('assignments', AssignmentListView.as_view(), name='assignment-list'),
]
app_name = 'Assignments'
\ No newline at end of file
......@@ -10,7 +10,7 @@ class MainView(View):
def get(self, request):
course = Course.objects.all().order_by('course_code')
assignment = Assignment.objects.all().order_by('course')
return render(request, 'index.html',{
return render(request, 'assignments.html',{
'course': course,
'assignment': assignment,
})
......
......@@ -17,6 +17,7 @@ from django.contrib import admin
from django.urls import path, include
import Announcements.views as Announcements_views
import Forum.views as Forum_views
from Assignments.views import AssignmentDetailView
urlpatterns = [
path('admin/', admin.site.urls),
......@@ -26,4 +27,7 @@ urlpatterns = [
path('announcements/', include('Announcements.urls', namespace="Announcements")),
path('announcements/<int:announcement_id>/details', Announcements_views.details, name='announcement_details'),
path('assignments/', include('Assignments.urls', namespace="Assignments")),
path('assignment/<int:pk>/details', AssignmentDetailView.as_view(), name ='assignment-detail'),
]
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