Commit aecfefec authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

first try on the FBV homepage

parent 3077688c
...@@ -24,5 +24,9 @@ class Assignment(models.Model): ...@@ -24,5 +24,9 @@ class Assignment(models.Model):
def __str__(self): def __str__(self):
return '{} {}-'.format(self.assignment_name, self.section,) return '{} {}-'.format(self.assignment_name, self.section,)
def get_absolute_url(self):
return '{}'.format(self.pk)
<head>
<link rel="stylesheet" href="makeItBeautiful.css">
<title>{% block webTitle %}{% endblock %}</title>
</head>
<body>
{% block pageTitle %}{% endblock %}
{% block content %}{% endblock %}
{% block otherButtons %} {% endblock %}
</body>
\ No newline at end of file
{% extends 'base.html' %}
{% block webTitle %} Assignments {% endblock %}
{% block pageTitle %} <h1> Assignments </h1> {% endblock %}
{% block content %}
<div class="content">
<ul style="list-style-type:square;">
{% for assignment in {{ assignmentsList }}.object.all() %}
<li> <div class="assignmentLink"> <a href="{{ assignment.get_absolute_url }}/details"> {{ assignment.assignment_name }} </a> </div> </li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% block otherButtons %}
<div class="content">
<a class="buttonLink" href="add/"> New Assignments </a>
<a class="miniLink" href="/dashboard"> Dashboard </a>
<a class="miniLink" href="/announcements"> Announcements </a>
<a class="miniLink" href="/forum"> Forum </a>
<a class="miniLink" href="/calendar"> Calendar </a>
</div>
{% endblock %}
\ No newline at end of file
from django.urls import path from django.urls import path
from .views import index from .views import homeAssignmentsPage
urlpatterns = [ urlpatterns = [
path('', index, name='index'), path('', homeAssignmentsPage, name='homePage'),
] ]
......
...@@ -4,6 +4,10 @@ from django.http import HttpResponse ...@@ -4,6 +4,10 @@ from django.http import HttpResponse
from .models import Assignment from .models import Assignment
def homeAssignmentsPage(request):
return render(request, 'templates/assignments.html', {'assignmentsList': Assignment})
def index(request): def index(request):
head = "<h1 style='border-bottom:4px solid lightgray;\ head = "<h1 style='border-bottom:4px solid lightgray;\
......
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