{% load helpers %}

<div class="card">
<h5 class="card-header">
    Active / Upcoming Maintenances
</h5>
{% if maintenances %}
    <table class="table table-hover">
        <tr>
            <thead>
            <th>Maintenance ID</th>
            <th>Start</th>
            <th>End</th>
            <th>Status</th>
            <th>Impact</th>
        </thead>
        </tr>
        {% for maintenance in maintenances %}
        <tr>
            <td>{{maintenance.event|linkify}}</td>
            <td>{{maintenance.event.start}}</td>
            <td>{{maintenance.event.end}}</td>
            <td>{% badge maintenance.event.get_status_display bg_color=maintenance.event.get_status_color %}</td>
            <td>{% badge maintenance.get_impact_display bg_color=maintenance.get_impact_color %}</td>
        </tr>
        {% endfor %}
    </table>
    {% else %}
    <div class="card-body">
        <div class="text-muted">
            None
        </div>
    </div>
    {% endif %}
    </div>
