From c908635b89a84d0a06f38a4d07640639e838703f Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Sat, 19 Mar 2022 10:15:27 +0000 Subject: Use placeholders to generate statistics pages --- app/Statistics/Repository/PlaceRepository.php | 2 +- .../statistics-chart/chart-distribution.phtml | 1 + .../modules/statistics-chart/chart-objects.phtml | 21 +++++ .../modules/statistics-chart/chart-sources.phtml | 37 ++++++++ .../statistics-chart/individual-events.phtml | 101 +++++++++++++++++++++ .../modules/statistics-chart/individuals.phtml | 2 +- .../modules/statistics-chart/other-events.phtml | 36 ++++++++ .../modules/statistics-chart/other-records.phtml | 50 ++++++++++ .../views/modules/statistics-chart/other.phtml | 12 +-- .../views/modules/statistics-chart/places.phtml | 50 ++++++++++ .../modules/statistics-chart/total-events.phtml | 101 --------------------- .../statistics/other/chart-distribution.phtml | 11 --- .../views/statistics/other/chart-objects.phtml | 23 ----- .../views/statistics/other/chart-sources.phtml | 39 -------- resources/views/statistics/other/places.phtml | 59 ------------ .../views/statistics/other/total-events.phtml | 48 ---------- .../views/statistics/other/total-records.phtml | 52 ----------- 17 files changed, 304 insertions(+), 341 deletions(-) create mode 100644 resources/views/modules/statistics-chart/chart-distribution.phtml create mode 100644 resources/views/modules/statistics-chart/chart-objects.phtml create mode 100644 resources/views/modules/statistics-chart/chart-sources.phtml create mode 100644 resources/views/modules/statistics-chart/individual-events.phtml create mode 100644 resources/views/modules/statistics-chart/other-events.phtml create mode 100644 resources/views/modules/statistics-chart/other-records.phtml create mode 100644 resources/views/modules/statistics-chart/places.phtml delete mode 100644 resources/views/modules/statistics-chart/total-events.phtml delete mode 100644 resources/views/statistics/other/chart-distribution.phtml delete mode 100644 resources/views/statistics/other/chart-objects.phtml delete mode 100644 resources/views/statistics/other/chart-sources.phtml delete mode 100644 resources/views/statistics/other/places.phtml delete mode 100644 resources/views/statistics/other/total-events.phtml delete mode 100644 resources/views/statistics/other/total-records.phtml diff --git a/app/Statistics/Repository/PlaceRepository.php b/app/Statistics/Repository/PlaceRepository.php index cb7ee52889..972626499b 100644 --- a/app/Statistics/Repository/PlaceRepository.php +++ b/app/Statistics/Repository/PlaceRepository.php @@ -273,7 +273,7 @@ class PlaceRepository implements PlaceRepositoryInterface $countries = $this->statsPlaces(); if ($countries === []) { - return ''; + return I18N::translate('This information is not available.'); } $top10 = []; diff --git a/resources/views/modules/statistics-chart/chart-distribution.phtml b/resources/views/modules/statistics-chart/chart-distribution.phtml new file mode 100644 index 0000000000..9a343c3d2a --- /dev/null +++ b/resources/views/modules/statistics-chart/chart-distribution.phtml @@ -0,0 +1 @@ +#chartDistribution# diff --git a/resources/views/modules/statistics-chart/chart-objects.phtml b/resources/views/modules/statistics-chart/chart-objects.phtml new file mode 100644 index 0000000000..075bffd17c --- /dev/null +++ b/resources/views/modules/statistics-chart/chart-objects.phtml @@ -0,0 +1,21 @@ + + +

+ +

+ +
+
+
+
+ #chartMedia# +
+
+
+
diff --git a/resources/views/modules/statistics-chart/chart-sources.phtml b/resources/views/modules/statistics-chart/chart-sources.phtml new file mode 100644 index 0000000000..51eef8a7e6 --- /dev/null +++ b/resources/views/modules/statistics-chart/chart-sources.phtml @@ -0,0 +1,37 @@ + + +

+ +

