From 581283f45ba790839ebdde1fde99c415ed2670d6 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sat, 26 Aug 2023 16:37:26 +0200 Subject: [PATCH] Disable couple photo on couple route --- .../src/routes/family/FamilyCoupleRoute.tsx | 87 ++++++++++--------- .../routes/family/FamilyCouplesListRoute.tsx | 7 +- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx index 12a5340..4b7fb10 100644 --- a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx +++ b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx @@ -414,49 +414,52 @@ export function CouplePage(p: { - {/* Photo */} - - -
- -
- {p.editing ? ( -

- Veuillez enregistrer / annuler les modifications apportées à - la fiche avant de changer la photo du couple. -

- ) : ( - <> - {" "} - {couple.hasPhoto && ( - - - + { + /* Photo */ !family.family.disable_couple_photos && ( + + +
+ +
+ {p.editing ? ( +

+ Veuillez enregistrer / annuler les modifications apportées + à la fiche avant de changer la photo du couple. +

+ ) : ( + <> + {" "} + {couple.hasPhoto && ( + + + + )}{" "} + {couple.hasPhoto && ( + + )} + )}{" "} - {couple.hasPhoto && ( - - )} - - )}{" "} -
-
-
+
+
+
+ ) + } {/* Children */} {p.children && ( diff --git a/geneit_app/src/routes/family/FamilyCouplesListRoute.tsx b/geneit_app/src/routes/family/FamilyCouplesListRoute.tsx index 0ba8e1a..c34c1f1 100644 --- a/geneit_app/src/routes/family/FamilyCouplesListRoute.tsx +++ b/geneit_app/src/routes/family/FamilyCouplesListRoute.tsx @@ -225,6 +225,9 @@ function CouplesTable(p: { }, ]; + // If couple photos are hidden, remove their column + if (family.family.disable_couple_photos) columns.splice(0, 1); + return ( c.id} onCellDoubleClick={(p) => { - let member; + /*let member; if (p.field === "wife") member = family.members.get(p.row.wife); else if (p.field === "husband") member = family.members.get(p.row.husband); @@ -241,7 +244,7 @@ function CouplesTable(p: { if (member) { n(family.family.memberURL(member)); return; - } + }*/ n(family.family.coupleURL(p.row)); }}