Commit 42c76236 authored by Albert Gagalac's avatar Albert Gagalac

implemented assignment-edit.html features + fixed some buttons for...

implemented assignment-edit.html features + fixed some buttons for assignment-detail.html and assignment-add.html
parent 7b4fc362
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
Description: <br> {{form.description}}<br><br> Description: <br> {{form.description}}<br><br>
Course: {{form.course}}<br><br> Course: {{form.course}}<br><br>
Perfect Score: {{form.perfect_score}}<br><br> Perfect Score: {{form.perfect_score}}<br><br>
<input type="submit" value="Add Assignment"> <input type="submit" value="Save New Assignment">
</form> </form>
</p> </p>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -9,4 +9,8 @@ ...@@ -9,4 +9,8 @@
Perfect Score: {{assignment.perfect_score}}<br> Perfect Score: {{assignment.perfect_score}}<br>
Passing Score: {{assignment.passing_score}}<br> Passing Score: {{assignment.passing_score}}<br>
</p> </p>
<form action='edit'>
<input type="submit" value="Edit Assignment"/>
</form>
{% endblock %} {% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Assignment {% endblock %}
{% block content %}
<h2>Edit Assignments:</h2>
<p>
<form action='' method="POST">
{% csrf_token %}
Name: {{form.name}}<br><br>
Description: <br> {{form.description}}<br><br>
Course: {{form.course}}<br><br>
Perfect Score: {{form.perfect_score}}<br><br>
<input type="submit" value="Save Changes to Assignment">
</form>
</p>
{% endblock %}
\ No newline at end of file
from django.urls import path from django.urls import path
from .views import pageview, AssignmentDetailView, AssignmentCreateView from .views import pageview, AssignmentDetailView, AssignmentCreateView, AssignmentEditView
urlpatterns = [ urlpatterns = [
path('', pageview, name='pageview'), path('', pageview, name='pageview'),
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='assignment-add'), path('add', AssignmentCreateView.as_view(), name='assignment-add'),
path('<int:pk>/edit', AssignmentEditView.as_view(), name='assignment-edit'),
] ]
app_name = "assignments" app_name = "assignments"
\ No newline at end of file
...@@ -21,3 +21,8 @@ class AssignmentCreateView(CreateView): ...@@ -21,3 +21,8 @@ class AssignmentCreateView(CreateView):
fields = '__all__' fields = '__all__'
template_name = 'assignments/assignment-add.html' template_name = 'assignments/assignment-add.html'
class AssignmentEditView(UpdateView):
model = Assignment
fields = '__all__'
template_name = 'assignments/assignment-edit.html'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment