Initial commit: InviteMe production redesign
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Аудит-лог — InviteMe{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Аудит-лог</h1>
|
||||
</div>
|
||||
|
||||
<form method="GET" class="row g-3 mb-4">
|
||||
<div class="col-md-3">
|
||||
<select name="action" class="form-select">
|
||||
<option value="">Все действия</option>
|
||||
{% for action in actions %}
|
||||
<option value="{{ action }}" {% if action == action_filter %}selected{% endif %}>{{ action }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="user" class="form-control" placeholder="Пользователь" value="{{ user_filter }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="submit" class="btn btn-primary">Фильтр</button>
|
||||
<a href="{{ url_for('main.admin_logs') }}" class="btn btn-secondary">Сброс</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Время</th>
|
||||
<th>Пользователь</th>
|
||||
<th>IP</th>
|
||||
<th>Действие</th>
|
||||
<th>Объект</th>
|
||||
<th>ID объекта</th>
|
||||
<th>Детали</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for log in logs.items %}
|
||||
<tr>
|
||||
<td>{{ log.created_at | localtime('%d.%m.%Y %H:%M:%S') }}</td>
|
||||
<td>{{ log.username or '-' }}</td>
|
||||
<td>{{ log.ip_address or '-' }}</td>
|
||||
<td><span class="badge bg-secondary">{{ log.action }}</span></td>
|
||||
<td>{{ log.target_type or '-' }}</td>
|
||||
<td>{{ log.target_id or '-' }}</td>
|
||||
<td>{{ log.details or '-' }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7" class="text-center text-muted">Записи не найдены</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if logs.pages > 1 %}
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if logs.has_prev %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ url_for('main.admin_logs', page=logs.prev_num, action=action_filter, user=user_filter) }}">Назад</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for page_num in logs.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
|
||||
{% if page_num %}
|
||||
{% if page_num == logs.page %}
|
||||
<li class="page-item active"><span class="page-link">{{ page_num }}</span></li>
|
||||
{% else %}
|
||||
<li class="page-item"><a class="page-link" href="{{ url_for('main.admin_logs', page=page_num, action=action_filter, user=user_filter) }}">{{ page_num }}</a></li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<li class="page-item disabled"><span class="page-link">...</span></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if logs.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ url_for('main.admin_logs', page=logs.next_num, action=action_filter, user=user_filter) }}">Вперёд</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user