contentdb/app/templates/macros/audit_log.html

68 lines
2.1 KiB
HTML
Raw Normal View History

{% macro render_audit_log(log, current_user) -%}
2020-12-09 20:59:14 +01:00
<div class="list-group mt-3">
{% for entry in log %}
<a class="list-group-item list-group-item-action"
{% if entry.description and entry.check_perm(current_user, 'VIEW_AUDIT_DESCRIPTION') %}
2022-02-09 20:11:31 +01:00
href="{{ url_for('admin.audit_view', id_=entry.id) }}">
2020-12-09 20:59:14 +01:00
{% else %}
href="{{ entry.url }}">
{% endif %}
<div class="row {% if entry.severity == entry.severity.NORMAL %}text-muted{% endif %}">
<div class="col-sm-auto text-center" style="width: 50px;"
2024-06-08 13:27:05 +02:00
title="{{ _('Severity: %(sev)s.', sev=entry.severity.title) }}">
2020-12-09 20:59:14 +01:00
{% if entry.severity == entry.severity.MODERATION %}
<i class="fas fa-exclamation-triangle" style="color: yellow;"></i>
{% elif entry.severity == entry.severity.EDITOR %}
<i class="fas fa-users" style="color: #537eac;"></i>
{% elif entry.severity == entry.severity.USER %}
<i class="fas fa-user"></i>
{% endif %}
</div>
<div class="col-sm-2 text-muted">
{% if entry.causer %}
<img
class="img-fluid user-photo img-thumbnail img-thumbnail-1"
style="max-height: 22px;"
src="{{ entry.causer.get_profile_pic_url() }}" />
2020-12-09 20:59:14 +01:00
2023-08-22 20:58:43 +02:00
<span class="ps-2">{{ entry.causer.username }}</span>
2020-12-09 20:59:14 +01:00
{% else %}
2022-01-08 00:27:00 +01:00
<i>{{ _("Deleted User") }}</i>
2020-12-09 20:59:14 +01:00
{% endif %}
</div>
<div class="col-sm">
{{ entry.title}}
{% if entry.description %}
2023-08-22 20:58:43 +02:00
<i class="fas fa-paperclip ms-3"></i>
2020-12-09 20:59:14 +01:00
{% endif %}
</div>
{% if entry.package %}
<div class="col-sm-auto text-muted">
2023-08-22 20:58:43 +02:00
<span class="pe-2">
2020-12-09 20:59:14 +01:00
{{ entry.package.title }}
</span>
<img
class="img-fluid"
style="max-height: 22px; max-width: 22px;"
src="{{ entry.package.get_thumb_or_placeholder() }}" />
2020-12-09 20:59:14 +01:00
</div>
{% endif %}
2024-07-05 02:19:33 +02:00
<div class="col-sm-auto text-muted" title="{{ entry.created_at | full_datetime }}">
2020-12-09 20:59:14 +01:00
{{ entry.created_at | datetime }}
</div>
</div>
</a>
{% else %}
2022-01-08 00:27:00 +01:00
<p class="list-group-item"><i>{{ _("No audit log entries.") }}</i></p>
2020-12-09 20:59:14 +01:00
{% endfor %}
</div>
{% endmacro %}