xref: /webtrees/resources/views/edit/reorder-media.phtml (revision c09358794665832df009408551d8543ccb6e3783)
1<?php use Fisharebest\Webtrees\FontAwesome; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3<?php use Fisharebest\Webtrees\View; ?>
4
5<h2 class="wt-page-title"><?= $title ?></h2>
6
7<form class="wt-page-content" method="post">
8    <?= csrf_field() ?>
9    <div class="wt-sortable-list">
10        <?php foreach ($individual->getFacts('OBJE') as $fact) : ?>
11            <div class="card mb-2 wt-sortable-item">
12                <input type="hidden" name="order[]" value="<?= $fact->id() ?>">
13                <h3 class="card-header">
14                    <?= FontAwesome::semanticIcon('drag-handle', '') ?>
15                    <?= $fact->target()->getFullName() ?>
16                </h3>
17                <div class="card-body">
18                    <?= $fact->target()->displayImage(100, 100, "contain") ?>
19                </div>
20            </div>
21        <?php endforeach ?>
22    </div>
23
24    <p>
25        <button class="btn btn-primary" type="submit">
26            <?= FontAwesome::decorativeIcon('save') ?>
27            <?= /* I18N: A button label. */ I18N::translate('save') ?>
28        </button>
29
30        <a class="btn btn-secondary" href="<?= e($individual->url()) ?>">
31            <?= FontAwesome::decorativeIcon('cancel') ?>
32            <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
33        </a>
34    </p>
35</form>
36
37<?php View::push('javascript') ?>
38<script>
39  new Sortable(document.querySelector(".wt-sortable-list"), {});
40</script>
41<?php View::endpush() ?>
42