1<?php 2 3use Fisharebest\Webtrees\Http\RequestHandlers\MessagePage; 4use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptChange; 5use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptTree; 6use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectChange; 7use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectTree; 8use Fisharebest\Webtrees\I18N; 9use Fisharebest\Webtrees\Tree; 10 11?> 12 13<h2 class="wt-page-title"> 14 <?= $title ?> 15</h2> 16 17<?php if ($changes === []) : ?> 18 <p> 19 <?= I18N::translate('There are no pending changes.') ?> 20 </p> 21 <p> 22 <a class="btn btn-primary" href="<?= e($url) ?>"> 23 <?= I18N::translate('continue') ?> 24 </a> 25 </p> 26<?php endif ?> 27 28<ul class="nav nav-tabs" role="tablist"> 29 <?php foreach ($changes as $tree_id => $gedcom_changes) : ?> 30 <li class="nav-item"> 31 <a class="nav-link <?= $tree_id === $active_tree_id ? 'active' : '' ?>" data-toggle="tab" href="#tree-<?= e($tree_id) ?>" aria-controls="tree-<?= e($tree_id) ?>" id="tree-<?= e($tree_id) ?>-tab"> 32 <?= e(Tree::findById($tree_id)->title()) ?> 33 <span class="badge badge-secondary"> 34 <?= I18N::number(count($gedcom_changes)) ?> 35 </span> 36 </a> 37 </li> 38 <?php endforeach ?> 39</ul> 40 41<div class="tab-content"> 42 <?php foreach ($changes as $tree_id => $gedcom_changes) : ?> 43 <div class="tab-pane fade <?= $tree_id === $active_tree_id ? 'show active' : '' ?>" id="tree-<?= e($tree_id) ?>" role="tabpanel" aria-labelledby="tree-<?= e($tree_id) ?>-tab"> 44 <?php foreach ($gedcom_changes as $xref => $record_changes) : ?> 45 <h3 class="pt-2"> 46 <a href="<?= e($record_changes[0]->record->url()) ?>"><?= $record_changes[0]->record->fullName() ?></a> 47 </h3> 48 49 <table class="table table-bordered table-sm"> 50 <thead class="thead-default"> 51 <tr> 52 <th><?= I18N::translate('Accept') ?></th> 53 <th><?= I18N::translate('Changes') ?></th> 54 <th><?= I18N::translate('User') ?></th> 55 <th><?= I18N::translate('Date') ?></th> 56 <th><?= I18N::translate('Reject') ?></th> 57 </tr> 58 </thead> 59 <tbody> 60 <?php foreach ($record_changes as $record_change) : ?> 61 <tr> 62 <td> 63 <a class="btn btn-primary" href="#" data-post-url="<?= e(route(PendingChangesAcceptChange::class, ['tree' => $record_change->gedcom_name, 'xref' => $record_change->xref, 'change' => $record_change->change_id])) ?>"> 64 <?= I18N::translate('Accept') ?> 65 </a> 66 </td> 67 68 <td> 69 <?php foreach ($record_change->record->facts() as $fact) : ?> 70 <?php if ($fact->getTag() !== 'CHAN' && $fact->isPendingAddition()) : ?> 71 <div class="new"> 72 <?= strip_tags($fact->summary()) ?> 73 </div> 74 <?php elseif ($fact->getTag() !== 'CHAN' && $fact->isPendingDeletion()) : ?> 75 <div class="old"> 76 <?= strip_tags($fact->summary()) ?> 77 </div> 78 <?php endif ?> 79 <?php endforeach ?> 80 </td> 81 82 <td> 83 <a href="<?= e(route(MessagePage::class, ['to' => $record_change->user_name, 'subject' => I18N::translate('Pending changes') . ' - ' . strip_tags($record_change->record->fullName()), 'body' => $record_change->record->url(), 'tree' => $record_change->gedcom_name])) ?>" title="<?= I18N::translate('Send a message') ?>"> 84 <?= e($record_change->real_name) ?> - <?= e($record_change->user_name) ?> 85 </a> 86 </td> 87 88 <td> 89 <?= view('components/datetime', ['timestamp' => $record_change->change_time]) ?> 90 </td> 91 92 <td> 93 <a class="btn btn-secondary" href="#" data-post-url="<?= e(route(PendingChangesRejectChange::class, ['tree' => $record_change->gedcom_name, 'xref' => $record_change->xref, 'change' => $record_change->change_id])) ?>"> 94 <?= I18N::translate('Reject') ?> 95 </a> 96 </td> 97 </tr> 98 <?php endforeach ?> 99 </tbody> 100 </table> 101 <?php endforeach ?> 102 103 <div class="d-flex justify-content-between"> 104 <a class="btn btn-primary" href="#" data-post-url="<?= e(route(PendingChangesAcceptTree::class, ['tree' => $tree->name()])) ?>"> 105 <?= I18N::translate('Accept all changes') ?> 106 </a> 107 108 <a class="btn btn-secondary" href="#" data-post-url="<?= e(route(PendingChangesRejectTree::class, ['tree' => $tree->name()])) ?>" data-confirm="<?= I18N::translate('Are you sure you want to reject all the changes to this family tree?') ?>"> 109 <?= I18N::translate('Reject all changes') ?> 110 </a> 111 </div> 112 </div> 113 <?php endforeach ?> 114</div> 115