{% load i18n %}
{% load evelinks %}

<div class="col-12 col-l-6 align-self-stretch p-2">
    <div class="card h-100">
        <div class="card-body">
            <h4 class="card-title text-center">{% translate "Upcoming Timers" %}</h4>
            <div class="card-body">
                <div style="height: 300px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
                    <table class="table" style="--bs-table-bg: transparent;">
                        <thead>
                            <th class="text-center">{% translate "Details" %}</th>
                            <th class="text-center">{% translate "Timer" %}</th>
                            <th class="text-center">{% translate "Type" %}</th>
                            <th class="text-center">{% translate "System" %}</th>
                            <th class="text-center">{% translate "Eve Time" %}</th>
                        </thead>
                        <tbody>
                        {% for timer in timers %}
                        <tr>
                            <td style="" class="text-center">
                                {{ timer.details }}
                            </td>
                            <td style="" class="text-center">
                                {{ timer.get_timer_type_display }}
                            </td>
                            <td class="text-center" nowrap>
                                {% if timer.objective == "Hostile" %}
                                    <div class="badge badge-danger">
                                        {% translate "Hostile" %}
                                    </div>
                                {% endif %}
                                {% if timer.objective == "Friendly" %}
                                    <div class="badge badge-primary">
                                        {% translate "Friendly" %}
                                    </div>
                                {% endif %}
                                {% if timer.objective == "Neutral" %}
                                    <div class="badge badge-default">
                                        {% translate "Neutral" %}
                                    </div>
                                {% endif %}
                            </td>
                            <td class="text-center"><a href="{{ timer.system|dotlan_solar_system_url }}">
                                {{ timer.system }} {{ timer.planet_moon }}
                                </a>
                            </td>
                            <td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>

                        </tr>
                        {% endfor %}
                    </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
