{% extends 'anomalytracker/base.html' %}

{% load i18n %}
{% load humanize %}

{% block content %}

<h2>{% translate "Tracked Anomalies" %}</h2>

<a class="btn btn-primary mb-3" href="{% url 'anomalytracker:add' %}">{% translate "Add Anomaly" %}</a>

<table id="manageAnomsTable" class="table table-striped table-bordered">
    <thead>
        <tr>
            <th>{% translate "Ore" %}</th>
            <th>{% translate "Tier" %}</th>
            <th>{% translate "System" %}</th>
            <th>{% translate "Actions" %}</th>
        </tr>
    </thead>
    <tbody>
    {% if anomalies %}{% for anomaly in anomalies %}
        <tr>
            <td>{{ anomaly.ore }}</td>
            <td>{{ anomaly.anom_tier.get_tier_display }}</td>
            <td>{{ anomaly.anom_system.name }}</td>
            <td>
                <a class="btn btn-sm btn-warning" href="{% url 'anomalytracker:edit' anomaly.pk %}">{% translate "Edit" %}</a>
                <a class="btn btn-sm btn-danger" href="{% url 'anomalytracker:delete' anomaly.pk %}">{% translate "Remove" %}</a>
            </td>
        </tr>
    {% empty %}
        <tr>
            <td colspan="4">{% translate 'No anomalies tracked yet.' %}</td>
        </tr>
    {% endfor %}
    {% endif %}
    </tbody>
</table>

{% endblock %}

{% block extra_javascript %}
    {{ block.super }}
    <script>

    </script>
{% endblock %}
