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