summaryrefslogtreecommitdiff
path: root/resources/views/individual-sex.phtml
blob: 38d7a4d56d1930be9dafbfec247d4d1f0c767b91 (plain)
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
<?php

use Fisharebest\Webtrees\Fact;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
use Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
use Fisharebest\Webtrees\I18N;

/**
 * @var Fact $fact
 */

$individual = $fact->record();
$tree       = $individual->tree();

$container_class = '';
if ($fact->isPendingDeletion()) {
    $container_class = 'wt-old';
} elseif ($fact->isPendingAddition()) {
    $container_class = 'wt-new';
}

?>
<div class="card <?= $container_class ?>">
    <div class="card-header" role="tab" id="name-header-<?= $fact->id() ?>">
        <a data-bs-toggle="collapse" href="#name-content-<?= $fact->id() ?>" aria-expanded="false" aria-controls="name-content-<?= $fact->id() ?>">
            <?= view('icons/expand') ?>
            <?= view('icons/collapse') ?>
            <span class="label"><?= I18N::translate('Gender') ?></span>
            <?php
            switch ($fact->value()) {
                case 'M':
                    echo I18N::translate('Male');
                    break;
                case 'F':
                    echo I18N::translate('Female');
                    break;
                default:
                    echo I18N::translateContext('unknown gender', 'Unknown');
                    break;
            }
            ?>
        </a>
    </div>
    <div id="name-content-<?= $fact->id() ?>" class="card-body collapse" data-bs-parent="#individual-names" aria-labelledby="name-header-<?= $fact->id() ?>">
        <?= FunctionsPrintFacts::printFactSources($tree, $fact->gedcom(), 2) ?>
        <?= FunctionsPrint::printFactNotes($tree, $fact->gedcom(), 2) ?>

        <?php if ($fact->canEdit()) : ?>
            <div class="d-flex">
                <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()])) ?>"
                   title="<?= I18N::translate('Edit the gender') ?>">
                    <?= view('icons/edit') ?>
                    <span class="visually-hidden"><?= I18N::translate('Edit the gender') ?></span>
                </a>
            </div>
        <?php endif ?>
    </div>
</div>