Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_nicsbabes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nics De Vega
midterm_nicsbabes
Commits
ed4e7984
Commit
ed4e7984
authored
May 11, 2023
by
rachbit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added assignment templates, edited assignment views
parent
cd772cb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
19 deletions
+36
-19
assignments.html
...sbabes/assignments/templates/assignments/assignments.html
+33
-0
views.py
widget_nicsbabes/assignments/views.py
+3
-19
No files found.
widget_nicsbabes/assignments/templates/assignments/assignments.html
0 → 100644
View file @
ed4e7984
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Assignments{% endblock %}
{% block content %}
<i><h1>
Welcome to Widget's Assignments!
</h1></i>
{% for assignments in assignments %}
<p><strong>
<a
href=
"{{ assignments.get_absolute_url }}"
>
<li>
{{ assignments.name }}
</li>
</a>
</strong></p>
{% endfor %}
<br><br>
<a
href=
"#"
>
<button
type=
"button"
><p>
New Assignment
</p></button>
</a>
<br><br><br>
{# the links to other html files #}
<div
class =
links
>
<a
href=
"../dashboard/"
>
Dashboard
</a><br>
<a
href=
"../announcements/"
>
Announcements
</a><br>
<a
href=
"../forum/"
>
Forum
</a><br>
<a
href=
"../calendar/"
>
Calendar
</a><br>
</div>
{% endblock %}
widget_nicsbabes/assignments/views.py
View file @
ed4e7984
...
@@ -3,22 +3,6 @@ from django.http import HttpResponse
...
@@ -3,22 +3,6 @@ from django.http import HttpResponse
from
.models
import
Assignment
,
Course
from
.models
import
Assignment
,
Course
def
index
(
request
):
def
index
(
request
):
assignments
=
Assignment
.
objects
.
all
()
return_string
=
'<body>'
args
=
{
'assignments'
:
assignments
}
for
assignment
in
Assignment
.
objects
.
all
():
return
render
(
request
,
'assignments/assignments.html'
,
args
)
assignment_details
=
'Assignment Name: {}<br>Description: {}<br>Perfect Score: {}<br> Passing Score: {}<br>Course/Section: {} {}-{}<br>'
.
format
(
assignment
.
name
,
assignment
.
description
,
assignment
.
perfect_score
,
assignment
.
passing_score
(),
assignment
.
course
.
code
,
assignment
.
course
.
title
,
assignment
.
course
.
section
)
return_string
+=
assignment_details
+
'<br>'
html_string
=
'<html>{}</html>'
.
format
(
return_string
)
return
HttpResponse
(
'Widget
\'
s Assignments Page<br><br>'
+
html_string
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment