From 0fefb0a7419c3e92b46bdc0289d8e9c276c2d7d8 Mon Sep 17 00:00:00 2001 From: Aida Eslami Date: Thu, 12 Feb 2026 12:56:27 +0000 Subject: [PATCH 1/4] loging form --- backend/README.md | 2 +- front-end/views/home.mjs | 2 ++ front-end/views/profile.mjs | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/README.md b/backend/README.md index 8e31e11..98d7628 100644 --- a/backend/README.md +++ b/backend/README.md @@ -14,7 +14,7 @@ To run: 4. Install dependencies: `pip install -r requirements.txt` 5. Run the database: `../db/run.sh` (you must have Docker installed and running). 6. Create the database schema: `../db/create-schema.sh` - +7. run main You may want to run `python3 populate.py` to populate sample data. If you ever need to wipe the database, just delete `../db/pg_data` (and remember to set it up again after). diff --git a/front-end/views/home.mjs b/front-end/views/home.mjs index 85a5cca..1148367 100644 --- a/front-end/views/home.mjs +++ b/front-end/views/home.mjs @@ -19,6 +19,8 @@ import {createBloom} from "../components/bloom.mjs"; // Home view - logged in or not function homeView() { + console.trace("HOME VIEW CALLED"); + destroy(); if (state.isLoggedIn) { diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index dd2b92a..67d4b11 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -38,9 +38,9 @@ function profileView(username) { "login-template", createLogin ); - document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + document + .querySelector("[data-form='login']") + ?.addEventListener("submit", handleLogin); const profileData = state.profiles.find((p) => p.username === username); if (profileData) { From 6e2179dc32d0a7f145475f314453a7316937d2f7 Mon Sep 17 00:00:00 2001 From: Aida Eslami Date: Thu, 12 Feb 2026 13:02:24 +0000 Subject: [PATCH 2/4] return changes --- front-end/views/home.mjs | 1 - front-end/views/profile.mjs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/front-end/views/home.mjs b/front-end/views/home.mjs index 1148367..acf28a1 100644 --- a/front-end/views/home.mjs +++ b/front-end/views/home.mjs @@ -19,7 +19,6 @@ import {createBloom} from "../components/bloom.mjs"; // Home view - logged in or not function homeView() { - console.trace("HOME VIEW CALLED"); destroy(); diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index 67d4b11..7270e93 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -39,8 +39,8 @@ function profileView(username) { createLogin ); document - .querySelector("[data-form='login']") - ?.addEventListener("submit", handleLogin); + .querySelector("[data-action='login']") + ?.addEventListener("click", handleLogin); const profileData = state.profiles.find((p) => p.username === username); if (profileData) { From ba84cbe32435f600080e9920a31f9ecf9aa544d4 Mon Sep 17 00:00:00 2001 From: Aida Eslami Date: Thu, 12 Feb 2026 13:04:09 +0000 Subject: [PATCH 3/4] change event listener and class name --- front-end/views/profile.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index 7270e93..67d4b11 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -39,8 +39,8 @@ function profileView(username) { createLogin ); document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + .querySelector("[data-form='login']") + ?.addEventListener("submit", handleLogin); const profileData = state.profiles.find((p) => p.username === username); if (profileData) { From 65a3b3e5327be2c7d6583b5af78c6c750f489e36 Mon Sep 17 00:00:00 2001 From: Aida Eslami Date: Thu, 12 Feb 2026 13:29:01 +0000 Subject: [PATCH 4/4] Change class name and submit from --- front-end/views/profile.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index 67d4b11..eb3e3eb 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -38,6 +38,7 @@ function profileView(username) { "login-template", createLogin ); + document .querySelector("[data-form='login']") ?.addEventListener("submit", handleLogin);