Skip to content

Commit

Permalink
Dynamic site: show the person with the most children
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 2, 2024
1 parent a3626b3 commit 6496cfa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions dynamic-site/templates/en/mobile/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<a href="?page=people&amp;entry=[%- facts.oldest_age.person.entry %]">[% facts.oldest_age.person.title %]</a> who lived for [% facts.oldest_age.years %] years
</p>
[% END %]
[% IF facts.most_children %]
<p>
Person with the most children:
<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 %]
[% END %]
<center><font size="+2">
[ <a href="?page=people&amp;home=1">Home</a> ]<br>
Expand Down
6 changes: 6 additions & 0 deletions dynamic-site/templates/en/search/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<a href="?page=people&amp;entry=[%- facts.oldest_age.person.entry %]">[% facts.oldest_age.person.title %]</a> who lived for [% facts.oldest_age.years %] years
</p>
[% END %]
[% IF facts.most_children %]
<p>
Person with the most children:
<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 %]
[% END %]
<p>
<i>
Expand Down
6 changes: 6 additions & 0 deletions dynamic-site/templates/en/web/Ged2site/Display/facts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
<a href="?page=people&amp;entry=[%- facts.oldest_age.person.entry %]">[% facts.oldest_age.person.title %]</a> who lived for [% facts.oldest_age.years %] years
</li>
[% END %]
[% IF facts.most_children %]
<li>
Person with the most children:
<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 %]
</ul>
[% END %]
</div>
Expand Down
10 changes: 8 additions & 2 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,12 @@ sub print_person
map { $_->children() } $person->fams();
my $numberofchildren = scalar(@children);

# Most children
if((!defined($facts->{'most_children'})) || ($facts->{'most_children'}->{'count'} < $numberofchildren)) {
$facts->{'most_children'}->{'count'} = $numberofchildren;
$facts->{'most_children'}->{'xref'} = $person->xref();
}

if($opts{'w'} && $numberofchildren) {
foreach my $child(@children) {
if($child->xref() eq $person->xref()) {
Expand Down Expand Up @@ -8388,7 +8394,7 @@ sub print_person
# if(open(my $fout, '|-', '/bin/cat')) {
# We're using UTF-8 for the graphviz encoding
binmode($fout, ':utf8');

# print $fout 'digraph family { graph [rankdir=LR];';
# Best to agree with the colour in css/web.css
# print $fout 'digraph family { bgcolor="#d6d6d6"',
Expand Down Expand Up @@ -14518,7 +14524,7 @@ sub wide_to_xml
# print STDERR "\n";

# utf8::decode($string);

$string =~ s/['\x98]/&#039;/g;
$string =~ s/©/&#x0A9;/g;
$string =~ s/®/&#x0AE;/g;
Expand Down

0 comments on commit 6496cfa

Please sign in to comment.