From 5b27284ddc02d1738b139dd6383129d53dd540c0 Mon Sep 17 00:00:00 2001 From: VikasPattar2006 Date: Fri, 29 May 2026 20:16:48 +0530 Subject: [PATCH 1/2] Add project title search functionality --- static/script.js | 36 ++++++++++++++++++++++++++++++++++++ static/style.css | 20 ++++++++++++++++++++ templates/index.html | 8 ++++++++ 3 files changed, 64 insertions(+) diff --git a/static/script.js b/static/script.js index aebc9225..72b36741 100644 --- a/static/script.js +++ b/static/script.js @@ -60,6 +60,7 @@ if (isIndexPage) { var resultsLoadingEl = document.getElementById("results-loading"); var resultsEmptyEl = document.getElementById("results-empty"); var emptyMessageEl = document.getElementById("empty-message"); + var searchContainer = document.getElementById("results-search-container"); var skillsHidden = document.getElementById("skills"); var skillsTextInput = document.getElementById("skills-input"); var chipsSelectedEl = document.getElementById("skill-chips-selected"); @@ -67,6 +68,7 @@ if (isIndexPage) { // Tracks currently selected skills to prevent duplicates var selectedSkills = []; + var currentProjects = []; // ---------------------------------------------------------- @@ -479,6 +481,8 @@ if (isIndexPage) { function renderResults(projects, message) { resultsSection.style.display = "block"; + searchContainer.style.display = projects.length ? "block" : "none"; + currentProjects = projects; resultsLoadingEl.style.display = "none"; // Clear out any cards from a previous search before showing new ones resultsGrid.innerHTML = ""; @@ -567,6 +571,38 @@ if (isIndexPage) { return text.length > maxLength ? text.slice(0, maxLength) + "..." : text; } + // ---------------------------------------------------------- +// Project title search +// ---------------------------------------------------------- + +var projectSearch = document.getElementById("project-search"); + +if (projectSearch) { + projectSearch.addEventListener("input", function () { + + var searchValue = projectSearch.value.toLowerCase(); + + var filteredProjects = currentProjects.filter(function (project) { + return project.title.toLowerCase().includes(searchValue); + }); + + resultsGrid.innerHTML = ""; + + if (filteredProjects.length === 0) { + resultsGrid.innerHTML = ` +
+ No matching projects found. +
+ `; + return; + } + + filteredProjects.forEach(function (project) { + resultsGrid.appendChild(buildProjectCard(project)); + }); + }); +} + } // end isIndexPage diff --git a/static/style.css b/static/style.css index 18d9cbf7..ef62c43d 100644 --- a/static/style.css +++ b/static/style.css @@ -1968,4 +1968,24 @@ select:focus { #scroll-top-btn.visible { display: flex; +} + +.results-search-container { + margin-bottom: 20px; +} + +#project-search { + width: 100%; + padding: 12px; + border-radius: 10px; + border: 1px solid #ccc; + font-size: 16px; +} + +.empty-search-message { + grid-column: 1 / -1; + text-align: center; + padding: 20px; + font-size: 1rem; + color: #9ca3af; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 49556f7d..7e894a8a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -505,6 +505,14 @@

No Projects Found

+ +
From 8c38340d54b90989289f6ba7952edfd75345f8c0 Mon Sep 17 00:00:00 2001 From: VikasPattar2006 Date: Wed, 10 Jun 2026 13:36:42 +0530 Subject: [PATCH 2/2] Fix recommender constant compatibility --- utils/recommender.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/recommender.py b/utils/recommender.py index 111dddd5..2d1cd7b1 100644 --- a/utils/recommender.py +++ b/utils/recommender.py @@ -22,6 +22,10 @@ "interest": 2, "time": 1, } +WEIGHT_SKILL = SCORING_WEIGHTS["skill"] +WEIGHT_LEVEL = SCORING_WEIGHTS["level"] +WEIGHT_INTEREST = SCORING_WEIGHTS["interest"] +WEIGHT_TIME = SCORING_WEIGHTS["time"] # Common aliases and abbreviations for skills. # This improves recommendation accuracy by normalizing user input.