xref: /webtrees/resources/views/record-page-links.phtml (revision 4991f2057a6647447a648c5d6743dab00378e98e)
1<?php
2
3use Fisharebest\Webtrees\Family;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\Individual;
6use Fisharebest\Webtrees\Location;
7use Fisharebest\Webtrees\Media;
8use Fisharebest\Webtrees\Note;
9use Fisharebest\Webtrees\Source;
10use Fisharebest\Webtrees\Tree;
11use Illuminate\Support\Collection;
12
13/**
14 * @var string                      $details
15 * @var ?Collection<int,Family>     $linked_families
16 * @var ?Collection<int,Individual> $linked_individuals
17 * @var ?Collection<int,Location>   $linked_locations
18 * @var ?Collection<int,Media>      $linked_media_objects
19 * @var ?Collection<int,Note>       $linked_notes
20 * @var ?Collection<int,Source>     $linked_sources
21 * @var Tree                        $tree
22 */
23
24?>
25
26<ul class="nav nav-tabs" role="tablist">
27    <li class="nav-item" role="presentation">
28        <a class="nav-link active" data-bs-toggle="tab" role="tab" href="#details">
29            <?= I18N::translate('Details') ?>
30        </a>
31    </li>
32
33    <?php if ($linked_individuals instanceof Collection) : ?>
34        <li class="nav-item" role="presentation">
35            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#individuals">
36                <?= I18N::translate('Individuals') ?>
37                <?= view('components/badge', ['count' => $linked_individuals->count()]) ?>
38            </a>
39        </li>
40    <?php endif ?>
41
42    <?php if ($linked_families instanceof Collection) : ?>
43        <li class="nav-item" role="presentation">
44            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#families">
45                <?= I18N::translate('Families') ?>
46                <?= view('components/badge', ['count' => $linked_families->count()]) ?>
47            </a>
48        </li>
49    <?php endif ?>
50
51    <?php if ($linked_media_objects instanceof Collection) : ?>
52        <li class="nav-item" role="presentation">
53            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#media">
54                <?= I18N::translate('Media objects') ?>
55                <?= view('components/badge', ['count' => $linked_media_objects->count()]) ?>
56            </a>
57        </li>
58    <?php endif ?>
59
60    <?php if ($linked_sources instanceof Collection) : ?>
61        <li class="nav-item" role="presentation">
62            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#sources">
63                <?= I18N::translate('Sources') ?>
64                <?= view('components/badge', ['count' => $linked_sources->count()]) ?>
65            </a>
66        </li>
67    <?php endif ?>
68
69    <?php if ($linked_notes instanceof Collection) : ?>
70        <li class="nav-item" role="presentation">
71            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#notes">
72                <?= I18N::translate('Notes') ?>
73                <?= view('components/badge', ['count' => $linked_notes->count()]) ?>
74            </a>
75        </li>
76    <?php endif ?>
77
78    <?php if ($linked_locations instanceof Collection) : ?>
79        <li class="nav-item" role="presentation">
80            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#notes">
81                <?= I18N::translate('Notes') ?>
82                <?= view('components/badge', ['count' => $linked_locations->count()]) ?>
83            </a>
84        </li>
85    <?php endif ?>
86</ul>
87
88<div class="tab-content">
89    <div class="tab-pane fade show active" role="tabpanel" id="details">
90        <?= $details ?>
91    </div>
92
93    <?php if ($linked_individuals instanceof Collection) : ?>
94        <div class="tab-pane fade" role="tabpanel" id="individuals">
95            <?= view('lists/individuals-table', ['individuals' => $linked_individuals, 'sosa' => false, 'tree' => $tree]) ?>
96        </div>
97    <?php endif ?>
98
99    <?php if ($linked_families instanceof Collection) : ?>
100        <div class="tab-pane fade" role="tabpanel" id="families">
101            <?= view('lists/families-table', ['families' => $linked_families, 'tree' => $tree]) ?>
102        </div>
103    <?php endif ?>
104
105    <?php if ($linked_media_objects instanceof Collection) : ?>
106        <div class="tab-pane fade" role="tabpanel" id="media">
107            <?= view('lists/media-table', ['media_objects' => $linked_media_objects, 'tree' => $tree]) ?>
108        </div>
109    <?php endif ?>
110
111    <?php if ($linked_sources instanceof Collection) : ?>
112        <div class="tab-pane fade" role="tabpanel" id="sources">
113            <?= view('lists/sources-table', ['sources' => $linked_sources, 'tree' => $tree]) ?>
114        </div>
115    <?php endif ?>
116
117    <?php if ($linked_notes instanceof Collection) : ?>
118        <div class="tab-pane fade" role="tabpanel" id="notes">
119            <?= view('lists/notes-table', ['notes' => $linked_notes, 'tree' => $tree]) ?>
120        </div>
121    <?php endif ?>
122
123    <?php if ($linked_locations instanceof Collection) : ?>
124        <div class="tab-pane fade" role="tabpanel" id="notes">
125            <?= view('lists/locations-table', ['locations' => $linked_locations, 'tree' => $tree]) ?>
126        </div>
127    <?php endif ?>
128</div>
129