Skip to content

Commit

Permalink
Better warning if a child is born before a person
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 22, 2024
1 parent 7c115e2 commit 8d6af31
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
These differences could cause anomolies.
</p>
[% ELSE %]
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<center>
<a href="?page=graphs&graph=ageatdeath" class="myButton">Average age at death</a><br><br>
<a href="?page=graphs&graph=birthmonth" class="myButton">Month of Birth</a><br><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
[% END %]
</div>
[% ELSE %]
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<ul>
<li><a href="?page=graphs&graph=birthmonth">Month of birth</a></li>
<li><a href="?page=graphs&graph=marriagemonth">Month of marriage</a></li>
Expand Down
2 changes: 1 addition & 1 deletion dynamic-site/templates/de/web/Ged2site/Display/graphs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
</div>
[% ELSE %]
<div id="container">
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<br>
<ul id="nav">
<li><a href="?page=graphs&amp;graph=birthmonth">Month of birth</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
<p align="right">
<i>
Generated by <a href="https://github.com/nigelhorne/ged2site">ged2site</a>.
Last updated on Jul 22, 2016
[% IF updated %]
[% USE date %]
Last updated on [% date.format(time = updated, format = '%d %b %Y', locale = lingua.language_code_alpha2) %]
[% END %]
</i>
</p>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
[% END %]
</div>
[% ELSE %]
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<center>
<a href="?page=graphs&graph=ageatdeath" class="myButton">Average age at death</a><br><br>
<a href="?page=graphs&graph=birthmonth" class="myButton">Month of Birth</a><br><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
[% ELSE %]
<title>Calendar of [% SiteTitle.join(' ') %]</title>
[% END %]
<meta name="Copyright" content="Copyright (C) 2022 Nigel Horne">
<meta name="Copyright" content="Copyright (C) 2024 Nigel Horne">
<meta http-equiv="Content-Language" content="English">
<meta name="description" content="Display the genealogy calendar of [% SiteTitle.join(' ') %] in [% month %] [% year %] - A ged2site webpage">
<!--
<meta name="msvalidate.01" content="deadbeef" />
-->
Expand All @@ -22,7 +23,7 @@
[% IF error %]
<p><font color="red" size="+2">[% error %]</font></p>
[% END %]
<a href="?page=people&home=1">Home</a><br>
<a href="?page=people&amp;home=1">Home</a><br>
<a href="?page=censuses">Census Index</a><br>
<a href="?page=surnames">Surname Index</a><br>
<a href="?page=history">Family History</a><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
[% ELSIF surname_date %]
<p>Show the popularity of surnames over the years</p>
[% ELSE %]
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<ul>
<li><a href="?page=graphs&amp;graph=birthmonth">Month of birth</a></li>
<li><a href="?page=graphs&graph=marriagemonth">Month of marriage</a></li>
Expand Down
2 changes: 2 additions & 0 deletions dynamic-site/templates/en/web/Ged2site/Display/calendar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
[% ELSE %]
<title>Calendar of [% SiteTitle.join(' ') %]</title>
[% END %]
<meta name="Copyright" content="Copyright (C) 2024 Nigel Horne">
<meta http-equiv="Content-Language" content="English">
<meta name="description" content="Display the genealogy calendar of [% SiteTitle.join(' ') %] in [% month %] [% year %] - A ged2site webpage">
<!--
<meta name="msvalidate.01" content="deadbeef" />
-->
Expand Down
2 changes: 1 addition & 1 deletion dynamic-site/templates/en/web/Ged2site/Display/graphs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
</div>
[% ELSE %]
<div id="container">
<h2>Choose a Graph</h2>
<h1>Choose a Graph</h1>
<br>
<ul id="nav">
<li><a href="?page=graphs&amp;graph=birthmonth">Month of birth</a></li>
Expand Down
6 changes: 3 additions & 3 deletions dynamic-site/templates/fr/mobile/Ged2site/Display/graphs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
[% SET title = 'Country of Birth' %]
[% ELSE %]
<link rel="stylesheet" href="/css/mobile.css" type="text/css" media="screen">
[% SET title = 'Choose a graph' %]
[% SET title = 'Choissisez un carte' %]
[% END %]
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>[% title %]</title>
Expand Down Expand Up @@ -195,9 +195,9 @@
These differences could cause anomolies.
</p>
[% ELSE %]
<h2>Choissisez un carte</h2>
<h1>Choissisez un carte</h1>
<center>
<a href="?page=graphs&graph=ageatdeath" class="myButton">Le moyen &acirc;ge &agrave; la mort</a><br><br>
<a href="?page=graphs&amp;graph=ageatdeath" class="myButton">Le moyen &acirc;ge &agrave; la mort</a><br><br>
<a href="?page=graphs&graph=birthmonth" class="myButton">Month of Birth</a><br><br>
<a href="?page=graphs&graph=marriagemonth" class="myButton">Month of Marriage</a><br><br>
<a href="?page=graphs&graph=deathmonth" class="myButton">Month of Death</a><br><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[% END %]
<meta name="Copyright" content="Copyright (C) 2022 Nigel Horne">
<meta http-equiv="Content-Language" content="English">
<meta name="description" content="Display the genealogy calendar of [% SiteTitle.join(' ') %] dans [% month %] [% year %] - A ged2site webpage">
<!--
<meta name="msvalidate.01" content="deadbeef" />
-->
Expand Down
11 changes: 7 additions & 4 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,6 @@ foreach my $person(@everyone) {
$| = 0;
}
if(!$printed{$person->xref()}) {
# FIXME: change &eacute; to e
print $xml "\n\t<person person_id=\"$index\">";
print_person({ person => $person });
print $xml "\n\t</person>";
Expand Down Expand Up @@ -1688,6 +1687,8 @@ if($opts{'w'}) {
$summary = 'Child born before date of death';
} elsif($warning =~ / assuming country of birth is /) {
$summary = 'Guessed at country of birth';
} elsif($warning =~ /but the addresses don't match or aren't detailed enough to be sure$/) {
$summary = 'Unsure if living with parent in childhood or not';
} else {
$summary = $warning;
$summary =~ s/\"//g;
Expand Down Expand Up @@ -2093,7 +2094,7 @@ sub print_person

my $filename = File::Spec->catfile('static-site', make_filename_from_person(person => $person));
if(-e $filename) {
die "FIXME: ensure filenames are unique ($filename)";
die "BUG: ensure filenames are unique ($filename)";
}
open(my $html, '>', $filename);
print $html "<html><head><title>$title</title>";
Expand Down Expand Up @@ -4061,7 +4062,9 @@ sub print_person
}
if($opts{'w'} && $yob && (my $cdob = dateofbirth($child))) {
my $age = get_year_from_date($cdob) - $yob;
if($age <= 14) {
if($age < 0) {
complain({ person => $person, warning => 'Child ' . $child->as_string() . " $cdob which is before date of birth of $yob" });
} elsif($age <= 14) {
complain({ person => $person, warning => "Only $age years old at time of birth of their child " . $child->as_string() });
}
}
Expand Down Expand Up @@ -14804,7 +14807,7 @@ sub dbpedia
my $birth_dt = $params{'birth_dt'};
my $yob = $params{'yob'};

if(defined($birth_dt) && $birth_dt) {
if(defined($birth_dt)) {
if(!ref($birth_dt)) {
print STDERR "\n";
my $i = 0;
Expand Down

0 comments on commit 8d6af31

Please sign in to comment.