CQ fixes
Build and Push Docker Image / build-and-push (pull_request) Successful in 58s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 18s

This commit is contained in:
Brian Bjarke Jensen
2025-11-12 17:01:40 +01:00
parent 05560d766a
commit 80156c8909
8 changed files with 73 additions and 50 deletions
+41 -22
View File
@@ -168,7 +168,7 @@
.shared-badge {
display: inline-block;
background: #4CAF50;
background: #4caf50;
color: white;
padding: 4px 10px;
border-radius: 12px;
@@ -510,20 +510,30 @@
<div style="margin-bottom: 20px">
<h3 style="color: #333; margin-bottom: 10px" id="editChildName"></h3>
<div style="color: #666; font-size: 14px">
<p><strong>Birth Date:</strong> <span id="editChildBirthDate"></span></p>
<p><strong>Birth Weight:</strong> <span id="editChildBirthWeight"></span>g</p>
<p>
<strong>Birth Date:</strong> <span id="editChildBirthDate"></span>
</p>
<p>
<strong>Birth Weight:</strong>
<span id="editChildBirthWeight"></span>g
</p>
</div>
</div>
<div id="sharedUsersSection" style="margin-bottom: 20px; display: none">
<h3 style="color: #333; font-size: 16px; margin-bottom: 10px">👥 Shared With</h3>
<div id="sharedUsersList" style="
background: #f8f9fa;
padding: 15px;
border-radius: 8px;
color: #666;
font-size: 14px;
"></div>
<h3 style="color: #333; font-size: 16px; margin-bottom: 10px">
👥 Shared With
</h3>
<div
id="sharedUsersList"
style="
background: #f8f9fa;
padding: 15px;
border-radius: 8px;
color: #666;
font-size: 14px;
"
></div>
</div>
<button
@@ -607,7 +617,7 @@
<div class="child-card">
<div style="display: flex; align-items: center; gap: 10px;">
<h3 style="margin: 0;">👶 ${child.name}</h3>
${child.parent_count > 1 ? '<span class="shared-badge">Shared</span>' : ''}
${child.parent_count > 1 ? '<span class="shared-badge">Shared</span>' : ""}
</div>
<div class="child-info">
<p><strong>Birth Date:</strong> ${formatDate(child.birth_time)}</p>
@@ -644,23 +654,32 @@
if (!child) return;
// Populate modal with child information
document.getElementById("editChildName").textContent = `👶 ${child.name}`;
document.getElementById("editChildBirthDate").textContent = formatDate(child.birth_time);
document.getElementById("editChildBirthWeight").textContent = child.birth_weight;
document.getElementById("editChildName").textContent =
`👶 ${child.name}`;
document.getElementById("editChildBirthDate").textContent = formatDate(
child.birth_time,
);
document.getElementById("editChildBirthWeight").textContent =
child.birth_weight;
// Show shared users if child is shared
const sharedSection = document.getElementById("sharedUsersSection");
const sharedList = document.getElementById("sharedUsersList");
if (child.parent_usernames && child.parent_usernames.length > 1) {
// Filter out current user and show other users
const otherUsers = child.parent_usernames.filter(username => username !== currentUser.username);
const otherUsers = child.parent_usernames.filter(
(username) => username !== currentUser.username,
);
if (otherUsers.length > 0) {
sharedSection.style.display = "block";
sharedList.innerHTML = otherUsers.map(username =>
`<div style="padding: 5px 0;">• ${username}</div>`
).join("");
sharedList.innerHTML = otherUsers
.map(
(username) =>
`<div style="padding: 5px 0;">• ${username}</div>`,
)
.join("");
} else {
sharedSection.style.display = "none";
}