From ee44c2db73adc589b392e4124b31c23c657c9b59 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 23 Jan 2023 00:31:31 +0200 Subject: [PATCH 1/4] Added run command --- README.md | 4 ++++ 1 file changed, 4 insertions(+) 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 +``` From 2b64d837473f4f621e7aef3a50c68b78ff909e4f Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 23 Jan 2023 11:21:55 +0200 Subject: [PATCH 2/4] Removed trailing whitespaces --- templates/layout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/layout.html b/templates/layout.html index 4a60752..938a7e9 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,8 +3,8 @@ - - + + From 944506d3cfc3e8a70a90c6e32827913caf41e07d Mon Sep 17 00:00:00 2001 From: Kristofers Solo <kristians.cagulis@proton.me> Date: Mon, 23 Jan 2023 11:25:27 +0200 Subject: [PATCH 3/4] Removed trailing shashes --- templates/layout.html | 14 +++++++------- templates/main/index.html | 2 +- templates/main/lightsaber.html | 2 +- templates/main/validation.html | 2 +- templates/projects/karbs/instructions.html | 2 +- templates/projects/projects.html | 2 +- .../traffic_light_detector.html | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/templates/layout.html b/templates/layout.html index 938a7e9..f7f38d6 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,8 +3,8 @@ <html lang="en" data-color-mode="dark"> <head> <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"/> - <link rel="icon" href="{% static 'main/img/icons/logo.svg' %}"/> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="icon" href="{% static 'main/img/icons/logo.svg' %}"> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"> <title> @@ -12,19 +12,19 @@ + href="{% static 'main/css/reset.css' %}"> + href="{% static 'main/css/colors.css' %}"> + href="{% static 'main/css/navigation_button.css' %}"> + href="{% static 'main/css/button.css' %}"> + href="{% static 'main/css/layout.css' %}"> {% block meta %}{% endblock %} diff --git a/templates/main/index.html b/templates/main/index.html index 9ca3ce0..c971f5e 100644 --- a/templates/main/index.html +++ b/templates/main/index.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'main/css/index.css' %}"> diff --git a/templates/main/lightsaber.html b/templates/main/lightsaber.html index 500ae38..e349bc9 100644 --- a/templates/main/lightsaber.html +++ b/templates/main/lightsaber.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'main/css/lightsaber.css' %}"> {% endblock %} {% block content %} diff --git a/templates/main/validation.html b/templates/main/validation.html index 49be582..357edf4 100644 --- a/templates/main/validation.html +++ b/templates/main/validation.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'main/css/validation.css' %}"> {% endblock %} diff --git a/templates/projects/karbs/instructions.html b/templates/projects/karbs/instructions.html index 2869dbe..269a00b 100644 --- a/templates/projects/karbs/instructions.html +++ b/templates/projects/karbs/instructions.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'main/css/markdown.css' %}"> {% endblock %} {% block content %}
diff --git a/templates/projects/projects.html b/templates/projects/projects.html index a7fd554..b5786b0 100644 --- a/templates/projects/projects.html +++ b/templates/projects/projects.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'projects/css/projects.css' %}"> {% endblock %} {% block content %} diff --git a/templates/projects/traffic_light_detector/traffic_light_detector.html b/templates/projects/traffic_light_detector/traffic_light_detector.html index 27d4eaa..fcba97a 100644 --- a/templates/projects/traffic_light_detector/traffic_light_detector.html +++ b/templates/projects/traffic_light_detector/traffic_light_detector.html @@ -4,7 +4,7 @@ {% block meta %} + href="{% static 'main/css/markdown.css' %}"> {% endblock %} {% block content %}
From 430bac392fadc951cd6f420e1cece9c77f5c00b9 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 23 Jan 2023 12:06:00 +0200 Subject: [PATCH 4/4] Yeeted validation --- kristofersxyz/apps/main/urls.py | 1 - kristofersxyz/apps/main/views.py | 4 -- kristofersxyz/apps/projects/admin.py | 1 + kristofersxyz/apps/projects/models.py | 1 + kristofersxyz/apps/projects/tests.py | 1 + static/main/css/validation.css | 21 ------ static/main/js/validation.js | 95 --------------------------- templates/main/validation.html | 33 ---------- templates/projects/projects.html | 12 ---- 9 files changed, 3 insertions(+), 166 deletions(-) delete mode 100644 static/main/css/validation.css delete mode 100644 static/main/js/validation.js delete mode 100644 templates/main/validation.html 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: "check-list"})) - for (let item in CHECKS) { - if (!new RegExp(CHECKS[item]).test(password.val())) { - $("#check-list").append( - $("
  • ", {id: item, class: "not-valid"}).text(TEXT[item]) - ) - valid_password = false - } else { - $("#check-list").append( - $("
  • ", {id: item, class: "valid"}).text(TEXT[item]) - ) - } - } - check_password_match() - submit() - }) - - confirm_password.change(function () { - check_password_match() - }) - - function check_password_match() { - $("#password-match").remove() - if (password.val() != confirm_password.val()) { - 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/main/validation.html b/templates/main/validation.html deleted file mode 100644 index 357edf4..0000000 --- a/templates/main/validation.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "layout.html" %} -{% load static %} -{% block title %}{{ title }}{% endblock %} -{% block meta %} - - - -{% endblock %} -{% block content %} -

    - -
    - -
    - -
    -
    -
    -{% endblock %} diff --git a/templates/projects/projects.html b/templates/projects/projects.html index b5786b0..b36b56f 100644 --- a/templates/projects/projects.html +++ b/templates/projects/projects.html @@ -88,18 +88,6 @@
- -
-
-
-

Register

-
-
-

Subject to change.

-
-
-
-
{% endblock %}