rinkplanner/hub/views/admin_audit.php

42 lines
1.6 KiB
PHP
Raw Normal View History

<?php /** @var array $entries */ ?>
<div class="page-head">
<div>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin.audit_lede', ['count' => count($entries)])) ?></p>
</div>
</div>
<?php $active = 'audit'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<section class="panel">
<?php if (!$entries): ?>
<p class="muted"><?= e(t('admin.audit_empty')) ?></p>
<?php else: ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr>
<th><?= e(t('table.time')) ?></th>
<th><?= e(t('table.actor')) ?></th>
<th><?= e(t('table.action')) ?></th>
<th><?= e(t('table.subject')) ?></th>
<th><?= e(t('table.detail')) ?></th>
<th><?= e(t('table.ip')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($entries as $entry): ?>
<tr>
<td><?= e(fmt_dt($entry['created_at'])) ?></td>
<td><?= e($entry['actor_name'] ?: '–') ?></td>
<td><code><?= e($entry['action']) ?></code></td>
<td><?= e(trim(($entry['subject_type'] ?? '') . ' ' . ($entry['subject_id'] ?? ''))) ?: '–' ?></td>
<td><?= e($entry['detail'] ?: '–') ?></td>
<td><?= e($entry['ip'] ?: '–') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</section>