diff --git a/README.md b/README.md index 963271d..4d38c01 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,7 @@ Install packages from `requirements.txt`. pip install --upgrade pip -r requirements.txt ``` +Start `localhost`. +```shell +./manage.py runserver +``` diff --git a/kristofersxyz/apps/main/urls.py b/kristofersxyz/apps/main/urls.py index 05c7645..32298c2 100644 --- a/kristofersxyz/apps/main/urls.py +++ b/kristofersxyz/apps/main/urls.py @@ -6,5 +6,4 @@ urlpatterns = [ path("", views.index, name="home"), path("karbs", views.karbs, name="karbs"), path("lightsaber", views.lightsaber, name="lightsaber"), - path("validation", views.validation, name="validation"), ] diff --git a/kristofersxyz/apps/main/views.py b/kristofersxyz/apps/main/views.py index 2525d2a..4b722ee 100644 --- a/kristofersxyz/apps/main/views.py +++ b/kristofersxyz/apps/main/views.py @@ -16,7 +16,3 @@ def projects(request): def karbs(request): """Karbs install script""" return redirect("/projects/karbs") - - -def validation(request): - return render(request, "main/validation.html", {"title": "Validation"}) diff --git a/kristofersxyz/apps/projects/admin.py b/kristofersxyz/apps/projects/admin.py index b97a94f..4185d36 100644 --- a/kristofersxyz/apps/projects/admin.py +++ b/kristofersxyz/apps/projects/admin.py @@ -1,2 +1,3 @@ +# from django.contrib import admin # Register your models here. diff --git a/kristofersxyz/apps/projects/models.py b/kristofersxyz/apps/projects/models.py index 35e0d64..0b4331b 100644 --- a/kristofersxyz/apps/projects/models.py +++ b/kristofersxyz/apps/projects/models.py @@ -1,2 +1,3 @@ +# from django.db import models # Create your models here. diff --git a/kristofersxyz/apps/projects/tests.py b/kristofersxyz/apps/projects/tests.py index 4929020..a79ca8b 100644 --- a/kristofersxyz/apps/projects/tests.py +++ b/kristofersxyz/apps/projects/tests.py @@ -1,2 +1,3 @@ +# from django.test import TestCase # Create your tests here. diff --git a/static/main/css/validation.css b/static/main/css/validation.css deleted file mode 100644 index 61c9732..0000000 --- a/static/main/css/validation.css +++ /dev/null @@ -1,21 +0,0 @@ -.valid { - color: green; -} - -.not-valid { - color: red; -} - -#check-list li { - list-style: square; -} - -#register-form { - display: grid; - place-items: center; - margin-top: 5rem; -} - -#register-form > input { - margin-top: 1rem; -} diff --git a/static/main/js/validation.js b/static/main/js/validation.js deleted file mode 100644 index 9fb0fef..0000000 --- a/static/main/js/validation.js +++ /dev/null @@ -1,95 +0,0 @@ -$(document).ready(function () { - let register_form = $("#register-form") - let username = $("#username") - let password = $("#password") - let confirm_password = $("#confirm-password") - let check_block = $("#check-block") - let valid_username = false - let valid_password = false - let valid_password_match = false - - const CHECKS = { - length: "^.{10,}", - uppercase: "[A-Z]", - lowercase: "[a-z]", - numbers: "[0-9]", - symbol: "[^A-Za-z0-9]", - } - - const TEXT = { - length: "10 Characters", - uppercase: "1 Uppercase Letter", - lowercase: "1 Lowercase Letter", - numbers: "1 Digit", - symbol: "1 Symbol", - } - - username.change(function () { - if (username.val() === "") { - valid_username = false - } else { - valid_username = true - } - submit() - }) - - password.change(function () { - valid_password = true - check_block.empty() - check_block.append($("
").text("Password must consist of:")) - check_block.append($("
", {id: "password-match", class: "not-valid"}).text( - "Passwords do not match" - ) - ) - valid_password_match = false - } else { - valid_password_match = true - } - submit() - } - - function submit() { - $("#submit-btn").remove() - if (valid_username && valid_password && valid_password_match) { - register_form.append( - $("", { - type: "submit", - value: "Register", - id: "submit-btn", - class: "btn btn-primary", - }) - ) - } else { - $("#submit-btn").remove() - } - } - - $("#submit-btn").click(function () { - $("#register-form").submit() - }) -}) diff --git a/templates/layout.html b/templates/layout.html index 4a60752..f7f38d6 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,8 +3,8 @@
- - + +Subject to change.
-