FossilRepo

fossilrepo / templates / organization / audit_log.html
Source Blame History 73 lines
c588255… ragelink 1 {% extends "base.html" %}
c588255… ragelink 2 {% load humanize %}
c588255… ragelink 3 {% block title %}Audit Log — Fossilrepo{% endblock %}
c588255… ragelink 4
c588255… ragelink 5 {% block content %}
c588255… ragelink 6 <div class="md:flex md:items-center md:justify-between mb-6">
c588255… ragelink 7 <div>
c588255… ragelink 8 <h1 class="text-2xl font-bold text-gray-100">Audit Log</h1>
c588255… ragelink 9 <p class="mt-1 text-sm text-gray-400">History of changes across all tracked models.</p>
c588255… ragelink 10 </div>
c588255… ragelink 11 </div>
c588255… ragelink 12
c588255… ragelink 13 <!-- Filter by model type -->
313537c… ragelink 14 <div class="flex flex-wrap gap-2 mb-6">
c588255… ragelink 15 <a href="{% url 'organization:audit_log' %}"
c588255… ragelink 16 class="rounded-md px-3 py-2 text-sm font-medium {% if not model_filter %}bg-brand text-white{% else %}bg-gray-700 text-gray-300 ring-1 ring-inset ring-gray-600 hover:bg-gray-600{% endif %}">
c588255… ragelink 17 All
c588255… ragelink 18 </a>
c588255… ragelink 19 {% for model_name in available_models %}
c588255… ragelink 20 <a href="{% url 'organization:audit_log' %}?model={{ model_name }}"
c588255… ragelink 21 class="rounded-md px-3 py-2 text-sm font-medium {% if model_filter == model_name %}bg-brand text-white{% else %}bg-gray-700 text-gray-300 ring-1 ring-inset ring-gray-600 hover:bg-gray-600{% endif %}">
c588255… ragelink 22 {{ model_name }}
c588255… ragelink 23 </a>
c588255… ragelink 24 {% endfor %}
c588255… ragelink 25 </div>
c588255… ragelink 26
c588255… ragelink 27 <!-- Audit entries table -->
313537c… ragelink 28 <div class="overflow-x-auto rounded-lg border border-gray-700 bg-gray-800 shadow-sm">
c588255… ragelink 29 <table class="min-w-full divide-y divide-gray-700">
c588255… ragelink 30 <thead class="bg-gray-900">
c588255… ragelink 31 <tr>
c588255… ragelink 32 <th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Date</th>
c588255… ragelink 33 <th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">User</th>
c588255… ragelink 34 <th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Action</th>
c588255… ragelink 35 <th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Model</th>
c588255… ragelink 36 <th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Object</th>
c588255… ragelink 37 </tr>
c588255… ragelink 38 </thead>
c588255… ragelink 39 <tbody class="divide-y divide-gray-700 bg-gray-800">
c588255… ragelink 40 {% for entry in entries %}
c588255… ragelink 41 <tr class="hover:bg-gray-700/50">
c588255… ragelink 42 <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400" title="{{ entry.date|date:'Y-m-d H:i:s' }}">
c588255… ragelink 43 {{ entry.date|naturaltime }}
c588255… ragelink 44 </td>
c588255… ragelink 45 <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-300">
c588255… ragelink 46 {% if entry.user %}{{ entry.user.username }}{% else %}<span class="text-gray-500">system</span>{% endif %}
c588255… ragelink 47 </td>
c588255… ragelink 48 <td class="px-6 py-4 whitespace-nowrap text-sm">
c588255… ragelink 49 {% if entry.action == "Created" %}
c588255… ragelink 50 <span class="inline-flex rounded-full bg-green-900/50 px-2 text-xs font-semibold leading-5 text-green-300">Created</span>
c588255… ragelink 51 {% elif entry.action == "Changed" %}
c588255… ragelink 52 <span class="inline-flex rounded-full bg-yellow-900/50 px-2 text-xs font-semibold leading-5 text-yellow-300">Changed</span>
c588255… ragelink 53 {% elif entry.action == "Deleted" %}
c588255… ragelink 54 <span class="inline-flex rounded-full bg-red-900/50 px-2 text-xs font-semibold leading-5 text-red-300">Deleted</span>
c588255… ragelink 55 {% else %}
c588255… ragelink 56 <span class="inline-flex rounded-full bg-gray-700 px-2 text-xs font-semibold leading-5 text-gray-300">{{ entry.action }}</span>
c588255… ragelink 57 {% endif %}
c588255… ragelink 58 </td>
c588255… ragelink 59 <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ entry.model }}</td>
c588255… ragelink 60 <td class="px-6 py-4 text-sm text-gray-300 max-w-xs truncate">{{ entry.object_repr }}</td>
c588255… ragelink 61 </tr>
c588255… ragelink 62 {% empty %}
c588255… ragelink 63 <tr>
c588255… ragelink 64 <td colspan="5" class="px-6 py-8 text-center text-sm text-gray-400">No audit entries found{% if model_filter %} for {{ model_filter }}{% endif %}.</td>
c588255… ragelink 65 </tr>
c588255… ragelink 66 {% endfor %}
c588255… ragelink 67 </tbody>
c588255… ragelink 68 </table>
c588255… ragelink 69 </div>
c588255… ragelink 70 {% with extra_params="&model="|add:model_filter %}
c588255… ragelink 71 {% include "includes/_pagination_manual.html" %}
c588255… ragelink 72 {% endwith %}
c588255… ragelink 73 {% endblock %}

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button