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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
<?php use Fisharebest\Webtrees\Functions\FunctionsDate; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Tree; ?>
<h2 class="wt-page-title">
<?= $title ?>
</h2>
<?php if (empty($changes)) : ?>
<p>
<?= I18N::translate('There are no pending changes.') ?>
</p>
<p>
<a class="btn btn-primary" href="<?= e($url) ?>">
<?= I18N::translate('continue') ?>
</a>
</p>
<?php endif ?>
<ul class="nav nav-tabs" role="tablist">
<?php foreach ($changes as $tree_id => $gedcom_changes) : ?>
<li class="nav-item">
<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">
<?= e(Tree::findById($tree_id)->title()) ?>
<span class="badge badge-secondary">
<?= I18N::number(count($gedcom_changes)) ?>
</span>
</a>
</li>
<?php endforeach ?>
</ul>
<div class="tab-content">
<?php foreach ($changes as $tree_id => $gedcom_changes) : ?>
<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">
<?php foreach ($gedcom_changes as $xref => $record_changes) : ?>
<h3 class="pt-2">
<a href="<?= e($record_changes[0]->record->url()) ?>"><?= $record_changes[0]->record->getFullName() ?></a>
</h3>
<table class="table table-bordered table-sm">
<thead class="thead-default">
<tr>
<th><?= I18N::translate('Accept') ?></th>
<th><?= I18N::translate('Changes') ?></th>
<th><?= I18N::translate('User') ?></th>
<th><?= I18N::translate('Date') ?></th>
<th><?= I18N::translate('Reject') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($record_changes as $record_change) : ?>
<tr>
<td>
<form action="<?= e(route('accept-pending', ['change_id' => $record_change->change_id, 'xref' => $record_change->xref, 'ged' => $record_change->gedcom_name, 'url' => $url])) ?>" method="POST">
<?= csrf_field() ?>
<button class="btn btn-primary" type="submit">
<?= I18N::translate('Accept') ?>
</button>
</form>
</td>
<td>
<?php foreach ($record_change->record->facts() as $fact) : ?>
<?php if ($fact->getTag() !== 'CHAN' && $fact->isPendingAddition()) : ?>
<div class="new">
<?= strip_tags($fact->summary()) ?>
</div>
<?php elseif ($fact->getTag() !== 'CHAN' && $fact->isPendingDeletion()) : ?>
<div class="old">
<?= strip_tags($fact->summary()) ?>
</div>
<?php endif ?>
<?php endforeach ?>
</td>
<td>
<a href="<?= e(route('message', ['to' => $record_change->user_name, 'subject' => I18N::translate('Pending changes') . ' - ' . strip_tags($record_change->record->getFullName()), 'body' => WT_BASE_URL . $record_change->record->url(), 'ged' => $record_change->gedcom_name])) ?>" title="<?= I18N::translate('Send a message') ?>">
<?= e($record_change->real_name) ?> - <?= e($record_change->user_name) ?>
</a>
</td>
<td>
<?= FunctionsDate::formatTimestamp($record_change->change_time->timestamp) ?>
</td>
<td>
<form action="<?= e(route('reject-pending', ['change_id' => $record_change->change_id, 'xref' => $record_change->xref, 'ged' => $record_change->gedcom_name, 'url' => $url])) ?>" method="POST">
<?= csrf_field() ?>
<button class="btn btn-secondary" type="submit">
<?= I18N::translate('Reject') ?>
</button>
</form>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endforeach ?>
<div class="d-flex justify-content-between">
<form action="<?= e(route('accept-all-changes', ['ged' => $tree->name(), 'url' => $url])) ?>" method="POST">
<?= csrf_field() ?>
<button class="btn btn-primary" type="submit">
<?= I18N::translate('Accept all changes') ?>
</button>
</form>
<form action="<?= e(route('reject-all-changes', ['ged' => $tree->name(), 'url' => $url])) ?>" method="POST">
<?= csrf_field() ?>
<button class="btn btn-secondary" type="submit" data-confirm="<?= I18N::translate('Are you sure you want to reject all the changes to this family tree?') ?>" onclick="return confirm(this.dataset.confirm);">
<?= I18N::translate('Reject all changes') ?>
</button>
</form>
</div>
</div>
<?php endforeach ?>
</div>
|