summaryrefslogtreecommitdiff
path: root/resources/views/edit/paste-fact-row.phtml
blob: 759f144d7f463e6ed34411d6898b4c18ed2e6168 (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
<?php use Fisharebest\Webtrees\I18N; ?>

<?php if (!empty($facts)) : ?>
<tr>
    <th scope="row">
        <label for="paste-fact">
            <?= I18N::translate('Add from clipboard') ?>
        </label>
    </th>
    <td>
        <form name="newFromClipboard" onsubmit="return false;">
            <div class="input-group">
                <select class="custom-select" id="paste-fact">
                    <?php foreach ($facts as $fact) : ?>
                    <option value="<?= e($fact->id()) ?>">
                        <?= $fact->label() ?>
                        <?php if ($fact->value() !== '') : ?>
                            – <?= e($fact->value()) ?>
                        <?php endif ?>
                        <?php if ($fact->date()->isOK()) : ?>
                            – <?= $fact->date()->minimumDate()->format('%Y') ?>
                        <?php endif ?>
                        <?php if (!$fact->place()->isEmpty()) : ?>
                            – <?= $fact->place()->shortName() ?>
                        <?php endif ?>
                    </option>
                    <?php endforeach ?>
                </select>
                <div class="input-group-append">
                    <button class="btn btn-light" type="submit" onclick="return paste_fact('<?= e($tree->name()) ?>', '<?= e($record->xref()) ?>', '#paste-fact');">
                        <?= /* I18N: A button label. */ I18N::translate('add') ?>
                    </button>
                </div>
            </div>
        </form>
    </td>
</tr>
<?php endif ?>