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 @@