Commit 18b96db3 authored by Nate Brevin A. Que's avatar Nate Brevin A. Que

Implemented the base template (in project-level), and implemented the new...

Implemented the base template (in project-level), and implemented the new version of the main page of the 'Assignments' app.
parent 4d36ecb3
{% extends 'base.html' %}
{% block title %}Widget's Assignments{% endblock %}
{% block content %}
<h1>Welcome to Widget's Assignments!</h1>
<h3>
{% for assignment in assignments %}
{{ assignment.name }}<br>
{% endfor %}
</h3>
{% endblock %}
{% block scripts %}
<input type="submit" value="New Assignment"><br><br>
<a href="/dashboard">Dashboard</a><br>
<a href="/announcement">Announcements</a><br>
<a href="/forum">Forum</a><br>
<a href="/calendar">Calendar</a>
{% endblock %}
\ No newline at end of file
...@@ -5,7 +5,4 @@ from .models import Assignment ...@@ -5,7 +5,4 @@ from .models import Assignment
def index(request): def index(request):
page_content = "<H1>Widget's Assignments Page</H1><ul>" return render(request, 'assignments/assignments.html', {'assignments': Assignment.objects.all()})
for assignment in Assignment.objects.all(): \ No newline at end of file
page_content += "<li>{}<br>".format(assignment)
return HttpResponse(page_content)
\ No newline at end of file
<html lang="en">
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
<div id="content">
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
...@@ -64,7 +64,7 @@ ROOT_URLCONF = 'widget_k3git.urls' ...@@ -64,7 +64,7 @@ ROOT_URLCONF = 'widget_k3git.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
......
...@@ -3,7 +3,7 @@ from django.urls import include, path ...@@ -3,7 +3,7 @@ from django.urls import include, path
urlpatterns = [ urlpatterns = [
path('announcement/', include('announcement.urls', namespace="announcement")), path('announcement/', include('announcement.urls', namespace="announcement")),
path('widget_calendar/', include('widget_calendar.urls', namespace="widget_calendar")), path('calendar/', include('widget_calendar.urls', namespace="widget_calendar")),
path('assignments/', include('assignments.urls', namespace="assignments")), path('assignments/', include('assignments.urls', namespace="assignments")),
path('dashboard/', include('dashboard.urls', namespace="dashboard")), path('dashboard/', include('dashboard.urls', namespace="dashboard")),
path('forum/', include('forum.urls', namespace="forum")), path('forum/', include('forum.urls', namespace="forum")),
......
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