blob: 968d48649af26e39083d58848941e1c1c702a620 (
plain)
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
|
<?php
declare(strict_types=1);
use Fisharebest\Webtrees\Contracts\UserInterface;
use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\GedcomRecord;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Location;
use Fisharebest\Webtrees\Media;
use Fisharebest\Webtrees\Note;
use Fisharebest\Webtrees\Repository;
use Fisharebest\Webtrees\Source;
use Fisharebest\Webtrees\Submitter;
use Fisharebest\Webtrees\Timestamp;
use Fisharebest\Webtrees\View;
use Illuminate\Support\Collection;
/**
* @var int $limit_high
* @var int $limit_low
* @var array<array<int,string>> $order
* @var Collection<int,object{record:GedcomRecord,time:Timestamp,user:UserInterface}> $rows
* @var bool $show_date
* @var bool $show_user
*/
?>
<div class="table-responsive">
<table
id="wt-datatables-changes"
class="table table-sm wt-table-changes datatables d-none"
<?= view('lists/datatables-attributes') ?>
data-paging="<?= $rows->count() >= $limit_high ? 'true' : 'false' ?>"
data-filter="false"
data-info="false"
data-length-change="false"
data-order="<?= e(json_encode($order, JSON_THROW_ON_ERROR)) ?>"
data-page-length="<?= e($limit_low) ?>"
>
<thead>
<tr>
<th class="wt-side-block-optional">
<span class="visually-hidden">
<?= I18N::translate('Type') ?>
</span>
</th>
<th>
<?= I18N::translate('Record') ?>
</th>
<th class="<?= $show_date ? '' : 'd-none' ?>">
<?= I18N::translate('Last change') ?>
</th>
<th class="<?= $show_user ? '' : 'd-none' ?>">
<?= I18N::translate('Editor') ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row) : ?>
<tr>
<td data-sort="<?= $row->record->tag() ?>" class="text-centre wt-side-block-optional">
<?php if ($row->record->tag() === Individual::RECORD_TYPE) : ?>
<?= view('icons/individual') ?>
<span class="visually-hidden"><?= I18N::translate('Individual') ?></span>
<?php elseif ($row->record->tag() === Family::RECORD_TYPE) : ?>
<?= view('icons/family') ?>
<span class="visually-hidden"><?= I18N::translate('Family') ?></span>
<?php elseif ($row->record->tag() === Media::RECORD_TYPE) : ?>
<?= view('icons/media') ?>
<span class="visually-hidden"><?= I18N::translate('Media') ?></span>
<?php elseif ($row->record->tag() === Note::RECORD_TYPE) : ?>
<?= view('icons/note') ?>
<span class="visually-hidden"><?= I18N::translate('Note') ?></span>
<?php elseif ($row->record->tag() === Source::RECORD_TYPE) : ?>
<?= view('icons/source') ?>
<span class="visually-hidden"><?= I18N::translate('Source') ?></span>
<?php elseif ($row->record->tag() === Submitter::RECORD_TYPE) : ?>
<?= view('icons/submitter') ?>
<span class="visually-hidden"><?= I18N::translate('Submitter') ?></span>
<?php elseif ($row->record->tag() === Repository::RECORD_TYPE) : ?>
<?= view('icons/repository') ?>
<span class="visually-hidden"><?= I18N::translate('Repository') ?></span>
<?php elseif ($row->record->tag() === Location::RECORD_TYPE) : ?>
<?= view('icons/location') ?>
<span class="visually-hidden"><?= I18N::translate('Location') ?></span>
<?php endif ?>
</td>
<td data-sort="<?= e($row->record->sortName()) ?>">
<a href="<?= e($row->record->url()) ?>"><?= $row->record->fullName() ?></a>
</td>
<td data-sort="<?= sprintf('x%07d', $row->time->timestamp()) ?>" class="<?= $show_date ? '' : 'd-none' ?>">
<?= view('components/datetime', ['timestamp' => $row->time]) ?>
</td>
<td class="<?= $show_user ? '' : 'd-none' ?>">
<?= e($row->user->userName()) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<?php View::push('javascript') ?>
<script>
$(".wt-table-changes").dataTable().removeClass("d-none");
</script>
<?php View::endpush() ?>
|