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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?>
<h1><?= $title ?></h1>
<form method="get" action="<?= e(route('admin-site-logs')) ?>>" class="form" name="logs">
<input type="hidden" name="route" value="admin-site-logs" id="route">
<input type="hidden" name="action" value="show">
<div class="row">
<div class="form-group col-xs-6 col-sm-3">
<label for="from">
<?= /* I18N: label for the start of a date range (from x to y) */ I18N::translate('From') ?>
</label>
<input type="date" class="form-control" id="from" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="from" value="<?= e($from) ?>" required>
</div>
<div class="form-group col-xs-6 col-sm-3">
<label for="to">
<?= /* I18N: label for the end of a date range (from x to y) */ I18N::translate('To') ?>
</label>
<input type="date" class="form-control" id="to" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="to" value="<?= e($to) ?>" required>
</div>
<div class="form-group col-xs-6 col-sm-2">
<label for="type">
<?= I18N::translate('Type') ?>
</label>
<?= view('components/select', ['name' => 'type', 'selected' => $type, 'options' => ['' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search']]) ?>
</div>
<div class="form-group col-xs-6 col-sm-4">
<label for="ip">
<?= I18N::translate('IP address') ?>
</label>
<input class="form-control" type="text" id="ip" name="ip" value="<?= e($ip) ?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label for="text">
<?= I18N::translate('Message') ?>
</label>
<input class="form-control" type="text" id="text" name="text" value="<?= e($text) ?>">
</div>
<div class="form-group col-sm-4">
<label for="username">
<?= I18N::translate('User') ?>
</label>
<?= view('components/select', ['name' => 'username', 'selected' => $username, 'options' => $user_options]) ?>
</div>
<div class="form-group col-sm-4">
<label for="gedc">
<?= I18N::translate('Family tree') ?>
</label>
<?= view('components/select', ['name' => 'gedc', 'selected' => $gedc, 'options' => $tree_options]) ?>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary">
<?= view('icons/search') ?>
<?= /* I18N: A button label. */ I18N::translate('search') ?>
</button>
<a href="<?= e(route('admin-site-logs-export', ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'username' => $username, 'gedc' => $gedc])) ?>" class="btn btn-primary" <?= $action === 'show' ? '' : 'disabled' ?>>
<?= view('icons/download') ?>
<?= /* I18N: A button label. */ I18N::translate('download') ?>
</a>
<a href="#" class="btn btn-primary" data-confirm="<?= I18N::translate('Permanently delete these records?') ?>" id="delete-button" <?= $action === 'show' ? '' : 'disabled' ?>>
<?= view('icons/delete') ?>
<?= /* I18N: A button label. */ I18N::translate('delete') ?>
</a>
</div>
</form>
<?php if ($action) : ?>
<table class="table table-bordered table-sm table-hover table-site-logs"
<?= view('lists/datatables-attributes') ?>
data-ajax="<?= e(route('admin-site-logs-data', ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'username' => $username, 'gedc' => $gedc])) ?>"
data-server-side="true"
>
<thead>
<tr>
<th></th>
<th><?= I18N::translate('Timestamp') ?></th>
<th><?= I18N::translate('Type') ?></th>
<th><?= I18N::translate('Message') ?></th>
<th><?= I18N::translate('IP address') ?></th>
<th><?= I18N::translate('User') ?></th>
<th><?= I18N::translate('Family tree') ?></th>
</tr>
</thead>
</table>
<?php endif ?>
<?php View::push('javascript') ?>
<script>
$("#delete-button").click(function() {
if (confirm(this.dataset.confirm)) {
var data = $(this).closest('form').serialize();
data.csrf = <?= json_encode(csrf_token()) ?>;
jQuery.post(
<?= json_encode(route('admin-site-logs-delete')) ?>,
data,
function() { document.location.reload(); }
)
}
});
$(".table-site-logs").dataTable( {
processing: true,
sorting: [[ 0, "desc" ]],
columns: [
/* log_id */ { visible: false },
/* Timestamp */ { sort: 0 },
/* Type */ { },
/* message */ { },
/* IP address */ { },
/* User */ { },
/* Family tree */ { }
]
});
</script>
<?php View::endpush() ?>
|