Files
Alert-Hub-System/app/templates/alerts_list.html
T
2026-09-13 19:59:54 +01:00

65 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Manage Alerts{% endblock %}
{% block content %}
<div class="section-head">
<div>
<span class="section-tag">// section 02 add / remove / edit</span>
<h1>Manage alerts</h1>
<p class="lead">Create, modify, or retire alerts. Only administrators can make changes.</p>
</div>
{% if current_user.is_admin %}
<a href="{{ url_for('main.alert_new') }}" class="btn btn-primary">+ New alert</a>
{% endif %}
</div>
{% if alerts %}
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Category</th>
<th>Expires</th>
<th>Reminders</th>
<th>Status</th>
<th class="actions">Actions</th>
</tr>
</thead>
<tbody>
{% for a in alerts %}
<tr>
<td><strong>{{ a.title }}</strong>{% if a.description %}<br><span class="dim" style="font-size: .82rem;">{{ a.description[:80] }}{% if a.description|length > 80 %}…{% endif %}</span>{% endif %}</td>
<td>{% if a.category %}<span class="alert-cat">{{ a.category }}</span>{% else %}<span class="dim"></span>{% endif %}</td>
<td class="mono">{{ a.expiration_date.isoformat() }}</td>
<td class="mono dim">{{ a.reminder_days|join(', ') }}d</td>
<td>
<span class="status-badge {{ 'status-active' if a.is_active else 'status-inactive' }}">
<span class="led"></span>{{ 'active' if a.is_active else 'inactive' }}
</span>
</td>
<td class="actions">
{% if current_user.is_admin %}
<a href="{{ url_for('main.alert_edit', alert_id=a.id) }}" class="btn btn-ghost btn-sm">Edit</a>
<form method="post" action="{{ url_for('main.alert_reset_reminders', alert_id=a.id) }}" class="inline-form" data-confirm="Re-send any pending reminders that were already sent?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn btn-ghost btn-sm" type="submit">Reset reminders</button>
</form>
<form method="post" action="{{ url_for('main.alert_delete', alert_id=a.id) }}" class="inline-form" data-confirm="Permanently delete '{{ a.title }}'?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn btn-danger btn-sm" type="submit">Delete</button>
</form>
{% else %}
<span class="dim">view only</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="empty">
<p><strong>No alerts yet.</strong></p>
{% if current_user.is_admin %}<a href="{{ url_for('main.alert_new') }}" class="btn btn-primary">Create one</a>{% endif %}
</div>
{% endif %}
{% endblock %}