15229eadeSGreg Roach<?php 25229eadeSGreg Roach 35229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaAction; 45229eadeSGreg Roachuse Fisharebest\Webtrees\I18N; 57c2c99faSGreg Roachuse Fisharebest\Webtrees\Individual; 65229eadeSGreg Roachuse Fisharebest\Webtrees\View; 75229eadeSGreg Roach 87c2c99faSGreg Roach/** 97c2c99faSGreg Roach * @var Individual $individual 107c2c99faSGreg Roach * @var string $title 117c2c99faSGreg Roach */ 127c2c99faSGreg Roach 135229eadeSGreg Roach?> 14dd6b2bfcSGreg Roach 15dd6b2bfcSGreg Roach<h2 class="wt-page-title"><?= $title ?></h2> 16dd6b2bfcSGreg Roach 177c2c99faSGreg Roach<form method="post" action="<?= e(route(ReorderMediaAction::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>" class="wt-page-content"> 18dd6b2bfcSGreg Roach <div class="wt-sortable-list"> 198d0ebef0SGreg Roach <?php foreach ($individual->facts(['OBJE']) as $fact) : ?> 2092044e0dSGreg Roach <div class="card my-2 wt-sortable-item"> 21905ab80aSGreg Roach <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> 2275b444f7SGreg Roach <div class="card-header"> 2392044e0dSGreg Roach <?= view('edit/reorder-card-header', ['title' => $fact->target()->fullName()]) ?> 2475b444f7SGreg Roach </div> 2592044e0dSGreg Roach 26dd6b2bfcSGreg Roach <div class="card-body"> 277b0d562eSGreg Roach <?= $fact->target()->displayImage(100, 100, 'contain', []) ?> 28dd6b2bfcSGreg Roach </div> 29dd6b2bfcSGreg Roach </div> 30dd6b2bfcSGreg Roach <?php endforeach ?> 31dd6b2bfcSGreg Roach </div> 32dd6b2bfcSGreg Roach 33dd6b2bfcSGreg Roach <p> 34dd6b2bfcSGreg Roach <button class="btn btn-primary" type="submit"> 35d993d560SGreg Roach <?= view('icons/save') ?> 36dd6b2bfcSGreg Roach <?= /* I18N: A button label. */ I18N::translate('save') ?> 37dd6b2bfcSGreg Roach </button> 38dd6b2bfcSGreg Roach 39dd6b2bfcSGreg Roach <a class="btn btn-secondary" href="<?= e($individual->url()) ?>"> 40d993d560SGreg Roach <?= view('icons/cancel') ?> 41dd6b2bfcSGreg Roach <?= /* I18N: A button label. */ I18N::translate('cancel') ?> 42dd6b2bfcSGreg Roach </a> 43dd6b2bfcSGreg Roach </p> 44*81443e3cSGreg Roach 45*81443e3cSGreg Roach <?= csrf_field() ?> 46dd6b2bfcSGreg Roach</form> 47dd6b2bfcSGreg Roach 48dd6b2bfcSGreg Roach<?php View::push('javascript') ?> 49dd6b2bfcSGreg Roach<script> 5075b444f7SGreg Roach new Sortable(document.querySelector(".wt-sortable-list"), { 5192044e0dSGreg Roach handle: ".card-header", 5275b444f7SGreg Roach }); 53dd6b2bfcSGreg Roach</script> 54dd6b2bfcSGreg Roach<?php View::endpush() ?> 55