Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_nicsbabes
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
Nics De Vega
midterm_nicsbabes
Commits
aeb3a963
Commit
aeb3a963
authored
May 11, 2023
by
rachbit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created assignment-add and assignment-edit
parent
ab553878
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
3 deletions
+41
-3
models.py
widget_nicsbabes/assignments/models.py
+1
-1
assignment-add.html
...bes/assignments/templates/assignments/assignment-add.html
+13
-0
assignment-details.html
...assignments/templates/assignments/assignment-details.html
+1
-1
assignment-edit.html
...es/assignments/templates/assignments/assignment-edit.html
+13
-0
assignments.html
...sbabes/assignments/templates/assignments/assignments.html
+1
-1
urls.py
widget_nicsbabes/assignments/urls.py
+2
-0
views.py
widget_nicsbabes/assignments/views.py
+10
-0
No files found.
widget_nicsbabes/assignments/models.py
View file @
aeb3a963
...
@@ -8,7 +8,7 @@ class Course(models.Model):
...
@@ -8,7 +8,7 @@ class Course(models.Model):
section
=
models
.
CharField
(
max_length
=
3
)
section
=
models
.
CharField
(
max_length
=
3
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}
'
.
format
(
self
.
code
)
return
'{}
- {}'
.
format
(
self
.
code
,
self
.
section
)
class
Assignment
(
models
.
Model
):
class
Assignment
(
models
.
Model
):
...
...
widget_nicsbabes/assignments/templates/assignments/assignment-add.html
0 → 100644
View file @
aeb3a963
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Assignment {% endblock %}
{% block content %}
<h1>
Add Assignment:
</h1>
<form
method=
"post"
>
{% csrf_token %}
{{form.as_p}}
<input
type=
"submit"
value=
"Save New Assignment"
>
</form>
<br>
{% endblock %}
widget_nicsbabes/assignments/templates/assignments/assignment-details.html
View file @
aeb3a963
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</div>
</div>
<br>
<br>
<a
href=
"
../#/
"
>
<a
href=
"
edit
"
>
<button
type=
"button"
><p>
Edit Assignment
</p></button>
<button
type=
"button"
><p>
Edit Assignment
</p></button>
</a>
</a>
{% endblock %}
{% endblock %}
widget_nicsbabes/assignments/templates/assignments/assignment-edit.html
0 → 100644
View file @
aeb3a963
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Assignment {% endblock %}
{% block content %}
<h1>
Edit Assignment:
</h1>
<form
method=
"post"
>
{% csrf_token %}
{{form.as_p}}
<input
type=
"submit"
value=
"Save Changes to Assignment"
>
</form>
<br>
{% endblock %}
widget_nicsbabes/assignments/templates/assignments/assignments.html
View file @
aeb3a963
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
{% endfor %}
{% endfor %}
<br><br>
<br><br>
<a
href=
"
#
"
>
<a
href=
"
add
"
>
<button
type=
"button"
><p>
New Assignment
</p></button>
<button
type=
"button"
><p>
New Assignment
</p></button>
</a>
</a>
...
...
widget_nicsbabes/assignments/urls.py
View file @
aeb3a963
...
@@ -4,6 +4,8 @@ from .views import *
...
@@ -4,6 +4,8 @@ from .views import *
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
index
,
name
=
'index'
),
path
(
'<int:pk>/details'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'<int:pk>/details'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'<int:pk>/edit'
,
AssignmentsUpdateView
.
as_view
(),
name
=
'assignment-edit'
),
path
(
'add'
,
AssignmentsCreateView
.
as_view
(),
name
=
'assignment-add'
),
]
]
# This might be needed, depending on your Django version
# This might be needed, depending on your Django version
...
...
widget_nicsbabes/assignments/views.py
View file @
aeb3a963
...
@@ -15,3 +15,13 @@ class AssignmentsView(ListView):
...
@@ -15,3 +15,13 @@ class AssignmentsView(ListView):
class
AssignmentsDetailView
(
DetailView
):
class
AssignmentsDetailView
(
DetailView
):
model
=
Assignment
model
=
Assignment
template_name
=
'assignments/assignment-details.html'
template_name
=
'assignments/assignment-details.html'
class
AssignmentsUpdateView
(
UpdateView
):
model
=
Assignment
fields
=
"__all__"
template_name
=
'assignments/assignment-edit.html'
class
AssignmentsCreateView
(
CreateView
):
model
=
Assignment
fields
=
"__all__"
template_name
=
'assignments/assignment-add.html'
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