Skip to content

Commit

Permalink
Show person on both sides of the tree in the facts
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 5, 2024
1 parent aaa7b22 commit 94d60a9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
6 changes: 6 additions & 0 deletions dynamic-site/lib/Ged2site/Display/facts.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ sub html {
if(my $mc = $facts->{'most_children'}) {
$mc->{'person'} = $people->fetchrow_hashref(entry => delete $mc->{'xref'});
}
if(my $bs = $facts->{'both_sides'}) {
foreach my $xref(@{$bs->{'xrefs'}}) {
push @{$bs->{'people'}}, $people->fetchrow_hashref(entry => $xref);
}
delete $bs->{'xrefs'};
}
$p->{'facts'} = $facts;
} else {
$p->{'error'} = "Can't open $json_file";
Expand Down
13 changes: 13 additions & 0 deletions dynamic-site/templates/en/mobile/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
<a href="?page=people&amp;entry=[%- facts.most_children.person.entry %]">[% facts.most_children.person.title %]</a> had [% facts.most_children.count %] children
</p>
[% END %]
[% IF facts.both_sides %]
<p>
There
[% IF facts.both_sides.count == 1 %]
is 1 person who appears
[% ELSE %]
are [% facts.both_sides.count %] people who appear
[% END %]
on both the father's and mother's side of the tree:
[% FOREACH person IN facts.both_sides.people %]
<br><a href="?page=people&amp;entry=[%- person.entry %]">[% person.title %]</a>
</p>
[% END %]
[% END %]
<center><font size="+2">
[ <a href="?page=people&amp;home=1">Home</a> ]<br>
Expand Down
11 changes: 11 additions & 0 deletions dynamic-site/templates/en/search/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
<a href="?page=people&amp;entry=[%- facts.most_children.person.entry %]">[% facts.most_children.person.title %]</a> had [% facts.most_children.count %] children
</p>
[% END %]
[% IF facts.both_sides %]
<li>
There
[% IF facts.both_sides.count == 1 %]
is 1 person who appears
[% ELSE %]
are [% facts.both_sides.count %] people who appear
[% END %]
on both the father's and mother's side of the tree
</li>
[% END %]
[% END %]
<p>
<i>
Expand Down
18 changes: 18 additions & 0 deletions dynamic-site/templates/en/web/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@
<a href="?page=people&amp;entry=[%- facts.most_children.person.entry %]">[% facts.most_children.person.title %]</a> had [% facts.most_children.count %] children
</li>
[% END %]
[% IF facts.both_sides %]
<li>
There
[% IF facts.both_sides.count == 1 %]
is 1 person who appears
[% ELSE %]
are [% facts.both_sides.count %] people who appear
[% END %]
on both the father's and mother's side of the tree:
<ul>
[% FOREACH person IN facts.both_sides.people %]
<li>
<a href="?page=people&amp;entry=[%- person.entry %]">[% person.title %]</a>
</li>
[% END %]
</ul>
</li>
[% END %]
</ul>
[% END %]
</div>
Expand Down
7 changes: 4 additions & 3 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -2072,10 +2072,9 @@ sub print_person
print $html '</head>';
if($opts{'m'}) {
print $html "<body onload=\"html_googlemaps_initialize()\">";
} elsif($geolocation_key) {
die "$0: -G makes no sense without -m";
} else {
if($geolocation_key) {
die "$0: -G makes no sense without -m";
}
print $html '<body>';
}
print $html "<center><h1>$title</h1>";
Expand Down Expand Up @@ -2531,6 +2530,7 @@ sub print_person
}
if($mr && $fr) {
# Keep a tally of the number of people appearing on both sides
push @{$facts->{'both_sides'}->{'xrefs'}}, $person->xref();
$facts->{'both_sides'}->{'count'}++;
}
}
Expand All @@ -2553,6 +2553,7 @@ sub print_person
}
if($mr && $fr) {
# Keep a tally of the number of people appearing on both sides
push @{$facts->{'both_sides'}->{'xrefs'}}, $person->xref();
$facts->{'both_sides'}->{'count'}++;
}
}
Expand Down

0 comments on commit 94d60a9

Please sign in to comment.