<!DOCTYPE html>
<html lang="<%= lang %>">
<head>
    <meta charset="UTF-8">
    <title><%= t.adminServiceLogs.title %></title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
</head>
<body>

<nav class="navbar navbar-dark bg-dark position-relative px-3">
    <div class="position-absolute top-50 start-50 translate-middle
                d-flex align-items-center gap-2 text-white">
        <span style="font-size:1.3rem;">📜</span>
        <span class="fw-semibold fs-5"><%= t.adminServiceLogs.title %></span>
    </div>
    <div class="ms-auto">
        <a href="/dashboard" class="btn btn-outline-light btn-sm">
            ⬅️ <%= t.global.dashboard %>
        </a>
    </div>
</nav>

<div class="container mt-4">
<table class="table table-sm table-bordered">
    <thead class="table-light">
        <tr>
            <th><%= t.adminServiceLogs.date %></th>
            <th><%= t.adminServiceLogs.user %></th>
            <th><%= t.adminServiceLogs.action %></th>
            <th><%= t.adminServiceLogs.before %></th>
            <th><%= t.adminServiceLogs.after %></th>
        </tr>
    </thead>
    <tbody>
    <% logs.forEach(l => { %>
        <tr>
            <td><%= new Date(l.created_at).toLocaleString("de-DE") %></td>
            <td><%= l.username %></td>
            <td><%= l.action %></td>
            <td><pre><%= l.old_value || "-" %></pre></td>
            <td><pre><%= l.new_value || "-" %></pre></td>
        </tr>
    <% }) %>
    </tbody>
</table>
<br>
</div>
</body>
</html>
