Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Francoconuts
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Chester Tan
widget_Francoconuts
Commits
aa2c4b30
Commit
aa2c4b30
authored
May 21, 2022
by
AllenSkyy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.discs.ateneo.edu/chesterpogi/widget_Francoconuts
parents
3694283e
9e21456f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
4 deletions
+41
-4
forms.py
widget_Francoconuts/assignments/forms.py
+7
-0
assignment_add.html
...uts/assignments/templates/assignments/assignment_add.html
+10
-0
assignment_detail.html
.../assignments/templates/assignments/assignment_detail.html
+1
-0
course_list.html
...conuts/assignments/templates/assignments/course_list.html
+2
-1
urls.py
widget_Francoconuts/assignments/urls.py
+2
-1
views.py
widget_Francoconuts/assignments/views.py
+19
-2
No files found.
widget_Francoconuts/assignments/forms.py
0 → 100644
View file @
aa2c4b30
from
django.forms
import
ModelForm
from
.views
import
Assignment
class
AssignmentForm
(
ModelForm
):
class
Meta
:
model
=
Assignment
fields
=
'__all__'
\ No newline at end of file
widget_Francoconuts/assignments/templates/assignments/assignment_add.html
0 → 100644
View file @
aa2c4b30
{% extends 'base.html' %}
{% block content %}
<h1>
New Assignment
</h1>
<form
method=
"POST"
>
{% csrf_token %}
{{form.as_p}}
<input
type=
"submit"
value=
"Save Assignment"
>
</form>
<a
href=
"{% url 'assignments' %}"
><button>
Go back
</button></a>
{% endblock content %}
widget_Francoconuts/assignments/templates/assignments/assignment_detail.html
View file @
aa2c4b30
...
@@ -11,3 +11,4 @@
...
@@ -11,3 +11,4 @@
{% load static %}
{% load static %}
<li><img
src=
"{% static 'assignments/chesterC.png' %}"
alt=
"image"
></li>
<li><img
src=
"{% static 'assignments/chesterC.png' %}"
alt=
"image"
></li>
</ul>
</ul>
<a
href=
"{% url 'assignments' %}"
><button>
Go back
</button></a>
\ No newline at end of file
widget_Francoconuts/assignments/templates/assignments/course_list.html
View file @
aa2c4b30
{% extends 'base.html' %}
{% extends 'base.html' %}
{% block content %}
{% block content %}
<h1>
Assignmets Per Course
</h1>
<h1>
Assignme
n
ts Per Course
</h1>
<label>
List of Courses:
</label>
<label>
List of Courses:
</label>
<ul>
<ul>
{% for course in object_list %}
{% for course in object_list %}
...
@@ -13,5 +13,6 @@
...
@@ -13,5 +13,6 @@
{% endfor %}
{% endfor %}
</ul>
</ul>
{% endfor %}
{% endfor %}
<a
href=
"{% url 'assignment-add' %}"
><button>
New Assignment
</button></a>
</ul>
</ul>
{% endblock content %}
{% endblock content %}
\ No newline at end of file
widget_Francoconuts/assignments/urls.py
View file @
aa2c4b30
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
AssignmentDetailView
,
AssignmentListView
from
.views
import
AssignmentDetailView
,
AssignmentListView
,
assignmentCreate
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
AssignmentListView
.
as_view
(),
name
=
'assignments'
),
path
(
''
,
AssignmentListView
.
as_view
(),
name
=
'assignments'
),
path
(
'<int:pk>/details/'
,
AssignmentDetailView
.
as_view
(),
name
=
'assignment-detail'
),
path
(
'<int:pk>/details/'
,
AssignmentDetailView
.
as_view
(),
name
=
'assignment-detail'
),
path
(
'add/'
,
assignmentCreate
,
name
=
'assignment-add'
),
]
]
\ No newline at end of file
widget_Francoconuts/assignments/views.py
View file @
aa2c4b30
from
django.shortcuts
import
render
from
django.shortcuts
import
render
,
redirect
from
.models
import
Assignment
,
Course
from
.models
import
Assignment
,
Course
from
django.views.generic.detail
import
DetailView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
from
.forms
import
AssignmentForm
class
AssignmentListView
(
ListView
):
class
AssignmentListView
(
ListView
):
model
=
Course
model
=
Course
...
@@ -13,3 +15,18 @@ class AssignmentListView(ListView):
...
@@ -13,3 +15,18 @@ class AssignmentListView(ListView):
class
AssignmentDetailView
(
DetailView
):
class
AssignmentDetailView
(
DetailView
):
model
=
Assignment
model
=
Assignment
def
assignmentCreate
(
request
):
form
=
AssignmentForm
()
context
=
{
'form'
:
form
,
}
if
request
.
method
==
'POST'
:
form
=
AssignmentForm
(
request
.
POST
)
if
form
.
is_valid
():
form
.
save
()
return
redirect
(
'/assignments'
)
return
render
(
request
,
'assignments/assignment_add.html'
,
context
)
\ 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