xref: /webtrees/resources/views/modules/place-hierarchy/sidebar.phtml (revision 4a9a60957058ca2a34e30a0d6f783e1540606590)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Family;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Individual;
8use Fisharebest\Webtrees\Location;
9use Fisharebest\Webtrees\Place;
10
11/**
12 * @var bool                 $showlink
13 * @var Place                $place
14 * @var int                  $id
15 * @var string               $sidebar_class
16 * @var array<string,string> $stats
17 */
18?>
19
20<li class="gchart px-md-2 <?= $sidebar_class ?>" data-wt-feature-id="<?= $id ?>">
21    <div class="row label">
22        <div class="col" style="word-wrap: break-word">
23            <?php if ($showlink) : ?>
24                <a href="<?= e($place->url()) ?>">
25                    <?= $place->placeName() ?>
26                </a>
27            <?php else : ?>
28                <?= $place->placeName() ?>
29            <?php endif ?>
30        </div>
31    </div>
32
33    <?php if ($sidebar_class === 'unmapped') : ?>
34        <div class="row">
35            <div class="col-sm-9"><i><?= I18N::translate('The location of this place is not known.') ?></i></div>
36            <div class="col-sm-3 align-digits"><?= view('icons/warning') ?></div>
37        </div>
38    <?php endif ?>
39
40    <div class="row">
41        <div class="col-sm-9"><?= I18N::translate('Individuals') ?></div>
42        <div class="col-sm-3 align-digits"><?= I18N::number($stats[Individual::RECORD_TYPE]) ?></div>
43    </div>
44
45    <?php if ($stats[Family::RECORD_TYPE] > 0) : ?>
46        <div class="row">
47            <div class="col-sm-9"><?= I18N::translate('Families') ?></div>
48            <div class="col-sm-3 align-digits"><?= I18N::number($stats[Family::RECORD_TYPE]) ?></div>
49        </div>
50    <?php endif ?>
51
52    <?php if ($stats[Location::RECORD_TYPE] > 0) : ?>
53        <div class="row">
54            <div class="col-sm-9"><?= I18N::translate('Locations') ?></div>
55            <div class="col-sm-3 align-digits"><?= I18N::number($stats[Location::RECORD_TYPE]) ?></div>
56        </div>
57    <?php endif ?>
58</li>
59