{% extends "base.html" %} {% from "components/ui.html" import page_header, breadcrumb_nav, badge %} {% block title %}Audit Log Details - {{ config.APP_NAME }}{% endblock %} {% block content %} {% set breadcrumbs = [ {'text': 'Audit Logs', 'url': url_for('audit_logs.list_audit_logs')}, {'text': 'Details'} ] %} {{ page_header( icon_class='fas fa-history', title_text='Audit Log Details', subtitle_text='Detailed information about this change', breadcrumbs=breadcrumbs ) }}

{{ _('Change Information') }}

Timestamp
{{ audit_log.created_at|user_datetime }}
User
{% if audit_log.user %} {{ audit_log.user.display_name }} ({{ audit_log.user.username }}) {% else %} System {% endif %}
Action
{{ badge(audit_log.action, audit_log.get_color()) }}
Entity
{{ audit_log.entity_type }}#{{ audit_log.entity_id }} {% if audit_log.entity_name %}
{{ audit_log.entity_name }} {% endif %}
{% if audit_log.field_name %}
Field
{{ audit_log.field_name }}
{% endif %} {% if audit_log.change_description %}
Description
{{ audit_log.change_description }}
{% endif %} {% if audit_log.reason %}
{{ _('Reason') }}
{{ audit_log.reason }}
{% endif %} {% if audit_log.entity_type == 'TimeEntry' and audit_log.get_entity_metadata() %} {% set metadata = audit_log.get_entity_metadata() %}
{{ _('Entity Context') }}
{% if metadata.project_name %}
{{ _('Project') }}: {{ metadata.project_name }}{% if metadata.project_id %} (ID: {{ metadata.project_id }}){% endif %}
{% endif %} {% if metadata.client_name %}
{{ _('Client') }}: {{ metadata.client_name }}{% if metadata.client_id %} (ID: {{ metadata.client_id }}){% endif %}
{% endif %} {% if metadata.task_name %}
{{ _('Task') }}: {{ metadata.task_name }}{% if metadata.task_id %} (ID: {{ metadata.task_id }}){% endif %}
{% endif %} {% if metadata.created_at %}
{{ _('TimeEntry Created') }}: {% if metadata.created_at is string %} {{ metadata.created_at[:19]|replace('T', ' ') }} {% else %} {{ metadata.created_at|user_datetime }} {% endif %}
{% endif %} {% if metadata.user_name %}
{{ _('Entry Owner') }}: {{ metadata.user_name }}{% if metadata.user_id %} (ID: {{ metadata.user_id }}){% endif %}
{% endif %}
{% endif %}
{% if audit_log.field_name %}

{{ _('Field Change Details') }}

{% if audit_log.old_value %}
Old Value
{{ audit_log.get_old_value() }}
{% endif %} {% if audit_log.new_value %}
New Value
{{ audit_log.get_new_value() }}
{% endif %}
{% endif %} {% if audit_log.get_full_old_state() or audit_log.get_full_new_state() %}

{{ _('Full Entity State') }}

{% if audit_log.get_full_old_state() %}

{{ _('Before Change') }}

{% set old_state = audit_log.get_full_old_state() %} {% if old_state is mapping or old_state is iterable and old_state is not string %}
{{ old_state|tojson(indent=2) }}
{% else %}
{{ old_state }}
{% endif %}
{% endif %} {% if audit_log.get_full_new_state() %}

{{ _('After Change') }}

{% set new_state = audit_log.get_full_new_state() %} {% if new_state is mapping or new_state is iterable and new_state is not string %}
{{ new_state|tojson(indent=2) }}
{% else %}
{{ new_state }}
{% endif %}
{% endif %}
{% endif %}

{{ _('Request Information') }}

{% if audit_log.ip_address %}
IP Address
{{ audit_log.ip_address }}
{% endif %} {% if audit_log.request_path %}
Request Path
{{ audit_log.request_path }}
{% endif %} {% if audit_log.user_agent %}
User Agent
{{ audit_log.user_agent }}
{% endif %}
Back to List View Entity History
{% endblock %}