Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
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
Angelico Ruiz T. Teaño
widget_Alipins
Commits
3baf6e19
Commit
3baf6e19
authored
May 09, 2022
by
Angelico Ruiz T. Teaño
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add details of assignments in respective pages
parent
3f697072
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
7 deletions
+30
-7
detail.html
widget_alipins/assignments/templates/assignments/detail.html
+18
-0
index.html
widget_alipins/assignments/templates/assignments/index.html
+1
-1
urls.py
widget_alipins/assignments/urls.py
+3
-2
views.py
widget_alipins/assignments/views.py
+8
-4
No files found.
widget_alipins/assignments/templates/assignments/detail.html
0 → 100644
View file @
3baf6e19
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
{{assignment.name}} | {{assignment.course.course_code}}
</title>
</head>
<body>
<h1>
Course/Section: {{assignment.course.course_code}} | {{assignment.course.course_title}} - {{assignment.course.section}}
</h1>
<h2>
Assignment Name: {{assignment.name}}
</h2>
<p>
Description: {{assignment.description}}
<br>
Perfect Score: {{assignment.max_points}}
<br>
Passing Score: {{assignment.passing_score}}
<br>
</p>
</body>
</html>
\ No newline at end of file
widget_alipins/assignments/templates/assignments/index.html
View file @
3baf6e19
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
{% for assignment in assignment_list %}
{% for assignment in assignment_list %}
{% if assignment.course.course_code == course.course_code %}
{% if assignment.course.course_code == course.course_code %}
<ul>
<ul>
<li><a
href=
"
/assignments/{{assignment.id}}/details
"
>
{{assignment.name}}
</a></li>
<li><a
href=
"
{% url 'assignments:details' assignment.id %}
"
>
{{assignment.name}}
</a></li>
</ul>
</ul>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
...
...
widget_alipins/assignments/urls.py
View file @
3baf6e19
...
@@ -2,7 +2,8 @@ from django.urls import path
...
@@ -2,7 +2,8 @@ from django.urls import path
from
.
import
views
from
.
import
views
app_name
=
"assignments"
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
"index
Assignments
"
),
path
(
''
,
views
.
index
,
name
=
"index"
),
path
(
'<int:assignment_id>/details'
,
views
.
detail
,
name
=
"detail
"
)
path
(
'<int:assignment_id>/details'
,
views
.
detail
s
,
name
=
"details
"
)
]
]
\ No newline at end of file
widget_alipins/assignments/views.py
View file @
3baf6e19
from
ast
import
Assign
from
ast
import
Assign
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
.models
import
Assignment
,
Course
from
.models
import
Assignment
,
Course
...
@@ -15,6 +15,10 @@ def index(request):
...
@@ -15,6 +15,10 @@ def index(request):
return
render
(
request
,
"assignments/index.html"
,
context
)
return
render
(
request
,
"assignments/index.html"
,
context
)
def
detail
(
request
,
assignment_id
):
def
details
(
request
,
assignment_id
):
output
=
"These are the details for assignment #
%
s."
%
assignment_id
try
:
return
HttpResponse
(
output
)
assignment
=
Assignment
.
objects
.
get
(
pk
=
assignment_id
)
\ No newline at end of file
except
Assignment
.
DoesNotExist
:
raise
Http404
(
"Assignment does not exist!"
)
return
render
(
request
,
"assignments/detail.html"
,
{
"assignment"
:
assignment
})
\ No newline at end of file
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