1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
<?php
use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Location;
use Fisharebest\Webtrees\Note;
use Fisharebest\Webtrees\Repository;
use Fisharebest\Webtrees\Source;
use Fisharebest\Webtrees\Tree;
use Fisharebest\Webtrees\View;
use Illuminate\Support\Collection;
/**
* @var Collection<Family> $families
* @var Collection<Individual> $individuals
* @var Collection<Location> $locations
* @var Collection<Note> $notes
* @var Collection<Repository> $repositories
* @var Collection<Source> $sources
* @var bool $search_families
* @var bool $search_individuals
* @var bool $search_locations
* @var bool $search_notes
* @var bool $search_repositories
* @var bool $search_sources
* @var Tree $tree
*/
?>
<div class="wt-search-results">
<ul class="nav nav-tabs wt-search-results-tabs" role="tablist">
<?php if ($search_individuals) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $individuals->isEmpty() ? 'text-muted' : '' ?>" id="individuals-tab" data-toggle="tab" href="#individuals" role="tab" aria-controls="individuals">
<?= I18N::translate('Individuals') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($individuals)) ?>
</span>
</a>
</li>
<?php endif ?>
<?php if ($search_families) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $families->isEmpty() ? 'text-muted' : '' ?>" id="families-tab" data-toggle="tab" href="#families" role="tab" aria-controls="families">
<?= I18N::translate('Families') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($families)) ?>
</span>
</a>
</li>
<?php endif ?>
<?php if ($search_sources) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $sources->isEmpty() ? 'text-muted' : '' ?>" id="sources-tab" data-toggle="tab" href="#sources" role="tab" aria-controls="sources">
<?= I18N::translate('Sources') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($sources)) ?>
</span>
</a>
</li>
<?php endif ?>
<?php if ($search_repositories) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $repositories->isEmpty() ? 'text-muted' : '' ?>" id="repositories-tab" data-toggle="tab" href="#repositories" role="tab" aria-controls="repositories">
<?= I18N::translate('Repositories') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($repositories)) ?>
</span>
</a>
</li>
<?php endif ?>
<?php if ($search_notes) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $notes->isEmpty() ? 'text-muted' : '' ?>" id="notes-tab" data-toggle="tab" href="#notes" role="tab" aria-controls="notes">
<?= I18N::translate('Notes') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($notes)) ?>
</span>
</a>
</li>
<?php endif ?>
<?php if ($search_locations) : ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?= $locations->isEmpty() ? 'text-muted' : '' ?>" id="locations-tab" data-toggle="tab" href="#locations" role="tab" aria-controls="locations">
<?= I18N::translate('Locations') ?>
<span class="badge badge-secondary">
<?= I18N::number(count($locations)) ?>
</span>
</a>
</li>
<?php endif ?>
</ul>
<div class="tab-content wt-search-results-content">
<?php if ($search_individuals) : ?>
<div class="tab-pane fade" id="individuals" role="tabpanel" aria-labelledby="individuals-tab">
<?= view('lists/individuals-table', ['individuals' => $individuals, 'sosa' => false, 'tree' => $tree]) ?>
</div>
<?php endif ?>
<?php if ($search_families) : ?>
<div class="tab-pane fade" id="families" role="tabpanel" aria-labelledby="families-tab">
<?= view('lists/families-table', ['families' => $families, 'tree' => $tree]) ?>
</div>
<?php endif ?>
<?php if ($search_sources) : ?>
<div class="tab-pane fade" id="sources" role="tabpanel" aria-labelledby="sources-tab">
<?= view('lists/sources-table', ['sources' => $sources, 'tree' => $tree]) ?>
</div>
<?php endif ?>
<?php if ($search_repositories) : ?>
<div class="tab-pane fade" id="repositories" role="tabpanel" aria-labelledby="repositories-tab">
<?= view('lists/repositories-table', ['repositories' => $repositories, 'tree' => $tree]) ?>
</div>
<?php endif ?>
<?php if ($search_notes) : ?>
<div class="tab-pane fade" id="notes" role="tabpanel" aria-labelledby="notes-tab">
<?= view('lists/notes-table', ['notes' => $notes, 'tree' => $tree]) ?>
</div>
<?php endif ?>
<?php if ($search_locations) : ?>
<div class="tab-pane fade" id="locations" role="tabpanel" aria-labelledby="locations-tab">
<?= view('lists/locations-table', ['locations' => $locations, 'tree' => $tree]) ?>
</div>
<?php endif ?>
</div>
</div>
<?php View::push('javascript') ?>
<script>
$('.wt-search-results-tabs li:first-child a').tab('show');
</script>
<?php View::endpush() ?>
|