xref: /webtrees/resources/views/search-results.phtml (revision 075d1a0567e21f051a28e4811b3293a28f1ed13f)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<div class="wt-search-results">
5    <ul class="nav nav-tabs wt-search-results-tabs" role="tablist">
6        <?php if ($search_individuals) : ?>
7            <li class="nav-item">
8                <a class="nav-link <?= $individuals->isEmpty() ? 'text-muted' : '' ?>" id="individuals-tab" data-toggle="tab" href="#individuals" role="tab" aria-controls="individuals">
9                    <?= I18N::translate('Individuals') ?>
10                    <span class="badge badge-secondary">
11                        <?= I18N::number(count($individuals)) ?>
12                    </span>
13                </a>
14            </li>
15        <?php endif ?>
16
17        <?php if ($search_families) : ?>
18            <li class="nav-item">
19                <a class="nav-link <?= $families->isEmpty() ? 'text-muted' : '' ?>" id="families-tab" data-toggle="tab" href="#families" role="tab" aria-controls="families">
20                    <?= I18N::translate('Families') ?>
21                    <span class="badge badge-secondary">
22                        <?= I18N::number(count($families)) ?>
23                    </span>
24                </a>
25            </li>
26        <?php endif ?>
27
28        <?php if ($search_sources) : ?>
29            <li class="nav-item">
30                <a class="nav-link <?= $sources->isEmpty() ? 'text-muted' : '' ?>" id="sources-tab" data-toggle="tab" href="#sources" role="tab" aria-controls="sources">
31                    <?= I18N::translate('Sources') ?>
32                    <span class="badge badge-secondary">
33                        <?= I18N::number(count($sources)) ?>
34                    </span>
35                </a>
36            </li>
37        <?php endif ?>
38
39        <?php if ($search_repositories) : ?>
40            <li class="nav-item">
41                <a class="nav-link <?= $repositories->isEmpty() ? 'text-muted' : '' ?>" id="repositories-tab" data-toggle="tab" href="#repositories" role="tab" aria-controls="repositories">
42                    <?= I18N::translate('Repositories') ?>
43                    <span class="badge badge-secondary">
44                        <?= I18N::number(count($repositories)) ?>
45                    </span>
46                </a>
47            </li>
48        <?php endif ?>
49
50        <?php if ($search_notes) : ?>
51            <li class="nav-item">
52                <a class="nav-link <?= $notes->isEmpty() ? 'text-muted' : '' ?>" id="notes-tab" data-toggle="tab" href="#notes" role="tab" aria-controls="notes">
53                    <?= I18N::translate('Notes') ?>
54                    <span class="badge badge-secondary">
55                        <?= I18N::number(count($notes)) ?>
56                    </span>
57                </a>
58            </li>
59        <?php endif ?>
60    </ul>
61
62    <div class="tab-content wt-search-results-content">
63        <?php if ($search_individuals) : ?>
64            <div class="tab-pane fade" id="individuals" role="tabpanel" aria-labelledby="individuals-tab">
65                <?= view('lists/individuals-table', ['individuals' => $individuals, 'sosa' => false, 'tree' => $tree]) ?>
66            </div>
67        <?php endif ?>
68
69        <?php if ($search_families) : ?>
70            <div class="tab-pane fade" id="families" role="tabpanel" aria-labelledby="families-tab">
71                <?= view('lists/families-table', ['families' => $families, 'tree' => $tree]) ?>
72            </div>
73        <?php endif ?>
74
75        <?php if ($search_sources) : ?>
76            <div class="tab-pane fade" id="sources" role="tabpanel" aria-labelledby="sources-tab">
77                <?= view('lists/sources-table', ['sources' => $sources, 'tree' => $tree]) ?>
78            </div>
79        <?php endif ?>
80
81        <?php if ($search_repositories) : ?>
82            <div class="tab-pane fade" id="repositories" role="tabpanel" aria-labelledby="repositories-tab">
83                <?= view('lists/repositories-table', ['repositories' => $repositories, 'tree' => $tree]) ?>
84            </div>
85        <?php endif ?>
86
87        <?php if ($search_notes) : ?>
88            <div class="tab-pane fade" id="notes" role="tabpanel" aria-labelledby="notes-tab">
89                <?= view('lists/notes-table', ['notes' => $notes, 'tree' => $tree]) ?>
90            </div>
91        <?php endif ?>
92    </div>
93</div>
94
95<?php View::push('javascript') ?>
96<script>
97  $('.wt-search-results-tabs li:first-child a').tab('show');
98</script>
99<?php View::endpush() ?>
100