xref: /webtrees/resources/views/record-page-pending.phtml (revision 0f5fd22fb1857ad87285e5357592434d47b1f3bf)
1*0f5fd22fSGreg Roach<?php
2*0f5fd22fSGreg Roach
3*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Auth;
4*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
5*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptRecord;
6*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectRecord;
7*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\I18N;
8*0f5fd22fSGreg Roach
9*0f5fd22fSGreg Roach/**
10*0f5fd22fSGreg Roach * @var GedcomRecord $record
11*0f5fd22fSGreg Roach */
12*0f5fd22fSGreg Roach
13*0f5fd22fSGreg Roach?>
14*0f5fd22fSGreg Roach
15*0f5fd22fSGreg Roach<?php if ($record->isPendingDeletion()) : ?>
16*0f5fd22fSGreg Roach    <?php if (Auth::isModerator($record->tree())) : ?>
17*0f5fd22fSGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesAcceptRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesRejectRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
18*0f5fd22fSGreg Roach    <?php elseif (Auth::isEditor($record->tree())) : ?>
19*0f5fd22fSGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This record has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
20*0f5fd22fSGreg Roach    <?php endif ?>
21*0f5fd22fSGreg Roach<?php elseif ($record->isPendingAddition()) : ?>
22*0f5fd22fSGreg Roach    <?php if (Auth::isModerator($record->tree())) : ?>
23*0f5fd22fSGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesAcceptRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesRejectRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
24*0f5fd22fSGreg Roach    <?php elseif (Auth::isEditor($record->tree())) : ?>
25*0f5fd22fSGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This record has been edited. The changes need to be reviewed by a moderator.') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
26*0f5fd22fSGreg Roach    <?php endif ?>
27*0f5fd22fSGreg Roach<?php endif ?>
28