Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_k3git
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
Stefan Gomez
midterm_k3git
Commits
791103a2
Commit
791103a2
authored
May 07, 2023
by
Nate Brevin A. Que
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the 'Add New Assignment Page'
parent
99e2be94
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
3 deletions
+24
-3
assignment-add.html
...git/assignments/templates/assignments/assignment-add.html
+13
-0
assignments.html
..._k3git/assignments/templates/assignments/assignments.html
+1
-1
urls.py
widget_k3git/assignments/urls.py
+2
-1
views.py
widget_k3git/assignments/views.py
+8
-1
No files found.
widget_k3git/assignments/templates/assignments/assignment-add.html
0 → 100644
View file @
791103a2
{% extends 'base.html' %}
{% block title %}Add Assigment{% endblock %}
{% block content %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save New Assigment"
>
</form>
{% endblock %}
{% block scripts %}
{% endblock %}
\ No newline at end of file
widget_k3git/assignments/templates/assignments/assignments.html
View file @
791103a2
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</h3>
</h3>
{% endblock %}
{% endblock %}
{% block scripts %}
{% block scripts %}
<
input
type=
"submit"
value=
"New Assignment"
><br><br>
<
a
href=
"/assignments/add"
><input
type=
"submit"
value=
"New Assignment"
></a
><br><br>
<a
href=
"/dashboard"
>
Dashboard
</a><br>
<a
href=
"/dashboard"
>
Dashboard
</a><br>
<a
href=
"/announcement"
>
Announcements
</a><br>
<a
href=
"/announcement"
>
Announcements
</a><br>
<a
href=
"/forum"
>
Forum
</a><br>
<a
href=
"/forum"
>
Forum
</a><br>
...
...
widget_k3git/assignments/urls.py
View file @
791103a2
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
,
AssignmentDetailView
from
.views
import
index
,
AssignmentDetailView
,
AssignmentCreateView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
index
,
name
=
'index'
),
path
(
'<int:pk>/details'
,
AssignmentDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'<int:pk>/details'
,
AssignmentDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'add/'
,
AssignmentCreateView
.
as_view
(),
name
=
'add-assignment'
),
]
]
app_name
=
"assignments"
app_name
=
"assignments"
\ No newline at end of file
widget_k3git/assignments/views.py
View file @
791103a2
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
.models
import
Assignment
from
.models
import
Assignment
...
@@ -12,4 +13,10 @@ class AssignmentDetailView(DetailView):
...
@@ -12,4 +13,10 @@ class AssignmentDetailView(DetailView):
model
=
Assignment
model
=
Assignment
def
get
(
self
,
request
,
pk
):
def
get
(
self
,
request
,
pk
):
return
render
(
request
,
'assignments/assignment-details.html'
,
{
'assignment'
:
self
.
model
.
objects
.
get
(
pk
=
pk
)})
return
render
(
request
,
'assignments/assignment-details.html'
,
{
'assignment'
:
self
.
model
.
objects
.
get
(
pk
=
pk
)})
\ No newline at end of file
class
AssignmentCreateView
(
CreateView
):
model
=
Assignment
fields
=
'__all__'
template_name
=
'assignments/assignment-add.html'
\ 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