summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Module/FamilyTreeStatisticsModule.php3
-rw-r--r--app/Statistics.php18
-rw-r--r--app/Statistics/Repository/FamilyRepository.php4
-rw-r--r--resources/views/modules/gedcom_stats/statistics.phtml49
-rw-r--r--resources/views/modules/statistics-chart/age-difference.phtml (renamed from resources/views/statistics/families/age-difference.phtml)10
-rw-r--r--resources/views/modules/statistics-chart/birth-age.phtml57
-rw-r--r--resources/views/modules/statistics-chart/children.phtml (renamed from resources/views/statistics/families/children.phtml)14
-rw-r--r--resources/views/modules/statistics-chart/custom.phtml2
-rw-r--r--resources/views/modules/statistics-chart/families.phtml12
-rw-r--r--resources/views/modules/statistics-chart/family-totals.phtml (renamed from resources/views/statistics/families/total-records.phtml)21
-rw-r--r--resources/views/modules/statistics-chart/greatest-age.phtml (renamed from resources/views/statistics/individuals/greatest-age.phtml)6
-rw-r--r--resources/views/modules/statistics-chart/individuals.phtml12
-rw-r--r--resources/views/modules/statistics-chart/lifespan.phtml (renamed from resources/views/statistics/individuals/lifespan.phtml)10
-rw-r--r--resources/views/modules/statistics-chart/marriage-age.phtml64
-rw-r--r--resources/views/modules/statistics-chart/marriage-length.phtml35
-rw-r--r--resources/views/modules/statistics-chart/names.phtml (renamed from resources/views/statistics/individuals/names.phtml)10
-rw-r--r--resources/views/modules/statistics-chart/oldest-living.phtml (renamed from resources/views/statistics/individuals/oldest-living.phtml)6
-rw-r--r--resources/views/modules/statistics-chart/total-events.phtml (renamed from resources/views/statistics/individuals/total-events.phtml)18
-rw-r--r--resources/views/modules/statistics-chart/total-individuals.phtml (renamed from resources/views/statistics/individuals/total-records.phtml)16
-rw-r--r--resources/views/statistics/families/birth-age.phtml95
-rw-r--r--resources/views/statistics/families/marriage-age.phtml102
-rw-r--r--resources/views/statistics/families/marriage-length.phtml55
22 files changed, 252 insertions, 367 deletions
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php
index 8e255d0750..c2e27e355f 100644
--- a/app/Module/FamilyTreeStatisticsModule.php
+++ b/app/Module/FamilyTreeStatisticsModule.php
@@ -177,10 +177,11 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn
'stat_avg_life' => $stat_avg_life,
'stat_most_chil' => $stat_most_chil,
'stat_avg_chil' => $stat_avg_chil,
- 'stats' => $statistics,
'surnames' => $surnames,
]);
+ $content = $statistics->embedTags($content);
+
if ($context !== self::CONTEXT_EMBED) {
return view('modules/block-template', [
'block' => Str::kebab($this->name()),
diff --git a/app/Statistics.php b/app/Statistics.php
index 1959da5db5..3b84c4902f 100644
--- a/app/Statistics.php
+++ b/app/Statistics.php
@@ -1268,33 +1268,33 @@ class Statistics implements
}
/**
- * @param bool $show_years
+ * @param string $show_years
*
* @return string
*/
- public function averageLifespan(bool $show_years = false): string
+ public function averageLifespan(string $show_years = ''): string
{
- return $this->individual_repository->averageLifespan($show_years);
+ return $this->individual_repository->averageLifespan((bool) $show_years);
}
/**
- * @param bool $show_years
+ * @param string $show_years
*
* @return string
*/
- public function averageLifespanFemale(bool $show_years = false): string
+ public function averageLifespanFemale(string $show_years = ''): string
{
- return $this->individual_repository->averageLifespanFemale($show_years);
+ return $this->individual_repository->averageLifespanFemale((bool) $show_years);
}
/**
- * @param bool $show_years
+ * @param string $show_years
*
* @return string
*/
- public function averageLifespanMale(bool $show_years = false): string
+ public function averageLifespanMale(string $show_years = ''): string
{
- return $this->individual_repository->averageLifespanMale($show_years);
+ return $this->individual_repository->averageLifespanMale((bool) $show_years);
}
/**
diff --git a/app/Statistics/Repository/FamilyRepository.php b/app/Statistics/Repository/FamilyRepository.php
index 864cd422d6..7b88261e04 100644
--- a/app/Statistics/Repository/FamilyRepository.php
+++ b/app/Statistics/Repository/FamilyRepository.php
@@ -848,7 +848,7 @@ class FamilyRepository
->first();
if ($row === null) {
- return '';
+ return I18N::translate('This information is not available.');
}
$person = Registry::individualFactory()->make($row->id, $this->tree);
@@ -1498,7 +1498,7 @@ class FamilyRepository
->first();
if ($row === null) {
- return '';
+ return I18N::translate('This information is not available.');
}
$family = Registry::familyFactory()->make($row->famid, $this->tree);
diff --git a/resources/views/modules/gedcom_stats/statistics.phtml b/resources/views/modules/gedcom_stats/statistics.phtml
index b52dc83e6b..e26f49760c 100644
--- a/resources/views/modules/gedcom_stats/statistics.phtml
+++ b/resources/views/modules/gedcom_stats/statistics.phtml
@@ -5,7 +5,6 @@ use Fisharebest\Webtrees\Statistics;
/**
* @var string $show_last_update
- * @var Statistics $stats
* @var string $stat_indi
* @var string $stat_surname
* @var string $stat_fam
@@ -29,7 +28,7 @@ use Fisharebest\Webtrees\Statistics;
<?php if ($show_last_update) : ?>
<p class="card-text">
- <?= I18N::translate('This family tree was last updated on %s.', strip_tags($stats->gedcomUpdated())) ?>
+ <?= I18N::translate('This family tree was last updated on %s.', '#gedcomUpdated#') ?>
</p>
<?php endif ?>
@@ -46,7 +45,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Individuals') ?>
</th>
<td>
- <?= $stats->totalIndividuals() ?>
+ #totalIndividuals#
</td>
</tr>
@@ -55,9 +54,9 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Males') ?>
</th>
<td>
- <?= $stats->totalSexMales() ?>
+ #totalSexMales#
<br>
- <?= $stats->totalSexMalesPercentage() ?>
+ #totalSexMalesPercentage#
</td>
</tr>
@@ -66,9 +65,9 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Females') ?>
</th>
<td>
- <?= $stats->totalSexFemales() ?>
+ #totalSexFemales#
<br>
- <?= $stats->totalSexFemalesPercentage() ?>
+ #totalSexFemalesPercentage#
</td>
</tr>
<?php endif ?>
@@ -79,7 +78,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Surnames') ?>
</th>
<td>
- <?= $stats->totalSurnames() ?>
+ #totalSurnames#
</td>
</tr>
<?php endif ?>
@@ -90,7 +89,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Families') ?>
</th>
<td>
- <?= $stats->totalFamilies() ?>
+ #totalFamilies#
</td>
</tr>
<?php endif ?>
@@ -102,7 +101,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Sources') ?>
</th>
<td>
- <?= $stats->totalSources() ?>
+ #totalSources#
</td>
</tr>
<?php endif ?>
@@ -113,7 +112,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Media objects') ?>
</th>
<td>
- <?= $stats->totalMedia() ?>
+ #totalMedia#
</td>
</tr>
<?php endif ?>
@@ -124,7 +123,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Repositories') ?>
</th>
<td>
- <?= $stats->totalRepositories() ?>
+ #totalRepositories#
</td>
</tr>
<?php endif ?>
@@ -135,7 +134,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Events') ?>
</th>
<td>
- <?= $stats->totalEvents() ?>
+ #totalEvents#
</td>
</tr>
<?php endif ?>
@@ -146,7 +145,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Users') ?>
</th>
<td>
- <?= $stats->totalUsers() ?>
+ #totalUsers#
</td>
</tr>
<?php endif ?>
@@ -167,7 +166,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest birth') ?>
</th>
<td>
- <?= $stats->firstBirth() ?>
+ #firstBirth#
</td>
</tr>
<?php endif ?>
@@ -178,7 +177,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest birth') ?>
</th>
<td>
- <?= $stats->lastBirth() ?>
+ #lastBirth#
</td>
</tr>
<?php endif ?>
@@ -189,7 +188,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest death') ?>
</th>
<td>
- <?= $stats->firstDeath() ?>
+ #firstDeath#
</td>
</tr>
<?php endif ?>
@@ -200,7 +199,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest death') ?>
</th>
<td>
- <?= $stats->lastDeath() ?>
+ #lastDeath#
</td>
</tr>
<?php endif ?>
@@ -211,7 +210,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Individual who lived the longest') ?>
</th>
<td>
- <?= $stats->longestLife() ?>
+ #longestLife#
</td>
</tr>
<?php endif ?>
@@ -222,11 +221,11 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Average age at death') ?>
</th>
<td>
- <?= $stats->averageLifespan() ?>
+ #averageLifespan#
<br>
- <?= I18N::translate('Males') ?>:&nbsp;<?= $stats->averageLifespanMale() ?>
+ <?= I18N::translate('Males') ?>: #averageLifespanMale#
<br>
- <?= I18N::translate('Females') ?>&nbsp;<?= $stats->averageLifespanFemale() ?>
+ <?= I18N::translate('Females') ?>: #averageLifespanFemale#
</td>
</tr>
<?php endif ?>
@@ -237,9 +236,9 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Family with the most children') ?>
</th>
<td>
- <?= e($stats->largestFamilySize()) ?>
+ #largestFamilySize#
<br>
- <?= $stats->largestFamily() ?>
+ #largestFamily#
</td>
</tr>
<?php endif ?>
@@ -250,7 +249,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Average number of children per family') ?>
</th>
<td>
- <?= $stats->averageChildren() ?>
+ #averageChildren#
</td>
</tr>
<?php endif ?>
diff --git a/resources/views/statistics/families/age-difference.phtml b/resources/views/modules/statistics-chart/age-difference.phtml
index a595c65912..987b15b30a 100644
--- a/resources/views/statistics/families/age-difference.phtml
+++ b/resources/views/modules/statistics-chart/age-difference.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -18,7 +16,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Age between siblings') ?>
</h5>
- <?= $stats->topAgeBetweenSiblingsList() ?>
+ #topAgeBetweenSiblingsList#
</div>
</div>
@@ -28,7 +26,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Greatest age between siblings') ?>
</h5>
<div class="card-body">
- <?= $stats->topAgeBetweenSiblingsFullName() ?>
+ #topAgeBetweenSiblingsFullName#
</div>
</div>
</div>
@@ -38,7 +36,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Age between husband and wife') ?>
</h5>
- <?= $stats->ageBetweenSpousesMFList() ?>
+ #ageBetweenSpousesMFList#
</div>
</div>
@@ -47,7 +45,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Age between wife and husband') ?>
</h5>
- <?= $stats->ageBetweenSpousesFMList() ?>
+ #ageBetweenSpousesFMList#
</div>
</div>
</div>
diff --git a/resources/views/modules/statistics-chart/birth-age.phtml b/resources/views/modules/statistics-chart/birth-age.phtml
new file mode 100644
index 0000000000..8e4748d13c
--- /dev/null
+++ b/resources/views/modules/statistics-chart/birth-age.phtml
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+use Fisharebest\Webtrees\I18N;
+
+?>
+
+<h4 class="border-bottom p-2 mb-4">
+ <?= I18N::translate('Age at birth of child') ?>
+</h4>
+
+<div class="row row-cols-1 row-cols-md-2 g-3 mb-3">
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Youngest father') ?> — #youngestFatherAge:1#
+ </h5>
+ <div class="card-body">
+ #youngestFather#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Youngest mother') ?> — #youngestMotherAge:1#
+ </h5>
+ <div class="card-body">
+ #youngestMother#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Oldest father') ?> — #oldestFatherAge:1#
+ </h5>
+ <div class="card-body">
+ #oldestFather#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Oldest mother') ?> — #oldestMotherAge:1#
+ </h5>
+ <div class="card-body">
+ #oldestMother#
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/statistics/families/children.phtml b/resources/views/modules/statistics-chart/children.phtml
index a35ced39da..3220a5068f 100644
--- a/resources/views/statistics/families/children.phtml
+++ b/resources/views/modules/statistics-chart/children.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -17,10 +15,10 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header">
<?= I18N::translate('Average number of children per family') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->averageChildren() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#averageChildren#</span>
</h5>
<div class="card-body">
- <?= $stats->statsChildren() ?>
+ #statsChildren#
</div>
</div>
</div>
@@ -29,10 +27,10 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header">
<?= I18N::translate('Number of families without children') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->noChildrenFamilies() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#noChildrenFamilies#</span>
</h5>
<div class="card-body">
- <?= $stats->chartNoChildrenFamilies() ?>
+ #chartNoChildrenFamilies#
</div>
</div>
</div>
@@ -42,7 +40,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Largest families') ?>
</h5>
- <?= $stats->topTenLargestFamilyList() ?>
+ #topTenLargestFamilyList#
</div>
</div>
@@ -51,7 +49,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Largest number of grandchildren') ?>
</h5>
- <?= $stats->topTenLargestGrandFamilyList() ?>
+ #topTenLargestGrandFamilyList#
</div>
</div>
</div>
diff --git a/resources/views/modules/statistics-chart/custom.phtml b/resources/views/modules/statistics-chart/custom.phtml
index fa979a9be8..7fa14ca195 100644
--- a/resources/views/modules/statistics-chart/custom.phtml
+++ b/resources/views/modules/statistics-chart/custom.phtml
@@ -8,7 +8,7 @@ use Fisharebest\Webtrees\View;
/**
* @var StatisticsChartModule $module
- * @var Tree $tree
+ * @var Tree $tree
*/
?>
diff --git a/resources/views/modules/statistics-chart/families.phtml b/resources/views/modules/statistics-chart/families.phtml
index 8623774ca6..f19c605aa8 100644
--- a/resources/views/modules/statistics-chart/families.phtml
+++ b/resources/views/modules/statistics-chart/families.phtml
@@ -9,10 +9,10 @@ use Fisharebest\Webtrees\Statistics;
?>
<div class="container pt-3">
- <?= view('statistics/families/total-records', ['stats' => $stats]) ?>
- <?= view('statistics/families/marriage-length', ['stats' => $stats]) ?>
- <?= view('statistics/families/marriage-age', ['stats' => $stats]) ?>
- <?= view('statistics/families/birth-age', ['stats' => $stats]) ?>
- <?= view('statistics/families/children', ['stats' => $stats]) ?>
- <?= view('statistics/families/age-difference', ['stats' => $stats]) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/family-totals')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/marriage-length')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/marriage-age')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/birth-age')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/children')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/age-difference')) ?>
</div>
diff --git a/resources/views/statistics/families/total-records.phtml b/resources/views/modules/statistics-chart/family-totals.phtml
index 9facb45e8d..3af9db7238 100644
--- a/resources/views/statistics/families/total-records.phtml
+++ b/resources/views/modules/statistics-chart/family-totals.phtml
@@ -3,15 +3,12 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
<?= I18N::translate('Total families') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalFamilies() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalFamilies#</span>
</h4>
<div class="row mb-3 row-cols-1 row-cols-lg-2 g-3">
@@ -20,7 +17,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total marriages') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalMarriages() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalMarriages#</span>
</h5>
</div>
@@ -29,7 +26,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Marriages by century') ?>
</h5>
<div class="card-body">
- <?= $stats->statsMarr() ?>
+ #statsMarr#
</div>
</div>
@@ -40,7 +37,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest marriage') ?>
</h5>
<div class="card-body">
- <?= $stats->firstMarriage() ?>
+ #firstMarriage#
</div>
</div>
</div>
@@ -51,7 +48,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest marriage') ?>
</h5>
<div class="card-body">
- <?= $stats->lastMarriage() ?>
+ #lastMarriage#
</div>
</div>
</div>
@@ -64,7 +61,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card m-0">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total divorces') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalDivorces() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalDivorces#</span>
</h5>
</div>
@@ -73,7 +70,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Divorces by century') ?>
</h5>
<div class="card-body">
- <?= $stats->statsDiv() ?>
+ #statsDiv#
</div>
</div>
@@ -84,7 +81,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest divorce') ?>
</h5>
<div class="card-body">
- <?= $stats->firstDivorce() ?>
+ #firstDivorce#
</div>
</div>
</div>
@@ -95,7 +92,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest divorce') ?>
</h5>
<div class="card-body">
- <?= $stats->lastDivorce() ?>
+ #lastDivorce#
</div>
</div>
</div>
diff --git a/resources/views/statistics/individuals/greatest-age.phtml b/resources/views/modules/statistics-chart/greatest-age.phtml
index 7b5abc28af..cbd7af4466 100644
--- a/resources/views/statistics/individuals/greatest-age.phtml
+++ b/resources/views/modules/statistics-chart/greatest-age.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -18,7 +16,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Males') ?>
</h5>
- <?= $stats->topTenOldestMaleList() ?>
+ #topTenOldestMaleList#
</div>
</div>
@@ -27,7 +25,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Females') ?>
</h5>
- <?= $stats->topTenOldestFemaleList() ?>
+ #topTenOldestFemaleList#
</div>
</div>
</div> \ No newline at end of file
diff --git a/resources/views/modules/statistics-chart/individuals.phtml b/resources/views/modules/statistics-chart/individuals.phtml
index a394fcd3fb..a0e617656a 100644
--- a/resources/views/modules/statistics-chart/individuals.phtml
+++ b/resources/views/modules/statistics-chart/individuals.phtml
@@ -9,10 +9,10 @@ use Fisharebest\Webtrees\Statistics;
?>
<div class="container pt-3">
- <?= view('statistics/individuals/total-records', ['stats' => $stats]) ?>
- <?= view('statistics/individuals/total-events', ['stats' => $stats]) ?>
- <?= view('statistics/individuals/lifespan', ['stats' => $stats]) ?>
- <?= view('statistics/individuals/greatest-age', ['stats' => $stats]) ?>
- <?= view('statistics/individuals/oldest-living', ['stats' => $stats]) ?>
- <?= view('statistics/individuals/names', ['stats' => $stats]) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/total-individuals')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/total-events')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/lifespan')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/greatest-age')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/oldest-living')) ?>
+ <?= $stats->embedTags(view('modules/statistics-chart/names')) ?>
</div>
diff --git a/resources/views/statistics/individuals/lifespan.phtml b/resources/views/modules/statistics-chart/lifespan.phtml
index 39f27b2bec..945166299c 100644
--- a/resources/views/statistics/individuals/lifespan.phtml
+++ b/resources/views/modules/statistics-chart/lifespan.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -17,7 +15,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Average age at death') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->averageLifespan(true) ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#averageLifespan:1#</span>
</h5>
</div>
@@ -26,7 +24,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Males') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->averageLifespanMale(true) ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#averageLifespanMale:1#</span>
</h5>
</div>
</div>
@@ -35,7 +33,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Females') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->averageLifespanFemale(true) ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#averageLifespanFemale:1#</span>
</h5>
</div>
</div>
@@ -43,7 +41,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card m-0">
<div class="card-body">
- <?= $stats->statsAge() ?>
+ #statsAge() ?>
</div>
</div>
</div>
diff --git a/resources/views/modules/statistics-chart/marriage-age.phtml b/resources/views/modules/statistics-chart/marriage-age.phtml
new file mode 100644
index 0000000000..c69a02dae8
--- /dev/null
+++ b/resources/views/modules/statistics-chart/marriage-age.phtml
@@ -0,0 +1,64 @@
+<?php
+
+declare(strict_types=1);
+
+use Fisharebest\Webtrees\I18N;
+
+?>
+
+<h4 class="border-bottom p-2 mb-4">
+ <?= I18N::translate('Age in year of marriage') ?>
+</h4>
+
+<div class="d-grid gap-3 mb-3">
+ <div class="row row-cols-1 row-cols-md-2 g-3">
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Youngest male') ?> — #youngestMarriageMaleAge:1#
+ </h5>
+ <div class="card-body">
+ #youngestMarriageMale#
+ </div>
+ </div>
+ </div>
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Youngest female') ?> — #youngestMarriageFemaleAge:1#
+ </h5>
+ <div class="card-body">
+ #youngestMarriageFemale#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Oldest male') ?> — #oldestMarriageMaleAge:1#
+ </h5>
+ <div class="card-body">
+ #oldestMarriageMale#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Oldest female') ?> — #oldestMarriageFemaleAge:1#
+ </h5>
+ <div class="card-body">
+ #oldestMarriageFemale#
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="card m-0">
+ <div class="card-body">
+ #statsMarrAge#
+ </div>
+ </div>
+</div>
diff --git a/resources/views/modules/statistics-chart/marriage-length.phtml b/resources/views/modules/statistics-chart/marriage-length.phtml
new file mode 100644
index 0000000000..276b6a5b3f
--- /dev/null
+++ b/resources/views/modules/statistics-chart/marriage-length.phtml
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+use Fisharebest\Webtrees\I18N;
+
+?>
+
+<h4 class="border-bottom p-2 mb-4">
+ <?= I18N::translate('Length of marriage') ?>
+</h4>
+
+<div class="row row-cols-1 row-cols-md-2 g-3 mb-3">
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Longest marriage') ?> — #topAgeOfMarriage#
+ </h5>
+ <div class="card-body">
+ #topAgeOfMarriageFamily#
+ </div>
+ </div>
+ </div>
+
+ <div class="col">
+ <div class="card">
+ <h5 class="card-header">
+ <?= I18N::translate('Shortest marriage') ?> — #minAgeOfMarriage#
+ </h5>
+ <div class="card-body">
+ #minAgeOfMarriageFamily#
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/statistics/individuals/names.phtml b/resources/views/modules/statistics-chart/names.phtml
index 98fb4573d7..69e46de93b 100644
--- a/resources/views/statistics/individuals/names.phtml
+++ b/resources/views/modules/statistics-chart/names.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -18,7 +16,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total surnames') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalSurnames() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalSurnames#</span>
</h5>
</div>
@@ -27,7 +25,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Top surnames') ?>
</h5>
<div class="card-body">
- <?= $stats->chartCommonSurnames() ?>
+ #chartCommonSurnames#
</div>
</div>
</div>
@@ -38,7 +36,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total given names') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalGivennames() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalGivennames#</span>
</h5>
</div>
@@ -47,7 +45,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Top given names') ?>
</h5>
<div class="card-body">
- <?= $stats->chartCommonGiven() ?>
+ #chartCommonGiven#
</div>
</div>
</div>
diff --git a/resources/views/statistics/individuals/oldest-living.phtml b/resources/views/modules/statistics-chart/oldest-living.phtml
index 9a320abd45..8f2014ccd2 100644
--- a/resources/views/statistics/individuals/oldest-living.phtml
+++ b/resources/views/modules/statistics-chart/oldest-living.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -18,7 +16,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Males') ?>
</h5>
- <?= $stats->topTenOldestMaleListAlive() ?>
+ #topTenOldestMaleListAlive#
</div>
</div>
@@ -27,7 +25,7 @@ use Fisharebest\Webtrees\Statistics;
<h5 class="card-header">
<?= I18N::translate('Females') ?>
</h5>
- <?= $stats->topTenOldestFemaleListAlive() ?>
+ #topTenOldestFemaleListAlive#
</div>
</div>
</div>
diff --git a/resources/views/statistics/individuals/total-events.phtml b/resources/views/modules/statistics-chart/total-events.phtml
index 8ed83cd2c6..89c86853e2 100644
--- a/resources/views/statistics/individuals/total-events.phtml
+++ b/resources/views/modules/statistics-chart/total-events.phtml
@@ -3,9 +3,7 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
@@ -18,7 +16,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total births') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalBirths() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalBirths#</span>
</h5>
</div>
@@ -27,7 +25,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Births by century') ?>
</h5>
<div class="card-body">
- <?= $stats->statsBirth() ?>
+ #statsBirth#
</div>
</div>
@@ -38,7 +36,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest birth') ?>
</h5>
<div class="card-body">
- <?= $stats->firstBirth() ?>
+ #firstBirth#
</div>
</div>
</div>
@@ -49,7 +47,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest birth') ?>
</h5>
<div class="card-body">
- <?= $stats->lastBirth() ?>
+ #lastBirth#
</div>
</div>
</div>
@@ -62,7 +60,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total deaths') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalDeaths() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalDeaths#</span>
</h5>
</div>
@@ -71,7 +69,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Deaths by century') ?>
</h5>
<div class="card-body">
- <?= $stats->statsDeath() ?>
+ #statsDeath#
</div>
</div>
@@ -82,7 +80,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Earliest death') ?>
</h5>
<div class="card-body">
- <?= $stats->firstDeath() ?>
+ #firstDeath#
</div>
</div>
</div>
@@ -93,7 +91,7 @@ use Fisharebest\Webtrees\Statistics;
<?= I18N::translate('Latest death') ?>
</h5>
<div class="card-body">
- <?= $stats->lastDeath() ?>
+ #lastDeath#
</div>
</div>
</div>
diff --git a/resources/views/statistics/individuals/total-records.phtml b/resources/views/modules/statistics-chart/total-individuals.phtml
index 6a4e9af007..fcac41e133 100644
--- a/resources/views/statistics/individuals/total-records.phtml
+++ b/resources/views/modules/statistics-chart/total-individuals.phtml
@@ -3,14 +3,12 @@
declare(strict_types=1);
use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-/** @var Statistics $stats */
?>
<h4 class="border-bottom p-2 mb-4">
<?= I18N::translate('Total individuals') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalIndividuals() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalIndividuals#</span>
</h4>
<div class="row mb-3 row-cols-1 row-cols-lg-2 g-3">
@@ -21,7 +19,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total males') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalSexMales() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalSexMales#</span>
</h5>
</div>
</div>
@@ -30,14 +28,14 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total females') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalSexFemales() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalSexFemales#</span>
</h5>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
- <?= $stats->chartSex() ?>
+ #chartSex#
</div>
</div>
</div>
@@ -50,7 +48,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total living') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalLiving() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalLiving#</span>
</h5>
</div>
</div>
@@ -59,7 +57,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<h5 class="card-header border-bottom-0">
<?= I18N::translate('Total dead') ?>
- <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalDeceased() ?></span>
+ <span class="badge bg-secondary rounded-pill float-end">#totalDeceased#</span>
</h5>
</div>
</div>
@@ -67,7 +65,7 @@ use Fisharebest\Webtrees\Statistics;
<div class="card">
<div class="card-body">
- <?= $stats->chartMortality() ?>
+ #chartMortality#
</div>
</div>
</div>
diff --git a/resources/views/statistics/families/birth-age.phtml b/resources/views/statistics/families/birth-age.phtml
deleted file mode 100644
index f6c992bbe0..0000000000
--- a/resources/views/statistics/families/birth-age.phtml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-
-/** @var Statistics $stats */
-?>
-
-<h4 class="border-bottom p-2 mb-4">
- <?= I18N::translate('Age at birth of child') ?>
-</h4>
-
-<div class="row row-cols-1 row-cols-md-2 g-3 mb-3">
- <div class="col">
- <div class="card">
- <?php $age = $stats->youngestFatherAge('1') ?>
- <?php $result = $stats->youngestFather() ?>
- <h5 class="card-header">
- <?= I18N::translate('Youngest father') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->youngestMotherAge('1') ?>
- <?php $result = $stats->youngestMother() ?>
- <h5 class="card-header">
- <?= I18N::translate('Youngest mother') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->oldestFatherAge('1') ?>
- <?php $result = $stats->oldestFather() ?>
- <h5 class="card-header">
- <?= I18N::translate('Oldest father') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->oldestMotherAge('1') ?>
- <?php $result = $stats->oldestMother() ?>
- <h5 class="card-header">
- <?= I18N::translate('Oldest mother') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-</div>
diff --git a/resources/views/statistics/families/marriage-age.phtml b/resources/views/statistics/families/marriage-age.phtml
deleted file mode 100644
index e660b78af9..0000000000
--- a/resources/views/statistics/families/marriage-age.phtml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-
-/** @var Statistics $stats */
-?>
-
-<h4 class="border-bottom p-2 mb-4">
- <?= I18N::translate('Age in year of marriage') ?>
-</h4>
-
-<div class="d-grid gap-3 mb-3">
- <div class="row row-cols-1 row-cols-md-2 g-3">
- <div class="col">
- <div class="card">
- <?php $age = $stats->youngestMarriageMaleAge('1') ?>
- <?php $result = $stats->youngestMarriageMale() ?>
- <h5 class="card-header">
- <?= I18N::translate('Youngest male') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card">
- <?php $age = $stats->youngestMarriageFemaleAge('1') ?>
- <?php $result = $stats->youngestMarriageFemale() ?>
- <h5 class="card-header">
- <?= I18N::translate('Youngest female') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->oldestMarriageMaleAge('1') ?>
- <?php $result = $stats->oldestMarriageMale() ?>
- <h5 class="card-header">
- <?= I18N::translate('Oldest male') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->oldestMarriageFemaleAge('1') ?>
- <?php $result = $stats->oldestMarriageFemale() ?>
- <h5 class="card-header">
- <?= I18N::translate('Oldest female') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
- </div>
-
- <div class="card m-0">
- <div class="card-body">
- <?= $stats->statsMarrAge() ?>
- </div>
- </div>
-</div>
diff --git a/resources/views/statistics/families/marriage-length.phtml b/resources/views/statistics/families/marriage-length.phtml
deleted file mode 100644
index 972c56d420..0000000000
--- a/resources/views/statistics/families/marriage-length.phtml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Statistics;
-
-/** @var Statistics $stats */
-?>
-
-<h4 class="border-bottom p-2 mb-4">
- <?= I18N::translate('Length of marriage') ?>
-</h4>
-
-<div class="row row-cols-1 row-cols-md-2 g-3 mb-3">
- <div class="col">
- <div class="card">
- <?php $age = $stats->topAgeOfMarriage() ?>
- <?php $result = $stats->topAgeOfMarriageFamily() ?>
- <h5 class="card-header">
- <?= I18N::translate('Longest marriage') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <div class="col">
- <div class="card">
- <?php $age = $stats->minAgeOfMarriage() ?>
- <?php $result = $stats->minAgeOfMarriageFamily() ?>
- <h5 class="card-header">
- <?= I18N::translate('Shortest marriage') ?>
- <?php if ($age) :
- ?><?= ' - ', $age ?><?php
- endif; ?>
- </h5>
- <div class="card-body">
- <?php if ($result) : ?>
- <?= $result ?>
- <?php else : ?>
- <?= I18N::translate('This information is not available.') ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
-</div>