xref: /webtrees/resources/views/record-page-links.phtml (revision e873f434551745f888937263ff89e80db3b0f785)
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\Media;
10use Fisharebest\Webtrees\Note;
11use Fisharebest\Webtrees\Repository;
12use Fisharebest\Webtrees\Source;
13use Fisharebest\Webtrees\Submitter;
14use Fisharebest\Webtrees\Tree;
15use Illuminate\Support\Collection;
16
17/**
18 * @var string                          $details
19 * @var Collection<int,Family>|null     $linked_families
20 * @var Collection<int,Individual>|null $linked_individuals
21 * @var Collection<int,Location>|null   $linked_locations
22 * @var Collection<int,Media>|null      $linked_media_objects
23 * @var Collection<int,Note>|null       $linked_notes
24 * @var Collection<int,Repository>|null $linked_repositories
25 * @var Collection<int,Source>|null     $linked_sources
26 * @var Collection<int,Submitter>|null  $linked_submitters
27 * @var Tree                            $tree
28 */
29
30?>
31
32<ul class="nav nav-tabs" role="tablist">
33    <li class="nav-item" role="presentation">
34        <a class="nav-link active" data-bs-toggle="tab" role="tab" href="#details">
35            <?= I18N::translate('Details') ?>
36        </a>
37    </li>
38
39    <?php if ($linked_individuals instanceof Collection) : ?>
40        <li class="nav-item" role="presentation">
41            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#individuals">
42                <?= I18N::translate('Individuals') ?>
43                <?= view('components/badge', ['count' => $linked_individuals->count()]) ?>
44            </a>
45        </li>
46    <?php endif ?>
47
48    <?php if ($linked_families instanceof Collection) : ?>
49        <li class="nav-item" role="presentation">
50            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#families">
51                <?= I18N::translate('Families') ?>
52                <?= view('components/badge', ['count' => $linked_families->count()]) ?>
53            </a>
54        </li>
55    <?php endif ?>
56
57    <?php if ($linked_media_objects instanceof Collection) : ?>
58        <li class="nav-item" role="presentation">
59            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#media">
60                <?= I18N::translate('Media objects') ?>
61                <?= view('components/badge', ['count' => $linked_media_objects->count()]) ?>
62            </a>
63        </li>
64    <?php endif ?>
65
66    <?php if ($linked_sources instanceof Collection) : ?>
67        <li class="nav-item" role="presentation">
68            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#sources">
69                <?= I18N::translate('Sources') ?>
70                <?= view('components/badge', ['count' => $linked_sources->count()]) ?>
71            </a>
72        </li>
73    <?php endif ?>
74
75    <?php if ($linked_notes instanceof Collection) : ?>
76        <li class="nav-item" role="presentation">
77            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#notes">
78                <?= I18N::translate('Notes') ?>
79                <?= view('components/badge', ['count' => $linked_notes->count()]) ?>
80            </a>
81        </li>
82    <?php endif ?>
83
84    <?php if ($linked_repositories instanceof Collection) : ?>
85        <li class="nav-item" role="presentation">
86            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#repositories">
87                <?= I18N::translate('Repositories') ?>
88                <?= view('components/badge', ['count' => $linked_repositories->count()]) ?>
89            </a>
90        </li>
91    <?php endif ?>
92
93    <?php if ($linked_submitters instanceof Collection) : ?>
94        <li class="nav-item" role="presentation">
95            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#submitters">
96                <?= I18N::translate('Submitters') ?>
97                <?= view('components/badge', ['count' => $linked_submitters->count()]) ?>
98            </a>
99        </li>
100    <?php endif ?>
101
102    <?php if ($linked_locations instanceof Collection) : ?>
103        <li class="nav-item" role="presentation">
104            <a class="nav-link" data-bs-toggle="tab" role="tab" href="#locations">
105                <?= I18N::translate('Locations') ?>
106                <?= view('components/badge', ['count' => $linked_locations->count()]) ?>
107            </a>
108        </li>
109    <?php endif ?>
110</ul>
111
112<div class="tab-content">
113    <div class="tab-pane fade show active" role="tabpanel" id="details">
114        <?= $details ?>
115    </div>
116
117    <?php if ($linked_individuals instanceof Collection) : ?>
118        <div class="tab-pane fade" role="tabpanel" id="individuals">
119            <?= view('lists/individuals-table', ['individuals' => $linked_individuals, 'sosa' => false, 'tree' => $tree]) ?>
120        </div>
121    <?php endif ?>
122
123    <?php if ($linked_families instanceof Collection) : ?>
124        <div class="tab-pane fade" role="tabpanel" id="families">
125            <?= view('lists/families-table', ['families' => $linked_families, 'tree' => $tree]) ?>
126        </div>
127    <?php endif ?>
128
129    <?php if ($linked_media_objects instanceof Collection) : ?>
130        <div class="tab-pane fade" role="tabpanel" id="media">
131            <?= view('lists/media-table', ['media_objects' => $linked_media_objects, 'tree' => $tree]) ?>
132        </div>
133    <?php endif ?>
134
135    <?php if ($linked_sources instanceof Collection) : ?>
136        <div class="tab-pane fade" role="tabpanel" id="sources">
137            <?= view('lists/sources-table', ['sources' => $linked_sources, 'tree' => $tree]) ?>
138        </div>
139    <?php endif ?>
140
141    <?php if ($linked_notes instanceof Collection) : ?>
142        <div class="tab-pane fade" role="tabpanel" id="notes">
143            <?= view('lists/notes-table', ['notes' => $linked_notes, 'tree' => $tree]) ?>
144        </div>
145    <?php endif ?>
146
147    <?php if ($linked_repositories instanceof Collection) : ?>
148        <div class="tab-pane fade" role="tabpanel" id="repositories">
149            <?= view('lists/repositories-table', ['repositories' => $linked_repositories, 'tree' => $tree]) ?>
150        </div>
151    <?php endif ?>
152
153    <?php if ($linked_submitters instanceof Collection) : ?>
154        <div class="tab-pane fade" role="tabpanel" id="submitters">
155            <?= view('lists/submitters-table', ['submitters' => $linked_submitters, 'tree' => $tree]) ?>
156        </div>
157    <?php endif ?>
158
159    <?php if ($linked_locations instanceof Collection) : ?>
160        <div class="tab-pane fade" role="tabpanel" id="locations">
161            <?= view('lists/locations-table', ['locations' => $linked_locations, 'tree' => $tree]) ?>
162        </div>
163    <?php endif ?>
164</div>
165