Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
7d25b585
Commit
7d25b585
authored
Apr 29, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assignment-details.html is done
parent
dfad8189
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
19 deletions
+35
-19
base.html
widget_vincentdjango/assignments/templates/base.html
+8
-4
assignment-details.html
...o/assignments/templates/templates/assignment-details.html
+15
-0
urls.py
widget_vincentdjango/assignments/urls.py
+3
-1
views.py
widget_vincentdjango/assignments/views.py
+9
-14
No files found.
widget_vincentdjango/assignments/templates/base.html
View file @
7d25b585
<head>
<link
rel=
"stylesheet"
href=
"makeItBeautiful.css"
>
<link
rel=
"stylesheet"
href=
"
templates/
makeItBeautiful.css"
>
<title>
{% block webTitle %}{% endblock %}
</title>
</head>
<body>
{% block pageTitle %}{% endblock %}
{% block content %}{% endblock %}
{% block otherButtons %} {% endblock %}
<div
class=
"pageTitle"
>
<h1
class=
"pageTitle"
>
{% block pageTitle %}{% endblock %}
</h1>
</div>
<div
class=
"content"
>
{% block content %}{% endblock %}
<div
class=
"navButtons"
>
{% block otherButtons %} {% endblock %}
</div>
</div>
</body>
\ No newline at end of file
widget_vincentdjango/assignments/templates/templates/assignment-details.html
0 → 100644
View file @
7d25b585
{% extends 'base.html' %}
{% block webTitle %} {{object.assignment_name}} {% endblock %}
{% block pageTitle %} {{object.assignment_name}} {% endblock %}
{% block content %}
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
id=
"submitButton"
value=
"Submit"
>
{% endblock %}
{% block otherButtons %}
{% endblock %}
\ No newline at end of file
widget_vincentdjango/assignments/urls.py
View file @
7d25b585
from
django.urls
import
path
from
.views
import
homeAssignmentsPage
from
.views
import
homeAssignmentsPage
,
AssignmentsDetailView
urlpatterns
=
[
path
(
''
,
homeAssignmentsPage
,
name
=
'homePage'
),
path
(
'<int:pk>/details/'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment_details'
)
]
...
...
widget_vincentdjango/assignments/views.py
View file @
7d25b585
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.http
import
HttpResponse
from
.models
import
Assignment
def
homeAssignmentsPage
(
request
):
starter
=
"{
%
block content
%
}
\
<div class='content'>
\
<ul style='list-style-type:square;'>
\n
"
middle
=
""
for
assignment
in
Assignment
.
objects
.
all
():
middle
=
middle
+
"<li> <div class='assignmentLink'>
\
<a href='"
+
str
(
assignment
.
get_absolute_url
)
+
"'/details>"
+
str
(
assignment
.
assignment_name
)
+
" </a> </div> </li>"
ender
=
"</ul>
\
</div>
\
{
%
endblock
%
}"
output
=
starter
+
middle
+
ender
return
render
(
request
,
'templates/assignments.html'
,
{
"addition"
:
output
})
return
render
(
request
,
'templates/assignments.html'
,
{
"assignmentsList"
:
Assignment
.
objects
.
all
()})
class
AssignmentsDetailView
(
DetailView
):
model
=
Assignment
template_name
=
"templates/assignment-details.html"
pass
def
index
(
request
):
...
...
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