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