|
{% extends "base.html" %} |
|
|
|
{% block title %}Monitored Events - PoliSage{% endblock %} |
|
|
|
{% block content %} |
|
<div class="container mt-4"> |
|
<div class="d-flex justify-content-between align-items-center mb-3"> |
|
<h2>Detected Events</h2> |
|
|
|
<a href="{{ url_for("monitoring.list_sources") }}" class="btn btn-outline-secondary"> |
|
Manage Sources |
|
</a> |
|
</div> |
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %} |
|
{% if messages %} |
|
{% for category, message in messages %} |
|
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert"> |
|
{{ message }} |
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
|
</div> |
|
{% endfor %} |
|
{% endif %} |
|
{% endwith %} |
|
|
|
{% if events %} |
|
<div class="list-group"> |
|
{% for event in events %} |
|
<a href="{{ url_for("monitoring.view_event", event_id=event.id) }}" class="list-group-item list-group-item-action flex-column align-items-start"> |
|
<div class="d-flex w-100 justify-content-between"> |
|
<h5 class="mb-1">{{ event.event_summary | truncate(120) }}</h5> |
|
<small>{{ event.detected_at.strftime("%Y-%m-%d %H:%M") }}</small> |
|
</div> |
|
<p class="mb-1">Source: <span class="text-muted">{{ event.source.name if event.source else "Unknown" }}</span> | Status: <span class="badge bg-light text-dark">{{ event.status }}</span> {% if event.relevance_score %} | Relevance: {{ "%.1f"|format(event.relevance_score * 100) }}% {% endif %}</p> |
|
{% if event.related_legislation %} |
|
<small>Related Legislation: <span class="text-primary">{{ event.related_legislation.title }}</span></small> |
|
{% endif %} |
|
</a> |
|
{% endfor %} |
|
</div> |
|
|
|
{% else %} |
|
<div class="alert alert-info" role="alert"> |
|
No monitored events found yet. |
|
</div> |
|
{% endif %} |
|
</div> |
|
{% endblock %} |
|
|
|
|