xref: /webtrees/resources/views/search-general-page.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1f5402f3dSGreg Roach<?php
2f5402f3dSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5058ba724SGreg Roachuse Fisharebest\Webtrees\Family;
6f5402f3dSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SearchGeneralAction;
7f5402f3dSGreg Roachuse Fisharebest\Webtrees\I18N;
8058ba724SGreg Roachuse Fisharebest\Webtrees\Individual;
9058ba724SGreg Roachuse Fisharebest\Webtrees\Location;
10058ba724SGreg Roachuse Fisharebest\Webtrees\Note;
11058ba724SGreg Roachuse Fisharebest\Webtrees\Repository;
12058ba724SGreg Roachuse Fisharebest\Webtrees\Source;
13dc270d8cSGreg Roachuse Fisharebest\Webtrees\Tree;
14ca2d6785SGreg Roachuse Illuminate\Support\Collection;
15dc270d8cSGreg Roach
16dc270d8cSGreg Roach/**
1736779af1SGreg Roach * @var Collection<int,Tree>       $all_trees
18058ba724SGreg Roach * @var bool                       $exist_locations
19058ba724SGreg Roach * @var bool                       $exist_notes
20058ba724SGreg Roach * @var bool                       $exist_repositories
21058ba724SGreg Roach * @var bool                       $exist_sources
2236779af1SGreg Roach * @var Collection<int,Family>     $families
2336779af1SGreg Roach * @var Collection<int,Individual> $individuals
2436779af1SGreg Roach * @var Collection<int,Location>   $locations
2536779af1SGreg Roach * @var Collection<int,Note>       $notes
26dc270d8cSGreg Roach * @var string                     $query
2736779af1SGreg Roach * @var Collection<int,Repository> $repositories
2836779af1SGreg Roach * @var Collection<int,Source>     $sources
29dc270d8cSGreg Roach * @var bool                       $search_families
30dc270d8cSGreg Roach * @var bool                       $search_individuals
31058ba724SGreg Roach * @var bool                       $search_locations
32dc270d8cSGreg Roach * @var bool                       $search_notes
33dc270d8cSGreg Roach * @var bool                       $search_repositories
34dc270d8cSGreg Roach * @var bool                       $search_sources
3536779af1SGreg Roach * @var Collection<int,Tree>       $search_trees
36dc270d8cSGreg Roach * @var string                     $title
37dc270d8cSGreg Roach * @var Tree                       $tree
38dc270d8cSGreg Roach */
39f5402f3dSGreg Roach
40f5402f3dSGreg Roach?>
41dd6b2bfcSGreg Roach
42dd6b2bfcSGreg Roach<h2 class="wt-page-title">
43dd6b2bfcSGreg Roach    <?= $title ?>
44dd6b2bfcSGreg Roach</h2>
45dd6b2bfcSGreg Roach
4681443e3cSGreg Roach<form method="post" action="<?= e(route(SearchGeneralAction::class, ['tree' => $tree->name()])) ?>" class="wt-page-options wt-page-options-search hidden-print mb-4" name="searchform">
479e3c2cf9SGreg Roach    <div class="row">
48dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="query">
49dd6b2bfcSGreg Roach            <?= I18N::translate('Search for') ?>
50dd6b2bfcSGreg Roach        </label>
51dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
520d2905f7SGreg Roach            <div class="input-group">
537dca5265SGreg Roach                <input id="query" class="form-control" type="text" name="query" value="<?= e($query) ?>" required="required">
54dd6b2bfcSGreg Roach                <?= view('edit/input-addon-keyboard', ['id' => 'query']) ?>
55dd6b2bfcSGreg Roach            </div>
56dd6b2bfcSGreg Roach        </div>
57dd6b2bfcSGreg Roach    </div>
58315eb316SGreg Roach
599e3c2cf9SGreg Roach    <fieldset class="row">
60dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label">
61dd6b2bfcSGreg Roach            <?= I18N::translate('Records') ?>
62dd6b2bfcSGreg Roach        </label>
63dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
64dd6b2bfcSGreg Roach            <div class="form-check form-check-inline">
65dd6b2bfcSGreg Roach                <label class="form-check-label">
66dc270d8cSGreg Roach                    <input class="form-check-input" <?= $search_individuals ? 'checked' : '' ?>
67dc270d8cSGreg Roach                           name="search_individuals" type="checkbox">
68dd6b2bfcSGreg Roach                    <?= I18N::translate('Individuals') ?>
69dd6b2bfcSGreg Roach                </label>
70dd6b2bfcSGreg Roach            </div>
71dd6b2bfcSGreg Roach
72dd6b2bfcSGreg Roach            <div class="form-check form-check-inline">
73dd6b2bfcSGreg Roach                <label class="form-check-label">
74dc270d8cSGreg Roach                    <input class="form-check-input" <?= $search_families ? 'checked' : '' ?> name="search_families"
75dc270d8cSGreg Roach                           type="checkbox">
76dd6b2bfcSGreg Roach                    <?= I18N::translate('Families') ?>
77dd6b2bfcSGreg Roach                </label>
78dd6b2bfcSGreg Roach            </div>
79dd6b2bfcSGreg Roach
80058ba724SGreg Roach            <?php if ($exist_sources) : ?>
81dd6b2bfcSGreg Roach                <div class="form-check form-check-inline">
82dd6b2bfcSGreg Roach                    <label class="form-check-label">
83dc270d8cSGreg Roach                        <input class="form-check-input" <?= $search_sources ? 'checked' : '' ?> name="search_sources"
84dc270d8cSGreg Roach                               type="checkbox">
85dd6b2bfcSGreg Roach                        <?= I18N::translate('Sources') ?>
86dd6b2bfcSGreg Roach                    </label>
87dd6b2bfcSGreg Roach                </div>
88058ba724SGreg Roach            <?php endif ?>
89dd6b2bfcSGreg Roach
90058ba724SGreg Roach            <?php if ($exist_repositories) : ?>
91dd6b2bfcSGreg Roach                <div class="form-check form-check-inline">
92dd6b2bfcSGreg Roach                    <label class="form-check-label">
93dc270d8cSGreg Roach                        <input class="form-check-input" <?= $search_repositories ? 'checked' : '' ?>
94dc270d8cSGreg Roach                               name="search_repositories" type="checkbox">
95dd6b2bfcSGreg Roach                        <?= I18N::translate('Repositories') ?>
96dd6b2bfcSGreg Roach                    </label>
97dd6b2bfcSGreg Roach                </div>
98058ba724SGreg Roach            <?php endif ?>
99dd6b2bfcSGreg Roach
100058ba724SGreg Roach            <?php if ($exist_notes) : ?>
101dd6b2bfcSGreg Roach                <div class="form-check form-check-inline">
102dd6b2bfcSGreg Roach                    <label class="form-check-label">
103dc270d8cSGreg Roach                        <input class="form-check-input" <?= $search_notes ? 'checked' : '' ?> name="search_notes"
104dc270d8cSGreg Roach                               type="checkbox">
105dd6b2bfcSGreg Roach                        <?= I18N::translate('Shared notes') ?>
106dd6b2bfcSGreg Roach                    </label>
107dd6b2bfcSGreg Roach                </div>
108058ba724SGreg Roach            <?php endif ?>
109058ba724SGreg Roach
110058ba724SGreg Roach            <?php if ($exist_locations) : ?>
111058ba724SGreg Roach                <div class="form-check form-check-inline">
112058ba724SGreg Roach                    <label class="form-check-label">
113058ba724SGreg Roach                        <input class="form-check-input" <?= $search_locations ? 'checked' : '' ?> name="search_locations"
114058ba724SGreg Roach                               type="checkbox">
115058ba724SGreg Roach                        <?= I18N::translate('Locations') ?>
116058ba724SGreg Roach                    </label>
117058ba724SGreg Roach                </div>
118058ba724SGreg Roach            <?php endif ?>
119dd6b2bfcSGreg Roach        </div>
120dd6b2bfcSGreg Roach    </fieldset>
121dd6b2bfcSGreg Roach
122ca2d6785SGreg Roach    <?= view('search-trees', ['all_trees' => $all_trees, 'search_trees' => $search_trees]) ?>
123dd6b2bfcSGreg Roach
1249e3c2cf9SGreg Roach    <div class="row">
125dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label"></label>
126dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
127dc270d8cSGreg Roach            <input type="submit" class="btn btn-primary" value="<?= /* I18N: A button label. */
128dc270d8cSGreg Roach            I18N::translate('search') ?>">
129dd6b2bfcSGreg Roach        </div>
130dd6b2bfcSGreg Roach    </div>
13181443e3cSGreg Roach
13281443e3cSGreg Roach    <?= csrf_field() ?>
133dd6b2bfcSGreg Roach</form>
134dd6b2bfcSGreg Roach
135dd6b2bfcSGreg Roach<?php if ($query !== '') : ?>
136058ba724SGreg Roach    <?php if ($individuals->isEmpty() && $families->isEmpty() && $locations->isEmpty() && $repositories->isEmpty() && $sources->isEmpty() && $notes->isEmpty()) : ?>
137315eb316SGreg Roach        <div class="alert alert-info">
138dd6b2bfcSGreg Roach            <?= I18N::translate('No results found.') ?>
139dd6b2bfcSGreg Roach        </div>
140dd6b2bfcSGreg Roach    <?php else : ?>
141058ba724SGreg Roach        <?= view('search-results', ['families' => $families, 'individuals' => $individuals, 'locations' => $locations, 'notes' => $notes, 'repositories' => $repositories, 'sources' => $sources, 'search_families' => $search_families, 'search_individuals' => $search_individuals, 'search_locations' => $search_locations, 'search_notes' => $search_notes, 'search_repositories' => $search_repositories, 'search_sources' => $search_sources, 'tree' => $tree]) ?>
142dd6b2bfcSGreg Roach    <?php endif ?>
143dd6b2bfcSGreg Roach<?php endif ?>
144dd6b2bfcSGreg Roach
145dd6b2bfcSGreg Roach<?= view('modals/on-screen-keyboard') ?>
146