Can disable couple photos #5

Merged
pierre merged 7 commits from disable_couple_photos into master 2023-08-26 14:55:24 +00:00
2 changed files with 50 additions and 44 deletions
Showing only changes of commit 581283f45b - Show all commits

View File

@ -414,7 +414,8 @@ export function CouplePage(p: {
</PropertiesBox>
</Grid>
{/* Photo */}
{
/* Photo */ !family.family.disable_couple_photos && (
<Grid item sm={12} md={6}>
<PropertiesBox title="Photo">
<div style={{ textAlign: "center" }}>
@ -422,8 +423,8 @@ export function CouplePage(p: {
<br />
{p.editing ? (
<p>
Veuillez enregistrer / annuler les modifications apportées à
la fiche avant de changer la photo du couple.
Veuillez enregistrer / annuler les modifications apportées
à la fiche avant de changer la photo du couple.
</p>
) : (
<>
@ -457,6 +458,8 @@ export function CouplePage(p: {
</div>
</PropertiesBox>
</Grid>
)
}
{/* Children */}
{p.children && (

View File

@ -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 (
<DataGrid
style={{ flex: "1" }}
@ -233,7 +236,7 @@ function CouplesTable(p: {
autoPageSize
getRowId={(c) => 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));
}}