1<?php use Fisharebest\Webtrees\I18N; ?> 2<?php use Fisharebest\Webtrees\View; ?> 3 4<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?> 5 6<h1><?= $title ?></h1> 7 8<form class="form" name="logs"> 9 <input type="hidden" name="route" value="admin-site-logs" id="route"> 10 <input type="hidden" name="action" value="show"> 11 12 <div class="row"> 13 <div class="form-group col-xs-6 col-sm-3"> 14 <label for="from"> 15 <?= /* I18N: label for the start of a date range (from x to y) */ I18N::translate('From') ?> 16 </label> 17 <input type="date" class="form-control" id="from" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="from" value="<?= e($from) ?>" required> 18 </div> 19 20 <div class="form-group col-xs-6 col-sm-3"> 21 <label for="to"> 22 <?= /* I18N: label for the end of a date range (from x to y) */ I18N::translate('To') ?> 23 </label> 24 <input type="date" class="form-control" id="to" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="to" value="<?= e($to) ?>" required> 25 </div> 26 27 <div class="form-group col-xs-6 col-sm-2"> 28 <label for="type"> 29 <?= I18N::translate('Type') ?> 30 </label> 31 <?= view('components/select', ['name' => 'type', 'selected' => $type, 'values' => ['' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search']]) ?> 32 </div> 33 34 <div class="form-group col-xs-6 col-sm-4"> 35 <label for="ip"> 36 <?= I18N::translate('IP address') ?> 37 </label> 38 <input class="form-control" type="text" id="ip" name="ip" value="<?= e($ip) ?>"> 39 </div> 40 </div> 41 42 <div class="row"> 43 <div class="form-group col-sm-4"> 44 <label for="text"> 45 <?= I18N::translate('Message') ?> 46 </label> 47 <input class="form-control" type="text" id="text" name="text" value="<?= e($text) ?>"> 48 </div> 49 50 <div class="form-group col-sm-4"> 51 <label for="username"> 52 <?= I18N::translate('User') ?> 53 </label> 54 <?= view('components/select', ['name' => 'username', 'selected' => $username, 'values' => $user_options]) ?> 55 </div> 56 57 <div class="form-group col-sm-4"> 58 <label for="gedc"> 59 <?= I18N::translate('Family tree') ?> 60 </label> 61 <?= view('components/select', ['name' => 'gedc', 'selected' => $gedc, 'values' => $tree_options]) ?> 62 </div> 63 </div> 64 65 <div class="text-center"> 66 <button type="submit" class="btn btn-primary"> 67 <?= view('icons/search') ?> 68 <?= /* I18N: A button label. */ I18N::translate('search') ?> 69 </button> 70 71 <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' ?>> 72 <?= view('icons/download') ?> 73 <?= /* I18N: A button label. */ I18N::translate('download') ?> 74 </a> 75 76 <a href="#" class="btn btn-primary" data-confirm="<?= I18N::translate('Permanently delete these records?') ?>" id="delete-button" <?= $action === 'show' ? '' : 'disabled' ?>> 77 <?= view('icons/delete') ?> 78 <?= /* I18N: A button label. */ I18N::translate('delete') ?> 79 </a> 80 </div> 81</form> 82 83<?php if ($action) : ?> 84 <table class="table table-bordered table-sm table-hover table-site-logs" 85 <?= view('lists/datatables-attributes') ?> 86 data-ajax="<?= e(route('admin-site-logs-data', ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'user' => $username, 'gedc' => $gedc])) ?>" 87 data-server-side="true" 88 > 89 <thead> 90 <tr> 91 <th></th> 92 <th><?= I18N::translate('Timestamp') ?></th> 93 <th><?= I18N::translate('Type') ?></th> 94 <th><?= I18N::translate('Message') ?></th> 95 <th><?= I18N::translate('IP address') ?></th> 96 <th><?= I18N::translate('User') ?></th> 97 <th><?= I18N::translate('Family tree') ?></th> 98 </tr> 99 </thead> 100 </table> 101<?php endif ?> 102 103<?php View::push('javascript') ?> 104<script> 105 $("#delete-button").click(function() { 106 if (confirm(this.dataset.confirm)) { 107 var data = $(this).closest('form').serialize(); 108 data.csrf = <?= json_encode(csrf_token()) ?>; 109 110 jQuery.post( 111 <?= json_encode(route('admin-site-logs-delete')) ?>, 112 data, 113 function() { document.location.reload(); } 114 ) 115 } 116 }); 117 118 $(".table-site-logs").dataTable( { 119 processing: true, 120 sorting: [[ 0, "desc" ]], 121 columns: [ 122 /* log_id */ { visible: false }, 123 /* Timestamp */ { sort: 0 }, 124 /* Type */ { }, 125 /* message */ { }, 126 /* IP address */ { }, 127 /* User */ { }, 128 /* Family tree */ { } 129 ] 130 }); 131</script> 132<?php View::endpush() ?> 133