{% extends 'base.html' %} {% load static %} {% block title %}Security Alerts{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

🔔 Security Alerts

{{ page_obj.paginator.count }}
Total Alerts
{% with unresolved=0 %} {% for alert in page_obj %} {% if not alert.is_resolved %} {% with unresolved=unresolved|add:1 %} {% endwith %} {% endif %} {% endfor %} {{ unresolved }} {% endwith %}
Unresolved
{% with critical=0 %} {% for alert in page_obj %} {% if alert.severity == 'critical' and not alert.is_resolved %} {% with critical=critical|add:1 %} {% endwith %} {% endif %} {% endfor %} {{ critical }} {% endwith %}
Critical
{% with resolved=0 %} {% for alert in page_obj %} {% if alert.is_resolved %} {% with resolved=resolved|add:1 %} {% endwith %} {% endif %} {% endfor %} {{ resolved }} {% endwith %}
Resolved
🔍 Filter Alerts
✕ Clear
Security Alerts ({{ page_obj.paginator.count }} total)
Showing {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }}
{% for alert in page_obj %}
{{ alert.title }}
{{ alert.severity }} {{ alert.get_alert_type_display }} {% if alert.is_resolved %} ✓ Resolved {% endif %}

{{ alert.description }}

{% if alert.user %}
👤 User: {{ alert.user.get_full_name }} ({{ alert.user.role|title }})
{% endif %} {% if alert.ip_address %}
🌐 IP Address: {{ alert.ip_address }}
{% endif %} {% if alert.additional_context %}
Additional Context:
{{ alert.additional_context|pprint }}
{% endif %}
⏰ Created: {{ alert.created_at|date:"M d, Y H:i:s" }} ({{ alert.created_at|timesince }} ago)
{% if alert.is_resolved %}
✓ Resolved by: {{ alert.resolved_by.get_full_name }} on {{ alert.resolved_at|date:"M d, Y H:i:s" }} {% if alert.resolution_notes %}
Notes: {{ alert.resolution_notes }} {% endif %}
{% endif %}
{{ alert.created_at|timesince }} ago
{% if not alert.is_resolved %} {% endif %} {% if alert.user %}
📈 Analyze User {% endif %}
{% empty %}
No Security Alerts

{% if filters.resolved == 'false' %} All security alerts have been resolved. {% else %} No security alerts match your current filters. {% endif %}

{% endfor %} {% if page_obj.has_other_pages %} {% endif %}
{% endblock %} {% block extra_js %} {% endblock %}