{% load i18n %}

<div id="tab-rawdata" class="tab-pane fade card card-default border-0" role="tabpanel" aria-labelledby="tab-rawdata">
    <div class="card-body">
        <h4>{% translate "FATs for" %} {{ character.character_name }}</h4>

        <table class="table table-striped table-hover w-100" id="raw-data">
            <thead>
                <tr>
                    <th>{% translate "Name" %}</th>
                    <th>{% translate "Fleet type" %}</th>
                    <th>{% translate "Doctrine" %}</th>
                    <th>{% translate "Location" %}</th>
                    <th>{% translate "Ship" %}</th>
                    <th>{% translate "EVE time" %}</th>
                </tr>
            </thead>

            <tbody>
                {% for fat in fats %}
                    <tr>
                        <td>
                            {% if fat.fatlink.fleet %}
                                {{ fat.fatlink.fleet }}
                            {% else %}
                                {{ fat.fatlink.hash }}
                            {% endif %}

                            {% if fat.fatlink.is_esilink %}
                                <span class="badge text-bg-secondary afat-label ms-2">ESI</span>
                            {% endif %}
                        </td>
                        <td>
                            {% if fat.fatlink.fleet_type %}
                                {{ fat.fatlink.fleet_type }}
                            {% endif %}
                        </td>
                        <td>
                            {% if fat.fatlink.doctrine %}
                                {{ fat.fatlink.doctrine }}
                            {% endif %}
                        </td>
                        <td>{{ fat.system }}</td>
                        <td>{{ fat.shiptype }}</td>
                        <td data-sort='{{ fat.fatlink.created|date:"Y-m-d H:i" }}'>
                            {{ fat.fatlink.created|date:"Y-M-d, H:i" }}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