+ +
+
+
+
+ + #totalIndisWithSources# +
+
+ #chartIndisWithSources# +
+
+
+ +
+
+
+ + #totalFamsWithSources# +
+
+ #chartFamsWithSources# +
+
+
+
diff --git a/resources/views/modules/statistics-chart/individual-events.phtml b/resources/views/modules/statistics-chart/individual-events.phtml new file mode 100644 index 0000000000..89c86853e2 --- /dev/null +++ b/resources/views/modules/statistics-chart/individual-events.phtml @@ -0,0 +1,101 @@ + + +

+ +

+ +
+
+
+
+
+ + #totalBirths# +
+
+ +
+
+ +
+
+ #statsBirth# +
+
+ +
+
+
+
+ +
+
+ #firstBirth# +
+
+
+ +
+
+
+ +
+
+ #lastBirth# +
+
+
+
+
+
+ +
+
+
+
+ + #totalDeaths# +
+
+ +
+
+ +
+
+ #statsDeath# +
+
+ +
+
+
+
+ +
+
+ #firstDeath# +
+
+
+ +
+
+
+ +
+
+ #lastDeath# +
+
+
+
+
+
+
diff --git a/resources/views/modules/statistics-chart/individuals.phtml b/resources/views/modules/statistics-chart/individuals.phtml index a0e617656a..faf36b001e 100644 --- a/resources/views/modules/statistics-chart/individuals.phtml +++ b/resources/views/modules/statistics-chart/individuals.phtml @@ -10,7 +10,7 @@ use Fisharebest\Webtrees\Statistics;
embedTags(view('modules/statistics-chart/total-individuals')) ?> - embedTags(view('modules/statistics-chart/total-events')) ?> + embedTags(view('modules/statistics-chart/individual-events')) ?> embedTags(view('modules/statistics-chart/lifespan')) ?> embedTags(view('modules/statistics-chart/greatest-age')) ?> embedTags(view('modules/statistics-chart/oldest-living')) ?> diff --git a/resources/views/modules/statistics-chart/other-events.phtml b/resources/views/modules/statistics-chart/other-events.phtml new file mode 100644 index 0000000000..374c995e01 --- /dev/null +++ b/resources/views/modules/statistics-chart/other-events.phtml @@ -0,0 +1,36 @@ + + +

+ + #totalEvents# +

+ +
+
+
+
+ — #firstEventType# +
+
+ #firstEvent# +
+
+
+ +
+
+
+ — #lastEventType# +
+
+ #lastEvent# +
+
+
+
diff --git a/resources/views/modules/statistics-chart/other-records.phtml b/resources/views/modules/statistics-chart/other-records.phtml new file mode 100644 index 0000000000..757ef43ed3 --- /dev/null +++ b/resources/views/modules/statistics-chart/other-records.phtml @@ -0,0 +1,50 @@ + + +

+ + #totalRecords# +

+ +
+
+
+
+ + #totalMedia# +
+
+
+ +
+
+
+ + #totalSources# +
+
+
+ +
+
+
+ + #totalNotes# +
+
+
+ +
+
+
+ + #totalRepositories# +
+
+
+
diff --git a/resources/views/modules/statistics-chart/other.phtml b/resources/views/modules/statistics-chart/other.phtml index f293d5ddab..0a1c1504da 100644 --- a/resources/views/modules/statistics-chart/other.phtml +++ b/resources/views/modules/statistics-chart/other.phtml @@ -11,10 +11,10 @@ use Fisharebest\Webtrees\Statistics; ?>
- $stats]) ?> - $stats]) ?> - $stats]) ?> - $stats]) ?> - $stats]) ?> - $stats]) ?> + embedTags(view('modules/statistics-chart/other-records')) ?> + embedTags(view('modules/statistics-chart/other-events')) ?> + embedTags(view('modules/statistics-chart/chart-objects')) ?> + embedTags(view('modules/statistics-chart/chart-sources')) ?> + embedTags(view('modules/statistics-chart/places')) ?> + embedTags(view('modules/statistics-chart/chart-distribution')) ?>
diff --git a/resources/views/modules/statistics-chart/places.phtml b/resources/views/modules/statistics-chart/places.phtml new file mode 100644 index 0000000000..68982aab5a --- /dev/null +++ b/resources/views/modules/statistics-chart/places.phtml @@ -0,0 +1,50 @@ + + +

+ + #totalPlaces# +

