Commit 955b9e12 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

Merge branch 'assignmentsv2_frontendstuff' into 'assignmentsv2'

Assignmentsv2 frontendstuff

See merge request !12
parents 4530a0fb 1f223763
......@@ -10,7 +10,7 @@ class Course(models.Model):
class Assignment(models.Model):
assignment_name = models.CharField(unique=True, default="", max_length=50,)
assignment_name = models.CharField("Name", unique=True, default="", max_length=50,)
description = models.TextField(default="")
perfect_score = models.IntegerField(default=100)
passing_score = models.IntegerField(default=80)
......
body {
background-color:rgb(167, 36, 75)
}
div.pageTitle{
text-align: center;
background-color: rgb(214, 255, 246);
margin-left: 20%;
margin-right: 20%;
padding-top: 10px;
padding-bottom: 15px;
border-radius: 0.5cm;
border-width: 15px;
border-style:groove double;
border-color: rgb(138, 0, 0);
box-shadow: 0px 20px 40px 0px rgb(65, 2, 23),
0px 0px 40px 0px rgb(175, 212, 204) inset;
}
h1.pageTitle{
font-family: Helvetica;
font-size: 40pt;
}
div.content{
background-color: rgb(214, 255, 246);
margin-left: 30%;
margin-right: 30%;
padding-top: 10px;
padding-left: 5%;
padding-right: 5%;
padding-bottom: 15px;
border-radius: 10px;
border-width: 9px;
border-style: outset;
border-color: rgb(138, 0, 0);
box-shadow: 0px 20px 40px 0px rgb(65, 2, 23);
}
li{
background-color: rgb(214, 255, 246);
font-size: 14pt;
transition: all 0.5s;
}
li:hover{
background-color: rgb(255, 209, 228);
font-size: 20pt;
transition: all 0.5s;
}
div.navButtons{
background-color: rgb(255, 248, 238);
border-radius: 5px;
border-width: 12px;
border-style: ridge;
border-color: rgb(167, 16, 66) ;
text-align: left;
margin-right: 50%;
padding: 15px;
}
button.buttonLink{
padding: 15px;
font-size: 12pt;
scale: 100%;
background-color: rgb(5, 233, 157);
}
button.buttonLink:hover{
background-color: aquamarine;
scale: 105%;
transition: all 100ms;
}
button.buttonLink:active{
background-color: rgb(201, 226, 218);
}
label {
width: 180px;
}
textarea{
vertical-align: top;
}
\ No newline at end of file
{% load static %}
<head>
<link rel="stylesheet" href="templates/makeItBeautiful.css">
<link rel="stylesheet" href="{% static '/makeItBeautiful.css' %}">
<title>{% block webTitle %}{% endblock %}</title>
</head>
<body>
<div class="pageTitle"> <h1 class="pageTitle"> {% block pageTitle %}{% endblock %} </h1> </div>
<br><br><br>
<div class="content">
{% block content %}{% endblock %}
<div class="navButtons">
......
......@@ -5,14 +5,14 @@
{% block pageTitle %} Add a new assignment {% endblock %}
{% block content %}
<form id="editBook" method="post">
<form id="addAssignment" method="post">
<b>
{% csrf_token %}
{{ form.as_p }}
<input type="submit" id="submitButton" value="Add assignment">
</b>
</form>
{% endblock %}
{% block otherButtons %}
<button class="buttonLink" form="addAssignment" onclick="window.location.href='assignments/';"> <b> Add assignment </b> </button>
{% endblock %}
\ No newline at end of file
......@@ -5,13 +5,13 @@
{% block pageTitle %} {{object.assignment_name}} {% endblock %}
{% block content %}
<h2> {{object.course}} </h2>
<p> Description: {{object.description}} <br>
Perfect Score: {{object.perfect_score}} <br>
Passing Score: {{object.passing_score}} <br>
<h2> {{object.course}} - {{object.section}} </h2>
<p> <b>Description:</b> {{object.description}} <br>
<b>Perfect Score:</b> {{object.perfect_score}} <br>
<b>Passing Score:</b> {{object.passing_score}} <br>
</p>
{% endblock %}
{% block otherButtons %}
<a class="buttonLink" href="../edit"> Edit Assignment </a>
<button class="buttonLink" onclick="window.location.href='../../{{ object.get_absolute_url }}/edit';"> <b>Edit Assignment</b> </button>
{% endblock %}
\ No newline at end of file
......@@ -5,14 +5,15 @@
{% block pageTitle %} Edit Assignment {% endblock %}
{% block content %}
<form id="editBook" method="post">
<form id="editAssignment" method="post">
<b>
{% csrf_token %}
{{ form.as_p }}
<input type="submit" id="submitButton" value="Edit assignment">
</b>
</form>
{% endblock %}
{% block otherButtons %}
<button class="buttonLink" form="editAssignment" onclick="window.location.href='assignments/';"> <b>Save changes to assignment</b> </button>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block webTitle %} Assignments {% endblock %}
{% block webTitle %} Widget's Assignments {% endblock %}
{% block pageTitle %} Assignments {% endblock %}
{% block pageTitle %} Welcome to Widget's assignments {% endblock %}
{% block content %}
<ul style='list-style-type:square;'>
......@@ -13,11 +13,9 @@
{% endblock %}
{% block otherButtons %}
<div class="content">
<a class="buttonLink" href="add/"> New Assignments </a> <br>
<a class="miniLink" href="/dashboard"> Dashboard </a> <br>
<a class="miniLink" href="/announcementBoard"> Announcements </a> <br>
<a class="miniLink" href="/forum"> Forum </a> <br>
<a class="miniLink" href="/widget_calendar"> Calendar </a> <br>
</div>
<button class="buttonLink" onclick="window.location.href='add/';"> <b>New Assignment</b> </button><br><br>
<a class="miniLink" href="/dashboard"> Dashboard </a> <br>
<a class="miniLink" href="/announcementBoard"> Announcements </a> <br>
<a class="miniLink" href="/forum"> Forum </a> <br>
<a class="miniLink" href="/widget_calendar"> Calendar </a> <br>
{% endblock %}
\ No newline at end of file
from django.urls import path
from .views import homeAssignmentsPage, AssignmentsDetailView, AssignmentsUpdateView, AssignmentsCreateView
urlpatterns = [
path('', homeAssignmentsPage, name='homePage'),
path('add/', AssignmentsCreateView.as_view(), name='assignment_add'),
......
......@@ -20,7 +20,7 @@ class AssignmentsDetailView(DetailView):
class AssignmentsUpdateView(UpdateView):
model = Assignment
fields = "__all__"
fields = ["assignment_name","description","course","perfect_score" ]
template_name = "templates/assignment-edit.html"
success_url = "../details"
......@@ -28,7 +28,7 @@ class AssignmentsUpdateView(UpdateView):
class AssignmentsCreateView(CreateView):
model = Assignment
fields = "__all__"
fields = ["assignment_name","description","course","perfect_score" ]
template_name = "templates/assignment-add.html"
def get_success_url(self):
......
......@@ -126,6 +126,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
......
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