Commit 7d25b585 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

assignment-details.html is done

parent dfad8189
<head>
<link rel="stylesheet" href="makeItBeautiful.css">
<link rel="stylesheet" href="templates/makeItBeautiful.css">
<title>{% block webTitle %}{% endblock %}</title>
</head>
<body>
{% block pageTitle %}{% endblock %}
{% block content %}{% endblock %}
{% block otherButtons %} {% endblock %}
<div class="pageTitle"> <h1 class="pageTitle"> {% block pageTitle %}{% endblock %} </h1> </div>
<div class="content">
{% block content %}{% endblock %}
<div class="navButtons">
{% block otherButtons %} {% endblock %}
</div>
</div>
</body>
\ No newline at end of file
{% extends 'base.html' %}
{% block webTitle %} {{object.assignment_name}} {% endblock %}
{% block pageTitle %} {{object.assignment_name}} {% endblock %}
{% block content %}
{% csrf_token %}
{{ form.as_p }}
<input type="submit" id="submitButton" value="Submit">
{% endblock %}
{% block otherButtons %}
{% endblock %}
\ No newline at end of file
from django.urls import path
from .views import homeAssignmentsPage
from .views import homeAssignmentsPage, AssignmentsDetailView
urlpatterns = [
path('', homeAssignmentsPage, name='homePage'),
path('<int:pk>/details/', AssignmentsDetailView.as_view(), name='assignment_details')
]
......
from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.http import HttpResponse
from .models import Assignment
def homeAssignmentsPage(request):
starter = "{% block content %}\
<div class='content'>\
<ul style='list-style-type:square;'>\n"
middle = ""
for assignment in Assignment.objects.all():
middle = middle + "<li> <div class='assignmentLink'> \
<a href='"+ str(assignment.get_absolute_url)+"'/details>" + str(assignment.assignment_name)+" </a> </div> </li>"
ender = "</ul>\
</div>\
{% endblock %}"
output = starter+middle+ender
return render(request, 'templates/assignments.html', {"addition":output})
return render(request, 'templates/assignments.html', {"assignmentsList":Assignment.objects.all()})
class AssignmentsDetailView(DetailView):
model = Assignment
template_name = "templates/assignment-details.html"
pass
def index(request):
......
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