contentdb/app/templates/macros/audit_log.html

68 lines
2.0 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 current_user.rank.atLeast(current_user.rank.MODERATOR) %}
2020-12-09 20:59:14 +01:00
href="{{ url_for('admin.audit_view', id=entry.id) }}">
{% 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;"
title="{{ _('Severity: %(sev)s.', sev=entry.severity.getTitle()) }}">
{% 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.getProfilePicURL() }}" />
<span class="pl-2">{{ entry.causer.username }}</span>
2020-12-09 20:59:14 +01:00
{% else %}
<i>Deleted User</i>
{% endif %}
</div>
<div class="col-sm">
{{ entry.title}}
{% if entry.description %}
<i class="fas fa-paperclip ml-3"></i>
{% endif %}
</div>
{% if entry.package %}
<div class="col-sm-auto text-muted">
<span class="pr-2">
{{ entry.package.title }}
</span>
<img
class="img-fluid"
style="max-height: 22px; max-width: 22px;"
2021-01-29 21:21:17 +01:00
src="{{ entry.package.getThumbnailOrPlaceholder() }}" />
2020-12-09 20:59:14 +01:00
</div>
{% endif %}
<div class="col-sm-auto text-muted">
{{ entry.created_at | datetime }}
</div>
</div>
</a>
{% else %}
<p class="list-group-item"><i>No audit log entires.</i></p>
{% endfor %}
</div>
{% endmacro %}