From c745ab1b7a7d9c6681bdf3401018a0168f9d50a9 Mon Sep 17 00:00:00 2001 From: Brian Bjarke Jensen Date: Tue, 11 Nov 2025 14:39:59 +0100 Subject: [PATCH] added skip add-child for new users to allow for adding a shared child --- src/baby_monitor/static/add-child.html | 19 +++++++++++++++++ src/baby_monitor/static/index.html | 28 ++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/baby_monitor/static/add-child.html b/src/baby_monitor/static/add-child.html index 7fde252..2bbcfa6 100644 --- a/src/baby_monitor/static/add-child.html +++ b/src/baby_monitor/static/add-child.html @@ -192,6 +192,15 @@ Cancel + + diff --git a/src/baby_monitor/static/index.html b/src/baby_monitor/static/index.html index 6b12842..53df444 100644 --- a/src/baby_monitor/static/index.html +++ b/src/baby_monitor/static/index.html @@ -275,9 +275,9 @@ }) .then((response) => response.json()) .then((children) => { - // If no children, redirect to add-child page + // If no children, show welcome message with option to add if (children.length === 0) { - window.location.href = "/add-child.html"; + showNoChildrenMessage(); return; } @@ -290,6 +290,30 @@ }); } + function showNoChildrenMessage() { + const content = document.getElementById("content"); + content.className = ""; + content.innerHTML = ` +

👶 Welcome to Baby Monitor

+
+
🍼
+

No Children Added Yet

+

+ You can add a child to start tracking or redeem a child share code
+ from another user to access their child's information. +

+
+ + ➕ Add Your Child + + + 🔗 Redeem Share Code + +
+
+ `; + } + let activeFeeding = null; let userChildren = []; let lastFeeding = null;