xref: /webtrees/resources/views/individual-page-sex.phtml (revision 1ff45046fabc22237b5d0d8e489c96f031fc598d)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Fact;
6use Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\Registry;
9
10/**
11 * @var Fact $fact
12 */
13
14$individual = $fact->record();
15$tree       = $individual->tree();
16
17$container_class = '';
18if ($fact->isPendingDeletion()) {
19    $container_class = 'wt-old';
20} elseif ($fact->isPendingAddition()) {
21    $container_class = 'wt-new';
22}
23
24?>
25<div class="accordion-item <?= $container_class ?>">
26    <div class="accordion-header" id="name-header-<?= $fact->id() ?>">
27        <button class="accordion-button collapsed gap-1" type="button" data-bs-toggle="collapse" data-bs-target="#name-content-<?= $fact->id() ?>" aria-expanded="false" aria-controls="name-content-<?= $fact->id() ?>">
28            <?= view('icons/expand') ?>
29            <?= view('icons/collapse') ?>
30            <span class="label"><?= I18N::translate('Gender') ?></span>
31            <?= Registry::elementFactory()->make('INDI:SEX')->value($fact->value(), $tree) ?>
32        </button>
33    </div>
34    <div id="name-content-<?= $fact->id() ?>" class="accordion-collapse collapse" data-bs-parent="#individual-names" aria-labelledby="name-header-<?= $fact->id() ?>">
35        <div class="accordion-body">
36            <?= view('fact-sources', ['fact' => $fact]) ?>
37            <?= view('fact-notes', ['fact' => $fact]) ?>
38
39            <?php if ($fact->canEdit()) : ?>
40                <div class="d-flex">
41                    <a class="btn btn-link ms-auto" href="<?= e(route(EditFactPage::class, ['xref' => $fact->record()->xref(), 'fact_id' => $fact->id(), 'tree' => $fact->record()->tree()->name()])) ?>"
42                       title="<?= I18N::translate('Edit the gender') ?>">
43                        <?= view('icons/edit') ?>
44                        <span class="visually-hidden"><?= I18N::translate('Edit the gender') ?></span>
45                    </a>
46                </div>
47            <?php endif ?>
48        </div>
49    </div>
50</div>
51