Commit 50285c48 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

merge

parents a5c8cc44 955b9e12
...@@ -10,7 +10,7 @@ class Course(models.Model): ...@@ -10,7 +10,7 @@ class Course(models.Model):
class Assignment(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="") description = models.TextField(default="")
perfect_score = models.IntegerField(default=100) perfect_score = models.IntegerField(default=100)
passing_score = models.IntegerField(default=80) 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> <head>
<link rel="stylesheet" href="templates/makeItBeautiful.css"> <link rel="stylesheet" href="{% static '/makeItBeautiful.css' %}">
<title>{% block webTitle %}{% endblock %}</title> <title>{% block webTitle %}{% endblock %}</title>
</head> </head>
<body> <body>
<div class="pageTitle"> <h1 class="pageTitle"> {% block pageTitle %}{% endblock %} </h1> </div> <div class="pageTitle"> <h1 class="pageTitle"> {% block pageTitle %}{% endblock %} </h1> </div>
<br><br><br>
<div class="content"> <div class="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
<div class="navButtons"> <div class="navButtons">
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
{% block pageTitle %} Add a new assignment {% endblock %} {% block pageTitle %} Add a new assignment {% endblock %}
{% block content %} {% block content %}
<form id="editBook" method="post"> <form id="addAssignment" method="post">
<b>
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
</b>
<input type="submit" id="submitButton" value="Add assignment">
</form> </form>
{% endblock %} {% endblock %}
{% block otherButtons %} {% block otherButtons %}
<button class="buttonLink" form="addAssignment" onclick="window.location.href='assignments/';"> <b> Add assignment </b> </button>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
{% block pageTitle %} {{object.assignment_name}} {% endblock %} {% block pageTitle %} {{object.assignment_name}} {% endblock %}
{% block content %} {% block content %}
<h2> {{object.course}} </h2> <h2> {{object.course}} - {{object.section}} </h2>
<p> Description: {{object.description}} <br> <p> <b>Description:</b> {{object.description}} <br>
Perfect Score: {{object.perfect_score}} <br> <b>Perfect Score:</b> {{object.perfect_score}} <br>
Passing Score: {{object.passing_score}} <br> <b>Passing Score:</b> {{object.passing_score}} <br>
</p> </p>
{% endblock %} {% endblock %}
{% block otherButtons %} {% 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 %} {% endblock %}
\ No newline at end of file
...@@ -5,14 +5,15 @@ ...@@ -5,14 +5,15 @@
{% block pageTitle %} Edit Assignment {% endblock %} {% block pageTitle %} Edit Assignment {% endblock %}
{% block content %} {% block content %}
<form id="editBook" method="post"> <form id="editAssignment" method="post">
<b>
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
</b>
<input type="submit" id="submitButton" value="Edit assignment">
</form> </form>
{% endblock %} {% endblock %}
{% block otherButtons %} {% block otherButtons %}
<button class="buttonLink" form="editAssignment" onclick="window.location.href='assignments/';"> <b>Save changes to assignment</b> </button>
{% endblock %} {% endblock %}
\ No newline at end of file
{% extends 'base.html' %} {% 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 %} {% block content %}
<ul style='list-style-type:square;'> <ul style='list-style-type:square;'>
...@@ -13,11 +13,9 @@ ...@@ -13,11 +13,9 @@
{% endblock %} {% endblock %}
{% block otherButtons %} {% block otherButtons %}
<div class="content"> <button class="buttonLink" onclick="window.location.href='add/';"> <b>New Assignment</b> </button><br><br>
<a class="buttonLink" href="add/"> New Assignments </a> <br>
<a class="miniLink" href="/dashboard"> Dashboard </a> <br> <a class="miniLink" href="/dashboard"> Dashboard </a> <br>
<a class="miniLink" href="/announcementBoard"> Announcements </a> <br> <a class="miniLink" href="/announcementBoard"> Announcements </a> <br>
<a class="miniLink" href="/forum"> Forum </a> <br> <a class="miniLink" href="/forum"> Forum </a> <br>
<a class="miniLink" href="/widget_calendar"> Calendar </a> <br> <a class="miniLink" href="/widget_calendar"> Calendar </a> <br>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
from django.urls import path from django.urls import path
from .views import homeAssignmentsPage, AssignmentsDetailView, AssignmentsUpdateView, AssignmentsCreateView from .views import homeAssignmentsPage, AssignmentsDetailView, AssignmentsUpdateView, AssignmentsCreateView
urlpatterns = [ urlpatterns = [
path('', homeAssignmentsPage, name='homePage'), path('', homeAssignmentsPage, name='homePage'),
path('add/', AssignmentsCreateView.as_view(), name='assignment_add'), path('add/', AssignmentsCreateView.as_view(), name='assignment_add'),
......
...@@ -20,7 +20,7 @@ class AssignmentsDetailView(DetailView): ...@@ -20,7 +20,7 @@ class AssignmentsDetailView(DetailView):
class AssignmentsUpdateView(UpdateView): class AssignmentsUpdateView(UpdateView):
model = Assignment model = Assignment
fields = "__all__" fields = ["assignment_name","description","course","perfect_score" ]
template_name = "templates/assignment-edit.html" template_name = "templates/assignment-edit.html"
success_url = "../details" success_url = "../details"
...@@ -28,7 +28,7 @@ class AssignmentsUpdateView(UpdateView): ...@@ -28,7 +28,7 @@ class AssignmentsUpdateView(UpdateView):
class AssignmentsCreateView(CreateView): class AssignmentsCreateView(CreateView):
model = Assignment model = Assignment
fields = "__all__" fields = ["assignment_name","description","course","perfect_score" ]
template_name = "templates/assignment-add.html" template_name = "templates/assignment-add.html"
def get_success_url(self): def get_success_url(self):
......
...@@ -126,6 +126,7 @@ USE_TZ = True ...@@ -126,6 +126,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.2/howto/static-files/ # https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field # 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