diff options
| -rw-r--r-- | app/Http/Controllers/PlaceHierarchyController.php | 22 | ||||
| -rw-r--r-- | app/Module/PlacesModule.php | 3 | ||||
| -rw-r--r-- | resources/views/modules/places/tab.phtml | 24 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-events.phtml (renamed from resources/views/place-events.phtml) | 0 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-list.phtml (renamed from resources/views/place-list.phtml) | 0 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-map.phtml (renamed from resources/views/place-map.phtml) | 4 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-page.phtml (renamed from resources/views/places-page.phtml) | 22 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-popup.phtml (renamed from resources/views/place-popup.phtml) | 14 | ||||
| -rw-r--r-- | resources/views/place-hierarchy-sidebar.phtml (renamed from resources/views/place-sidebar.phtml) | 0 |
9 files changed, 53 insertions, 36 deletions
diff --git a/app/Http/Controllers/PlaceHierarchyController.php b/app/Http/Controllers/PlaceHierarchyController.php index fb560116bd..2e4bb9e985 100644 --- a/app/Http/Controllers/PlaceHierarchyController.php +++ b/app/Http/Controllers/PlaceHierarchyController.php @@ -51,7 +51,7 @@ class PlaceHierarchyController extends AbstractBaseController private $statistics; /** - * TopGivenNamesModule constructor. + * PlaceHierarchy constructor. * * @param SearchService $search_service * @param Statistics $statistics @@ -64,8 +64,8 @@ class PlaceHierarchyController extends AbstractBaseController /** * @param ServerRequestInterface $request - * * @return ResponseInterface + * @throws Exception */ public function show(ServerRequestInterface $request): ResponseInterface { @@ -86,7 +86,7 @@ class PlaceHierarchyController extends AbstractBaseController if ($showmap) { $note = true; - $content .= view('place-map', [ + $content .= view('place-hierarchy-map', [ 'data' => $this->mapData($tree, $fqpn), ]); } @@ -94,7 +94,7 @@ class PlaceHierarchyController extends AbstractBaseController switch ($action2) { case 'list': $nextaction = ['hierarchy' => I18N::translate('Show place hierarchy')]; - $content .= view('place-list', $this->getList($tree, $this->search_service)); + $content .= view('place-hierarchy-list', $this->getList($tree, $this->search_service)); break; case 'hierarchy': case 'hierarchy-e': @@ -102,7 +102,7 @@ class PlaceHierarchyController extends AbstractBaseController $data = $this->getHierarchy($tree, $place, $parent); $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data); if (null === $data || $action2 === 'hierarchy-e') { - $content .= view('place-events', $this->getEvents($tree, $place)); + $content .= view('place-hierarchy-events', $this->getEvents($tree, $place)); } break; default: @@ -112,7 +112,7 @@ class PlaceHierarchyController extends AbstractBaseController $breadcrumbs = $this->breadcrumbs($place); return $this->viewResponse( - 'places-page', + 'place-hierarchy-page', [ 'title' => I18N::translate('Places'), 'note' => $note, @@ -301,15 +301,13 @@ class PlaceHierarchyController extends AbstractBaseController 'coordinates' => [$location->longitude(), $location->latitude()], ], 'properties' => [ - 'icon' => [ - 'name' => 'bullseye fas', - 'color' => '#1e90ff', - ], 'tooltip' => $place->gedcomName(), - 'popup' => view('place-popup', [ + 'popup' => view('place-hierarchy-popup', [ 'showlink' => $showlink, 'flag' => $flag, 'place' => $place, + 'latitude' => $location->latitude(), + 'longitude'=> $location->longitude(), ]), 'zoom' => $location->zoom() ?: 2, ], @@ -327,7 +325,7 @@ class PlaceHierarchyController extends AbstractBaseController $sidebar_title, $sidebar_class, $id, - view('place-sidebar', [ + view('place-hierarchy-sidebar', [ 'showlink' => $showlink, 'flag' => $flag, 'place' => $place, diff --git a/app/Module/PlacesModule.php b/app/Module/PlacesModule.php index 54ce6d5bee..aa11d3e41c 100644 --- a/app/Module/PlacesModule.php +++ b/app/Module/PlacesModule.php @@ -55,7 +55,7 @@ class PlacesModule extends AbstractModule implements ModuleTabInterface 'EDUC' => ['color' => 'violet', 'name' => 'university fas'], ]; - protected const DEFAULT_ICON = ['color' => 'gold', 'name' => 'fa-bullseye fas']; + protected const DEFAULT_ICON = ['color' => 'gold', 'name' => 'bullseye fas']; /** * How should this module be identified in the control panel, etc.? @@ -174,7 +174,6 @@ class PlacesModule extends AbstractModule implements ModuleTabInterface 'coordinates' => [$longitude, $latitude], ], 'properties' => [ - 'polyline' => null, 'icon' => static::ICONS[$fact->getTag()] ?? static::DEFAULT_ICON, 'tooltip' => strip_tags($fact->place()->fullName()), 'summary' => view('modules/places/event-sidebar', $this->summaryData($indi, $fact)), diff --git a/resources/views/modules/places/tab.phtml b/resources/views/modules/places/tab.phtml index 4da47e9ffc..2bab48af50 100644 --- a/resources/views/modules/places/tab.phtml +++ b/resources/views/modules/places/tab.phtml @@ -31,10 +31,6 @@ height: 15px; width: 25px } - - .osm-sidebar .border-danger:hover { - cursor: not-allowed - } </style> <script type="application/javascript"> @@ -45,12 +41,6 @@ minZoom: 2, providerName: "OpenStreetMap.Mapnik", providerOptions: [], - I18N: { - zoomInTitle: <?= json_encode(I18N::translate('Zoom in')) ?>, - zoomOutTitle: <?= json_encode(I18N::translate('Zoom out')) ?>, - reset: <?= json_encode(I18N::translate('Reset to initial map state')) ?>, - noData: <?= json_encode(I18N::translate('No mappable items')) ?> - } }; let map = null; @@ -78,12 +68,13 @@ return false; }; let anchor = L.DomUtil.create("a", "leaflet-control-reset", container); + let reset = <?= json_encode(I18N::translate('Reset to initial map state')) ?>; anchor.href = "#"; - anchor.title = baseData.I18N.reset; + anchor.title = reset; anchor.role = "button"; $(anchor).attr("aria-label", "reset"); let image = L.DomUtil.create("i", "fas fa-redo", anchor); - image.alt = baseData.I18N.reset; + image.alt = reset; return container; }, @@ -101,8 +92,8 @@ }); L.tileLayer.provider(baseData.providerName, baseData.providerOptions).addTo(map); L.control.zoom({ // Add zoom with localised text - zoomInTitle: baseData.I18N.zoomInTitle, - zoomOutTitle: baseData.I18N.zoomOutTitle, + zoomInTitle: <?= json_encode(I18N::translate('Zoom in')) ?>, + zoomOutTitle: <?= json_encode(I18N::translate('Zoom out')) ?>, }).addTo(map); }; @@ -140,8 +131,7 @@ }, onEachFeature: function (feature, layer) { layer.bindPopup(feature.properties.summary); - let myclass = feature.valid ? "gchart" : "border border-danger"; - sidebar += `<li class="${myclass}" data-id=${feature.id}>${feature.properties.summary}</li>`; + sidebar += `<li class="gchart" data-id=${feature.id}>${feature.properties.summary}</li>`; }, }); @@ -159,7 +149,7 @@ } } else { map.fitWorld(); - $(domObj).append("<div class=\"bg-info text-white\">" + baseData.I18N.noData + "</div>"); + $(domObj).append("<div class='bg-info text-white'>" + <?= json_encode(I18N::translate('No mappable items')) ?> + "</div>"); } $(domObj).slideDown(300); diff --git a/resources/views/place-events.phtml b/resources/views/place-hierarchy-events.phtml index 90defa7c57..90defa7c57 100644 --- a/resources/views/place-events.phtml +++ b/resources/views/place-hierarchy-events.phtml diff --git a/resources/views/place-list.phtml b/resources/views/place-hierarchy-list.phtml index 61e8b48f05..61e8b48f05 100644 --- a/resources/views/place-list.phtml +++ b/resources/views/place-hierarchy-list.phtml diff --git a/resources/views/place-map.phtml b/resources/views/place-hierarchy-map.phtml index b3bb6b89ef..f7b2a1e260 100644 --- a/resources/views/place-map.phtml +++ b/resources/views/place-hierarchy-map.phtml @@ -122,9 +122,9 @@ use Fisharebest\Webtrees\View; pointToLayer: function (feature, latlng) { return new L.Marker(latlng, { icon: L.BeautifyIcon.icon({ - icon: feature.properties.icon["name"], + icon: 'bullseye fas', borderColor: "transparent", - backgroundColor: feature.properties.icon["color"], + backgroundColor: '#1e90ff', iconShape: "marker", textColor: "white", }), diff --git a/resources/views/places-page.phtml b/resources/views/place-hierarchy-page.phtml index 087899f128..2b95b14822 100644 --- a/resources/views/places-page.phtml +++ b/resources/views/place-hierarchy-page.phtml @@ -1,6 +1,24 @@ <?php -use Fisharebest\Webtrees\I18N; ?> +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Tree; + +/** + * @var string $module + * @var Tree $tree + * @var string $action + * @var string $title + * @var string $current + * @var array $breadcrumbs + * @var bool $note + * @var string $content + * @var bool $showeventslink + * @var string $place + * @var array $parent + * @var array $nextaction + */ + +?> <div id="place-hierarchy"> <div class="container"> @@ -25,7 +43,7 @@ use Fisharebest\Webtrees\I18N; ?> </h5> <?php if ($note) : ?> <div class="text-center small text-muted"> - <?= I18N::translate('Places without valid co-ordinates are not shown on the map and have a red border around the sidebar entry') ?> + <?= I18N::translate('Places without valid co-ordinates do not appear on the map and are indicated by the sidebar entry being crossed through') ?> </div> <?php endif ?> <?= $content ?> diff --git a/resources/views/place-popup.phtml b/resources/views/place-hierarchy-popup.phtml index 1901940479..45d312d92f 100644 --- a/resources/views/place-popup.phtml +++ b/resources/views/place-hierarchy-popup.phtml @@ -1,11 +1,13 @@ <?php use Fisharebest\Webtrees\Place; - +use Fisharebest\Webtrees\I18N; /** * @var bool $showlink * @var Place $place * @var string $flag + * @var string $latitude + * @var string $longitude */ ?> <div dir="auto" class="label"> @@ -19,4 +21,14 @@ use Fisharebest\Webtrees\Place; <?php else: ?> <?= $place->placeName() ?> <?php endif ?> + <table class="table table-borderless"> + <tr> + <th scope="row" class="p-0"><?= I18N::translate('Latitude') ?></th> + <td class="p-0 align-digits"><?= $latitude ?></td> + </tr> + <tr> + <th scope="row" class="p-0"><?= I18N::translate('Longitude') ?></th> + <td class="p-0 align-digits"><?= $longitude ?></td> + </tr> + </table> </div> diff --git a/resources/views/place-sidebar.phtml b/resources/views/place-hierarchy-sidebar.phtml index c93bf670df..c93bf670df 100644 --- a/resources/views/place-sidebar.phtml +++ b/resources/views/place-hierarchy-sidebar.phtml |
