Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group22
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
John Tamano
widget_group22
Commits
65bd7cd8
Commit
65bd7cd8
authored
May 06, 2022
by
Juan Gabriel M. Lacanienta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lacanienta/assignments'
parents
b6ec031e
3ad13800
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
19 deletions
+86
-19
style.css
widget_group22/assignments/static/assignments/style.css
+28
-0
3.jpg
widget_group22/assignments/static/images/3.jpg
+0
-0
4.jpg
widget_group22/assignments/static/images/4.jpg
+0
-0
5.jpg
widget_group22/assignments/static/images/5.jpg
+0
-0
assignments.html
...roup22/assignments/templates/assignments/assignments.html
+15
-0
base.html
widget_group22/assignments/templates/assignments/base.html
+15
-0
details.html
...et_group22/assignments/templates/assignments/details.html
+11
-0
urls.py
widget_group22/assignments/urls.py
+3
-2
views.py
widget_group22/assignments/views.py
+14
-17
No files found.
widget_group22/assignments/static/assignments/style.css
0 → 100644
View file @
65bd7cd8
h1
{
color
:
purple
;
font-weight
:
bold
;
font-family
:
"Gill Sans"
,
sans-serif
;
}
h3
{
color
:
indigo
;
font-family
:
"Gill Sans"
,
sans-serif
;
}
p
{
color
:
red
;
font-weight
:
lighter
;
font-family
:
"Gill Sans"
,
sans-serif
;
}
body
{
color
:
black
;
background-color
:
orange
;
font-family
:
"Gill Sans"
,
sans-serif
;
}
a
{
color
:
blue
;
font-weight
:
bold
;
font-family
:
"Gill Sans"
,
sans-serif
;
}
widget_group22/assignments/static/images/3.jpg
0 → 100644
View file @
65bd7cd8
99.4 KB
widget_group22/assignments/static/images/4.jpg
0 → 100644
View file @
65bd7cd8
856 KB
widget_group22/assignments/static/images/5.jpg
0 → 100644
View file @
65bd7cd8
280 KB
widget_group22/assignments/templates/assignments/assignments.html
0 → 100644
View file @
65bd7cd8
{% extends "assignments/base.html" %}
{% block content %}
<center><h1>
Assignments Per Course
</h1></center>
<h3>
List of courses:
</h3>
{% for course in all_courses %}
<li><b>
{{course.course_code}}
</b>
<i>
{{course.course_title}}
</i>
{{course.section}}
</li>
{% for assignment in all_assignments %}
{% if assignment.course.id == course.id %}
<ul><li><a
href=
"{% url 'assignments:details' assignment.id %}"
>
{{assignment.name}}
</a></li></ul>
{% endif %}
{% endfor %}
{% endfor %}
{% endblock %}
widget_group22/assignments/templates/assignments/base.html
0 → 100644
View file @
65bd7cd8
{% load static %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'assignments/style.css' %}"
<!
DOCTYPE
html
>
<html
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<style>
</style>
<body>
{% block content %}
{% endblock %}
</body>
</html>
widget_group22/assignments/templates/assignments/details.html
0 → 100644
View file @
65bd7cd8
{% extends "assignments/base.html" %}
{% block content %}
<li><b>
{{assignment.course.course_code}}
</b>
<i>
{{assignment.course.course_title}}
</i>
{{assignment.course.section}}
</li>
<li><b><u>
{{assignment.name}}
</u></b></li>
<li><b>
Description:
</b>
{{assignment.description}}
</li>
<li><b>
Perfect score:
</b>
{{assignment.max_points}}
</li>
<li><b>
Passing score:
</b>
{{assignment.passing_score}}
</li>
<center>
{% load static %}
<img
src=
"{% static img %}"
style=
"width:500px;"
/></center>
{% endblock %}
widget_group22/assignments/urls.py
View file @
65bd7cd8
from
django.urls
import
path
from
django.urls
import
path
from
.
views
import
assignment
s
from
.
import
view
s
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
assignments
,
name
=
'assignments'
)
path
(
''
,
views
.
assignments
,
name
=
'assignments'
),
path
(
"<int:assignment_id>/details/"
,
views
.
details
,
name
=
'details'
)
]
]
app_name
=
'assignments'
app_name
=
'assignments'
widget_group22/assignments/views.py
View file @
65bd7cd8
...
@@ -9,22 +9,19 @@ def index(request):
...
@@ -9,22 +9,19 @@ def index(request):
return
HttpResponse
(
"This is the Assignments page!"
)
return
HttpResponse
(
"This is the Assignments page!"
)
def
assignments
(
request
):
def
assignments
(
request
):
all_assignments
=
models
.
Assignment
.
objects
.
all
()
all_assignments
=
models
.
Assignment
.
objects
.
order_by
(
"name"
)
all_courses
=
models
.
Course
.
objects
.
order_by
(
"course_code"
)
context
=
{
"all_assignments"
:
all_assignments
,
"all_courses"
:
all_courses
}
output
=
""
return
render
(
request
,
"assignments/assignments.html"
,
context
)
for
a
in
all_assignments
:
def
details
(
request
,
assignment_id
):
name
=
a
.
name
assignment
=
models
.
Assignment
.
objects
.
get
(
pk
=
assignment_id
)
desc
=
a
.
description
context
=
{
pfscore
=
str
(
a
.
max_points
)
"assignment"
:
assignment
,
psscore
=
str
(
a
.
passing_score
)
"img"
:
"images/"
+
str
(
assignment_id
)
+
".jpg"
ccode
=
a
.
course
.
course_code
}
ctitle
=
a
.
course
.
course_title
return
render
(
request
,
"assignments/details.html"
,
context
)
csection
=
a
.
course
.
section
record
=
(
"Assignment Name: "
+
name
+
"<br>Description: "
+
desc
+
"<br>Perfect Score: "
+
pfscore
+
"<br>Passing Score: "
+
psscore
+
"<br>Course/Section: "
+
ccode
+
" "
+
ctitle
+
" "
+
csection
)
output
+=
record
+
"<br><br>"
return
HttpResponse
(
'<h1>ASSIGNMENTS: </h1>'
+
output
)
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