+ +
+
+
+
+ +
+ #commonBirthPlacesList# +
+
+ +
+
+
+ +
+ #commonDeathPlacesList# +
+
+ +
+
+
+ +
+ #commonMarriagePlacesList# +
+
+ +
+
+
+ +
+ #commonCountriesList# +
+
+
diff --git a/resources/views/modules/statistics-chart/total-events.phtml b/resources/views/modules/statistics-chart/total-events.phtml deleted file mode 100644 index 89c86853e2..0000000000 --- a/resources/views/modules/statistics-chart/total-events.phtml +++ /dev/null @@ -1,101 +0,0 @@ - - -

- -

- -
-
-
-
-
- - #totalBirths# -
-
- -
-
- -
-
- #statsBirth# -
-
- -
-
-
-
- -
-
- #firstBirth# -
-
-
- -
-
-
- -
-
- #lastBirth# -
-
-
-
-
-
- -
-
-
-
- - #totalDeaths# -
-
- -
-
- -
-
- #statsDeath# -
-
- -
-
-
-
- -
-
- #firstDeath# -
-
-
- -
-
-
- -
-
- #lastDeath# -
-
-
-
-
-
-
diff --git a/resources/views/statistics/other/chart-distribution.phtml b/resources/views/statistics/other/chart-distribution.phtml deleted file mode 100644 index 4ccd9f8a3f..0000000000 --- a/resources/views/statistics/other/chart-distribution.phtml +++ /dev/null @@ -1,11 +0,0 @@ - - -chartDistribution(); diff --git a/resources/views/statistics/other/chart-objects.phtml b/resources/views/statistics/other/chart-objects.phtml deleted file mode 100644 index 1c75a9f230..0000000000 --- a/resources/views/statistics/other/chart-objects.phtml +++ /dev/null @@ -1,23 +0,0 @@ - - -

- -

- -
-
-
-
- chartMedia() ?> -
-
-
-
diff --git a/resources/views/statistics/other/chart-sources.phtml b/resources/views/statistics/other/chart-sources.phtml deleted file mode 100644 index e3b915dc4f..0000000000 --- a/resources/views/statistics/other/chart-sources.phtml +++ /dev/null @@ -1,39 +0,0 @@ - - -

- -

- -
-
-
-
- - totalIndisWithSources() ?> -
-
- chartIndisWithSources() ?> -
-
-
- -
-
-
- - totalFamsWithSources() ?> -
-
- chartFamsWithSources() ?> -
-
-
-
diff --git a/resources/views/statistics/other/places.phtml b/resources/views/statistics/other/places.phtml deleted file mode 100644 index cd3f558d9c..0000000000 --- a/resources/views/statistics/other/places.phtml +++ /dev/null @@ -1,59 +0,0 @@ - - -

- - totalPlaces() ?> -

- -
-
-
-
- -
- commonBirthPlacesList() ?> -
-
- -
-
-
- -
- commonDeathPlacesList() ?> -
-
- -
-
-
- -
- commonMarriagePlacesList() ?> -
-
- -
-
-
- -
- commonCountriesList(); ?> - - - -
- -
- -
-
-
diff --git a/resources/views/statistics/other/total-events.phtml b/resources/views/statistics/other/total-events.phtml deleted file mode 100644 index a0c77105c2..0000000000 --- a/resources/views/statistics/other/total-events.phtml +++ /dev/null @@ -1,48 +0,0 @@ - - -

- - totalEvents() ?> -

- -
-
-
- firstEventType() ?> - firstEvent() ?> -
- - -
-
- -
-
-
- -
-
- lastEventType() ?> - lastEvent() ?> -
- - -
-
- -
-
-
-
diff --git a/resources/views/statistics/other/total-records.phtml b/resources/views/statistics/other/total-records.phtml deleted file mode 100644 index 978497d97d..0000000000 --- a/resources/views/statistics/other/total-records.phtml +++ /dev/null @@ -1,52 +0,0 @@ - - -

- - totalRecords() ?> -

- -
-
-
-
- - totalMedia() ?> -
-
-
- -
-
-
- - totalSources() ?> -
-
-
- -
-
-
- - totalNotes() ?> -
-
-
- -
-
-
- - totalRepositories() ?> -
-
-
-
-- cgit v1.3