diff --git a/CodeReview/load_env.py b/CodeReview/load_env.py
index 09e0ebc..4c64a58 100644
--- a/CodeReview/load_env.py
+++ b/CodeReview/load_env.py
@@ -1,5 +1,5 @@
"""
- This file s used to load environment variables from a powershell file
+ This file is used to load environment variables from a powershell file
"""
import os
diff --git a/CodeReview/settings.py b/CodeReview/settings.py
index 3662034..1305f2d 100644
--- a/CodeReview/settings.py
+++ b/CodeReview/settings.py
@@ -20,7 +20,6 @@ DEBUG = STAGE != "Prod"
# This option is used in encryption, if we're debugging, we don't care that people know what it is
# But, if we're in Production, we'll load the key from the environment
-# noinspection SpellCheckingInspection
SECRET_KEY = 'django-insecure-1&=3d#^^j*!8)r5y8tuh(t#rp6*(jwbx%90k-ir5c*2j4$s$o%' if DEBUG else os.getenv("SECRET_KEY")
# This option defines what url someone can type in to access this site. If we're debugging, it doesn't matter
@@ -81,7 +80,7 @@ WSGI_APPLICATION = 'CodeReview.wsgi.application'
# This next block of code defines how our database will work and what database system will work
if STAGE == "Prod":
- # In production, we use MySQl as our database backend
+ # In production, we use MySQL as our database backend
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
@@ -113,29 +112,15 @@ else:
}
}
-# This option defines what password validation functions to use
-AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
-]
-
# This option defines what backends we use for authentication
if DEBUG:
+ # If we're in development, we add django's model backend so that way we can debug
AUTHENTICATION_BACKENDS = [
'Users.ldap_auth.LDAPAuthentication',
'django.contrib.auth.backends.ModelBackend',
]
else:
+ # If we're in production, we only want to allow authentication through LDAP
AUTHENTICATION_BACKENDS = [
'Users.ldap_auth.LDAPAuthentication',
]
@@ -192,7 +177,7 @@ USE_I18N = False
USE_L10N = False
USE_TZ = False
-# These options define urls for static urls
+# These options define urls and folders for static files
STATIC_URL = '/static/'
STATIC_ROOT = os.getenv("STATIC_DIR", "collected-static")
@@ -200,7 +185,7 @@ STATIC_ROOT = os.getenv("STATIC_DIR", "collected-static")
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
if not DEBUG:
- # If we're in production, all messages will go to a local file named "django_log.txt"
+ # If we're in production, all messages will go to a local file named "django_logs.txt"
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
@@ -211,13 +196,10 @@ if not DEBUG:
'filename': 'django_logs.txt',
},
},
- 'loggers': {
- 'django': {
- 'handlers': ['file'],
- 'level': 'WARNING',
- 'propagate': True,
- },
- },
+ 'root': {
+ 'handlers': ['file'],
+ 'level': 'WARNING'
+ }
}
if STAGE == "Prod" and os.getenv("SECURITY", "NONE") == "SECURE":
diff --git a/CodeReview/wsgi.py b/CodeReview/wsgi.py
index 1092b8b..679b012 100644
--- a/CodeReview/wsgi.py
+++ b/CodeReview/wsgi.py
@@ -1,5 +1,6 @@
"""
This file exposes the WSGI callable as a module-level variable named 'application'.
+ It acts as the entrypoint of the site, we point the front-end webserver to this file
"""
import os
diff --git a/Instructor/apps.py b/Instructor/apps.py
index f55e7ea..c9bde0a 100644
--- a/Instructor/apps.py
+++ b/Instructor/apps.py
@@ -6,5 +6,9 @@ from django.apps import AppConfig
class InstructorConfig(AppConfig):
+ """
+ This class defines configuration data for the Instructor app
+ """
+
default_auto_field = 'django.db.models.BigAutoField'
name = 'Instructor'
diff --git a/Instructor/static/js/rubrics/rubric-create-widget.js b/Instructor/static/js/rubrics/rubric-create-widget.js
index 8a4c419..7e27729 100644
--- a/Instructor/static/js/rubrics/rubric-create-widget.js
+++ b/Instructor/static/js/rubrics/rubric-create-widget.js
@@ -1,3 +1,5 @@
+'use strict';
+
/**
* This file is used when creating or editing a rubric
*/
@@ -154,6 +156,6 @@ $(document).ready(() => {
$(".form").submit(submit_callback);
- convert_from_json($(".rubric_create_input").val())
+ convert_from_json($(".rubric_create_input").val());
});
\ No newline at end of file
diff --git a/Instructor/static/js/rubrics/rubric-grade-widget.js b/Instructor/static/js/rubrics/rubric-grade-widget.js
index 54560f2..17b241e 100644
--- a/Instructor/static/js/rubrics/rubric-grade-widget.js
+++ b/Instructor/static/js/rubrics/rubric-grade-widget.js
@@ -11,7 +11,7 @@ function update_cell_colors() {
$(".rubric-grading td.cell").each(function (index, object) {
console.log($(object).children("input:checked").length);
- $(object).toggleClass("selected", $(object).children("label").children("input:checked").length > 0)
+ $(object).toggleClass("selected", $(object).children("label").children("input:checked").length > 0);
});
}
@@ -49,7 +49,7 @@ function update_total_score(scores) {
*/
const report = $("#grade_report");
- let report_lst = []
+ let report_lst = [];
let total = 0;
let max = 0;
for (let i = 0; i < scores.length; i++) {
@@ -82,7 +82,7 @@ function score_cell_callback(event) {
$(event.target).children('label').children(".score-select").click();
}
-$(document).ready(function() {
+$(document).ready(function () {
/**
* This function runs when the document has been loaded successfully,
diff --git a/Instructor/static/js/user-list.js b/Instructor/static/js/user-list.js
index e669c3d..7ea3ef1 100644
--- a/Instructor/static/js/user-list.js
+++ b/Instructor/static/js/user-list.js
@@ -1,3 +1,5 @@
+'use strict';
+
/* This file is used in the user list page for user cleanup */
function cleanupSubmitClick() {
@@ -11,7 +13,7 @@ function cleanupSubmitClick() {
$("#cleanupForm").submit();
}
-$(document).ready(function (){
+$(document).ready(function () {
/**
* This function will run when the document has loaded
* It sets up the cleanupSubmit button's click callback.
diff --git a/Instructor/templates/admin_home.html b/Instructor/templates/admin_home.html
index c924c6b..e1da5a3 100644
--- a/Instructor/templates/admin_home.html
+++ b/Instructor/templates/admin_home.html
@@ -1,7 +1,7 @@
{% extends "admin_base.html" %}
{% comment %}
- This page is the home for Intructor, where they can view ongoing and completed reviews for each section
+ This page is the home for the intructor, where they can view ongoing and completed reviews for each session
{% endcomment %}
{% block pageHeader %}Instructor Home{% endblock %}
diff --git a/Instructor/templates/user_list.html b/Instructor/templates/user_list.html
index bfb79ed..48cb569 100644
--- a/Instructor/templates/user_list.html
+++ b/Instructor/templates/user_list.html
@@ -15,45 +15,52 @@
{% block containerClass %}container{% endblock %}
{% block mainContent %}
-
-
-
-
-
Cleanup Users
-
-
-
-
This will clear any users not found in ActiveDirectory.
{# This will be filled in through JS #}
@@ -27,7 +27,7 @@
-
+
Delete
diff --git a/Main/static/img/fav/browserconfig.xml b/Main/static/img/fav/browserconfig.xml
index d0b2cf5..c0170a6 100644
--- a/Main/static/img/fav/browserconfig.xml
+++ b/Main/static/img/fav/browserconfig.xml
@@ -1,2 +1,11 @@
-#ffffff
+
+
+
+
+
+
+ #ffffff
+
+
+
diff --git a/Main/static/img/fav/manifest.json b/Main/static/img/fav/manifest.json
index f41accf..0f27b01 100644
--- a/Main/static/img/fav/manifest.json
+++ b/Main/static/img/fav/manifest.json
@@ -1,41 +1,41 @@
{
- "name": "App",
- "icons": [
- {
- "src": "\/static\/img\/fav\/android-icon-36x36.png",
- "sizes": "36x36",
- "type": "image\/png",
- "density": "0.75"
- },
- {
- "src": "\/static\/img\/fav\/android-icon-48x48.png",
- "sizes": "48x48",
- "type": "image\/png",
- "density": "1.0"
- },
- {
- "src": "\/static\/img\/fav\/android-icon-72x72.png",
- "sizes": "72x72",
- "type": "image\/png",
- "density": "1.5"
- },
- {
- "src": "\/static\/img\/fav\/android-icon-96x96.png",
- "sizes": "96x96",
- "type": "image\/png",
- "density": "2.0"
- },
- {
- "src": "\/static\/img\/fav\/android-icon-144x144.png",
- "sizes": "144x144",
- "type": "image\/png",
- "density": "3.0"
- },
- {
- "src": "\/static\/img\/fav\/android-icon-192x192.png",
- "sizes": "192x192",
- "type": "image\/png",
- "density": "4.0"
- }
- ]
+ "name": "CodeReview",
+ "icons": [
+ {
+ "src": "\/static\/img\/fav\/android-icon-36x36.png",
+ "sizes": "36x36",
+ "type": "image\/png",
+ "density": "0.75"
+ },
+ {
+ "src": "\/static\/img\/fav\/android-icon-48x48.png",
+ "sizes": "48x48",
+ "type": "image\/png",
+ "density": "1.0"
+ },
+ {
+ "src": "\/static\/img\/fav\/android-icon-72x72.png",
+ "sizes": "72x72",
+ "type": "image\/png",
+ "density": "1.5"
+ },
+ {
+ "src": "\/static\/img\/fav\/android-icon-96x96.png",
+ "sizes": "96x96",
+ "type": "image\/png",
+ "density": "2.0"
+ },
+ {
+ "src": "\/static\/img\/fav\/android-icon-144x144.png",
+ "sizes": "144x144",
+ "type": "image\/png",
+ "density": "3.0"
+ },
+ {
+ "src": "\/static\/img\/fav\/android-icon-192x192.png",
+ "sizes": "192x192",
+ "type": "image\/png",
+ "density": "4.0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/Main/static/img/logo.svg b/Main/static/img/logo.svg
index 49f4141..5f181a7 100644
--- a/Main/static/img/logo.svg
+++ b/Main/static/img/logo.svg
@@ -2,147 +2,147 @@
diff --git a/Main/static/js/base.js b/Main/static/js/base.js
index f2c3525..8876bd4 100644
--- a/Main/static/js/base.js
+++ b/Main/static/js/base.js
@@ -1,4 +1,8 @@
-$(document).ready(function (){
+'use strict';
+
+/* This file is used on all pages */
+
+$(document).ready(function () {
/**
* This function will run when the document loads.
* It sets the title of the page to whatever is in the #pageHeader element.
@@ -7,6 +11,6 @@ $(document).ready(function (){
document.title = `${$("#pageHeader").text()} | CodeReview`;
if (window.matchMedia(`(prefers-color-scheme: light)`).media === "not all") {
- $("#light-theme-css").attr('media', "screen")
+ $("#light-theme-css").attr('media', "screen");
}
});
diff --git a/Main/static/js/form.js b/Main/static/js/form.js
index 89ddc0f..293cc4c 100644
--- a/Main/static/js/form.js
+++ b/Main/static/js/form.js
@@ -1,23 +1,35 @@
+'use strict';
+
$(document).ready(function () {
/**
- * This function will run when the document is loaded.
- * It sets up the "back", "submit", and "show help" buttons.
+ * This function will run when the document is loaded
+ * It sets up the "back", "submit", and "show help" buttons
*/
let form = $(".form-main");
let back_button = $(".back-button");
let help_button = $("#help-button");
- let help_label = $("#help-label")
+ let help_label = $("#help-label");
let help_shown = false;
if (document.referrer !== window.location.href) {
window.sessionStorage.setItem('backUrl', document.referrer);
}
form.submit(function () {
+ /**
+ * This function is run when the form is submitted
+ * It shows the loading spinner and hides the text in the submit button
+ */
+
$(".submit-button .loading").toggleClass('d-none', false);
$(".submit-button .submit-word").toggleClass('d-none', true);
});
back_button.click(function () {
+ /**
+ * This function is run when the back button is pressed
+ * It goes back to the last page that is not this one
+ */
+
const backUrl = window.sessionStorage.getItem('backUrl');
window.sessionStorage.removeItem('backUrl');
window.location.replace(backUrl);
@@ -25,8 +37,13 @@ $(document).ready(function () {
if ($(".field-help").length > 0) {
help_button.toggleClass("d-none", false);
}
- help_button.click(function(){
+ help_button.click(function () {
+ /**
+ * This function is run when the help button is pressed
+ * It shows the help text for every field that has one
+ */
+
help_shown = !help_shown;
- help_label.text(help_shown? "Hide Help" : "Show Help");
+ help_label.text(help_shown ? "Hide Help" : "Show Help");
});
});
diff --git a/Main/templates/base.html b/Main/templates/base.html
index f6d47e7..5994fe9 100644
--- a/Main/templates/base.html
+++ b/Main/templates/base.html
@@ -17,12 +17,13 @@
{% load static %}
-
-
-
-
-
+
+
diff --git a/Main/templates/delete_base.html b/Main/templates/delete_base.html
index 91429ee..b85d8d0 100644
--- a/Main/templates/delete_base.html
+++ b/Main/templates/delete_base.html
@@ -18,11 +18,14 @@
{% csrf_token %}
Are you sure you want to {% block deleteVerb %}
- delete {# This block can be overriden to change what verb to use in the confirmation message #}{% endblock %} {{ objectString }}?
+ delete {# This block can be overriden to change what verb to use in the confirmation message #}
+ {% endblock %} {{ objectString }}?
- {% block submitVerb %}Delete {# This block can be overriden to change what verb appears in the submit button #}{% endblock %}
+ {% block submitVerb %}Delete
+ {# This block can be overriden to change what verb appears in the submit button #}
+ {% endblock %}Back
diff --git a/Main/templates/emails/email_base.html b/Main/templates/emails/email_base.html
index 818e069..c65bf14 100644
--- a/Main/templates/emails/email_base.html
+++ b/Main/templates/emails/email_base.html
@@ -5,16 +5,16 @@
-
-
-
- {% block title %}{# This block can be overriden to change the title of the email #}{% endblock %}
-
-
-
Hello, {{ target_user }}
- {% block body %}{# This block can be overriden to change the body of the email #}{% endblock %}
-
-
This email was auto-generated by the CodeReview website