From 6bf518973454e279aeef440b4d0f4b24f39946e0 Mon Sep 17 00:00:00 2001 From: Piotr Jakubiak <2021323@stud.hs-mannheim.de> Date: Fri, 8 Nov 2024 12:01:37 +0100 Subject: [PATCH] refactor: Update file structure --- .gitignore | 7 ++++ .../resources/{ => config}/application.yaml | 0 .../resources/{ => config}/production.yaml | 0 .../static/{style => css}/core/footer.css | 0 .../static/{style => css}/core/header.css | 0 .../css/core/navigation.css} | 0 .../static/{style => css}/core/style.css | 0 .../{style => css}/projects/projects.css | 0 .../static/{style => css}/skills/skills.css | 0 .../static/js/skills/fetchSecondarySkills.js | 18 ++++++++++ .../resources/static/style/notes/notes.css | 1 - .../resources/templates/core/_header.html | 23 ++----------- .../resources/templates/core/_navigation.html | 20 +++++++++++ .../core/home.html} | 0 src/main/resources/templates/notes/notes.html | 15 -------- .../{ => pages}/projects/projects-create.html | 8 ++--- .../{ => pages}/projects/projects.html | 2 +- .../{ => pages}/skills/skills-add.html | 34 +++---------------- .../{ => pages}/skills/skills-create.html | 8 ++--- .../templates/{ => pages}/skills/skills.html | 4 +-- 20 files changed, 64 insertions(+), 76 deletions(-) rename src/main/resources/{ => config}/application.yaml (100%) rename src/main/resources/{ => config}/production.yaml (100%) rename src/main/resources/static/{style => css}/core/footer.css (100%) rename src/main/resources/static/{style => css}/core/header.css (100%) rename src/main/resources/{fetchSecondarySkills.js => static/css/core/navigation.css} (100%) rename src/main/resources/static/{style => css}/core/style.css (100%) rename src/main/resources/static/{style => css}/projects/projects.css (100%) rename src/main/resources/static/{style => css}/skills/skills.css (100%) create mode 100644 src/main/resources/static/js/skills/fetchSecondarySkills.js delete mode 100644 src/main/resources/static/style/notes/notes.css create mode 100644 src/main/resources/templates/core/_navigation.html rename src/main/resources/{static/scripts/core/placeholder.js => templates/core/home.html} (100%) delete mode 100644 src/main/resources/templates/notes/notes.html rename src/main/resources/templates/{ => pages}/projects/projects-create.html (88%) rename src/main/resources/templates/{ => pages}/projects/projects.html (96%) rename src/main/resources/templates/{ => pages}/skills/skills-add.html (63%) rename src/main/resources/templates/{ => pages}/skills/skills-create.html (86%) rename src/main/resources/templates/{ => pages}/skills/skills.html (96%) diff --git a/.gitignore b/.gitignore index 549e00a..b6d3320 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,10 @@ build/ ### VS Code ### .vscode/ +.history/ + +### macOS ### +*.DS_Store + +### Database files ### +*.db diff --git a/src/main/resources/application.yaml b/src/main/resources/config/application.yaml similarity index 100% rename from src/main/resources/application.yaml rename to src/main/resources/config/application.yaml diff --git a/src/main/resources/production.yaml b/src/main/resources/config/production.yaml similarity index 100% rename from src/main/resources/production.yaml rename to src/main/resources/config/production.yaml diff --git a/src/main/resources/static/style/core/footer.css b/src/main/resources/static/css/core/footer.css similarity index 100% rename from src/main/resources/static/style/core/footer.css rename to src/main/resources/static/css/core/footer.css diff --git a/src/main/resources/static/style/core/header.css b/src/main/resources/static/css/core/header.css similarity index 100% rename from src/main/resources/static/style/core/header.css rename to src/main/resources/static/css/core/header.css diff --git a/src/main/resources/fetchSecondarySkills.js b/src/main/resources/static/css/core/navigation.css similarity index 100% rename from src/main/resources/fetchSecondarySkills.js rename to src/main/resources/static/css/core/navigation.css diff --git a/src/main/resources/static/style/core/style.css b/src/main/resources/static/css/core/style.css similarity index 100% rename from src/main/resources/static/style/core/style.css rename to src/main/resources/static/css/core/style.css diff --git a/src/main/resources/static/style/projects/projects.css b/src/main/resources/static/css/projects/projects.css similarity index 100% rename from src/main/resources/static/style/projects/projects.css rename to src/main/resources/static/css/projects/projects.css diff --git a/src/main/resources/static/style/skills/skills.css b/src/main/resources/static/css/skills/skills.css similarity index 100% rename from src/main/resources/static/style/skills/skills.css rename to src/main/resources/static/css/skills/skills.css diff --git a/src/main/resources/static/js/skills/fetchSecondarySkills.js b/src/main/resources/static/js/skills/fetchSecondarySkills.js new file mode 100644 index 0000000..57d786d --- /dev/null +++ b/src/main/resources/static/js/skills/fetchSecondarySkills.js @@ -0,0 +1,18 @@ +document.getElementById("primarySkill").addEventListener("change", function () { + var primarySkillId = this.value; + fetch("/skills/secondary-skills?primarySkillId=" + primarySkillId) + .then((response) => response.json()) + .then((data) => { + console.log("Fetch response data:", data); + var secondarySkillSelect = document.getElementById("secondarySkill"); + secondarySkillSelect.innerHTML = + ''; + data.forEach(function (secondarySkill) { + var option = document.createElement("option"); + option.value = secondarySkill.ssid; + option.text = secondarySkill.description; + secondarySkillSelect.add(option); + }); + }) + .catch((error) => console.error("Error fetching secondary skills:", error)); +}); diff --git a/src/main/resources/static/style/notes/notes.css b/src/main/resources/static/style/notes/notes.css deleted file mode 100644 index e116ab0..0000000 --- a/src/main/resources/static/style/notes/notes.css +++ /dev/null @@ -1 +0,0 @@ -/* Placeholder */ diff --git a/src/main/resources/templates/core/_header.html b/src/main/resources/templates/core/_header.html index 9bf1376..45598ec 100644 --- a/src/main/resources/templates/core/_header.html +++ b/src/main/resources/templates/core/_header.html @@ -5,26 +5,9 @@
- +
diff --git a/src/main/resources/templates/core/_navigation.html b/src/main/resources/templates/core/_navigation.html new file mode 100644 index 0000000..3b8a040 --- /dev/null +++ b/src/main/resources/templates/core/_navigation.html @@ -0,0 +1,20 @@ + diff --git a/src/main/resources/static/scripts/core/placeholder.js b/src/main/resources/templates/core/home.html similarity index 100% rename from src/main/resources/static/scripts/core/placeholder.js rename to src/main/resources/templates/core/home.html diff --git a/src/main/resources/templates/notes/notes.html b/src/main/resources/templates/notes/notes.html deleted file mode 100644 index fee73df..0000000 --- a/src/main/resources/templates/notes/notes.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
- My Skill Management System - - - -
-
-
-
-
- - diff --git a/src/main/resources/templates/projects/projects-create.html b/src/main/resources/templates/pages/projects/projects-create.html similarity index 88% rename from src/main/resources/templates/projects/projects-create.html rename to src/main/resources/templates/pages/projects/projects-create.html index c5a51cf..75c6a71 100644 --- a/src/main/resources/templates/projects/projects-create.html +++ b/src/main/resources/templates/pages/projects/projects-create.html @@ -3,10 +3,10 @@
Create Project - - - - + + + +
diff --git a/src/main/resources/templates/projects/projects.html b/src/main/resources/templates/pages/projects/projects.html similarity index 96% rename from src/main/resources/templates/projects/projects.html rename to src/main/resources/templates/pages/projects/projects.html index 76a5c8c..67205e4 100644 --- a/src/main/resources/templates/projects/projects.html +++ b/src/main/resources/templates/pages/projects/projects.html @@ -3,7 +3,7 @@
Projects - +
diff --git a/src/main/resources/templates/skills/skills-add.html b/src/main/resources/templates/pages/skills/skills-add.html similarity index 63% rename from src/main/resources/templates/skills/skills-add.html rename to src/main/resources/templates/pages/skills/skills-add.html index 1939e5d..7b358d4 100644 --- a/src/main/resources/templates/skills/skills-add.html +++ b/src/main/resources/templates/pages/skills/skills-add.html @@ -3,10 +3,10 @@
Add Skill - - - - + + + +
@@ -69,30 +69,6 @@
- + diff --git a/src/main/resources/templates/skills/skills-create.html b/src/main/resources/templates/pages/skills/skills-create.html similarity index 86% rename from src/main/resources/templates/skills/skills-create.html rename to src/main/resources/templates/pages/skills/skills-create.html index eaeaf56..13a5716 100644 --- a/src/main/resources/templates/skills/skills-create.html +++ b/src/main/resources/templates/pages/skills/skills-create.html @@ -3,10 +3,10 @@
Create Skill - - - - + + + +
diff --git a/src/main/resources/templates/skills/skills.html b/src/main/resources/templates/pages/skills/skills.html similarity index 96% rename from src/main/resources/templates/skills/skills.html rename to src/main/resources/templates/pages/skills/skills.html index 673784c..d688b9c 100644 --- a/src/main/resources/templates/skills/skills.html +++ b/src/main/resources/templates/pages/skills/skills.html @@ -3,8 +3,8 @@
Skills - - + +