diff options
| author | David Drury <ddrury@users.noreply.github.com> | 2021-02-21 20:49:02 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2021-02-23 13:54:28 +0000 |
| commit | d3e191dc13df4ee95fa867758ce98ec063566485 (patch) | |
| tree | 54f28371276f12593ceca3f3b91d31b2a42dc2aa /resources/views/modules/GEDFact_assistant | |
| parent | 5062b1ca554e9384a3865a8ed7fa201483b30720 (diff) | |
| download | webtrees-d3e191dc13df4ee95fa867758ce98ec063566485.tar.gz webtrees-d3e191dc13df4ee95fa867758ce98ec063566485.tar.bz2 webtrees-d3e191dc13df4ee95fa867758ce98ec063566485.zip | |
Use optgroups,
changed as per @fisharebest
Diffstat (limited to 'resources/views/modules/GEDFact_assistant')
| -rw-r--r-- | resources/views/modules/GEDFact_assistant/select-census.phtml | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/resources/views/modules/GEDFact_assistant/select-census.phtml b/resources/views/modules/GEDFact_assistant/select-census.phtml index 7a239a0bbc..ca2fe8542b 100644 --- a/resources/views/modules/GEDFact_assistant/select-census.phtml +++ b/resources/views/modules/GEDFact_assistant/select-census.phtml @@ -21,15 +21,18 @@ use Fisharebest\Webtrees\I18N; </script> <select id="census-selector" class="form-control" onchange="selectCensus(this)"> - <option value=""><?= I18N::translate('Census date') ?></option> + <option value="" disabled selected hidden><?= I18N::translate('Census date') ?></option> <?php foreach ($census_places as $census_place) : ?> - <option value=""> </option> - <?php foreach ($census_place->allCensusDates() as $census) : ?> - <option value="<?= $census->censusDate() ?>" data-place="<?= $census->censusPlace() ?>" data-census="<?= get_class($census) ?>"> - <?= (explode(', ', $census->censusPlace()))[0] ?> - <?= (new Date($census->censusDate()))->minimumDate()->format('%Y') ?> - </option> - <?php endforeach ?> + <optgroup label="<?= $census_place->censusPlace() ?>"> + <?php foreach ($census_place->allCensusDates() as $census) : ?> + <option value="<?= $census->censusDate() ?>" data-place="<?= $census->censusPlace() ?>" data-census="<?= get_class($census) ?>"> + <?= (new Date($census->censusDate()))->minimumDate()->format('%Y') ?> + <?php if ($census_place->censusPlace() !== $census->censusPlace()): ?> + — (<?= $census->censusPlace() ?>) + <?php endif ?> + </option> + <?php endforeach ?> + </optgroup> <?php endforeach ?> </select> |
