{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load static %}
{% load i18n %}

{% block page_title %}{% translate "Fatlink view" %}{% endblock page_title %}

{% block content %}
    <div class="col-lg-12">
        <h1 class="page-header text-center">{% translate "Participation data" %}</h1>
        <table class="table">
                <tr>
                    <th class="col-md-11">
                        <h4><b>{% translate "Most recent clicked fatlinks" %}</b>
                        </h4>
                    </th>
                    <th class="col-md-1">
                        <a href="{% url 'fatlink:personal_statistics' %}" class="btn btn-info">
                            {% translate "Personal statistics" %}
                        </a>
                    </th>
                </tr>
        </table>
        {% if fats %}
        <table class="table table-responsive">
            <tr>
                <th class="text-center">{% translate "Fleet" %}</th>
                <th class="text-center">{% translate "Character" %}</th>
                <th class="text-center">{% translate "System" %}</th>
                <th class="text-center">{% translate "Ship" %}</th>
                <th class="text-center">{% translate "Eve Time" %}</th>
            </tr>
            {% for fat in fats %}
            <tr>
                <td class="text-center">{{ fat.fatlink.fleet }}</td>
                <td class="text-center">{{ fat.character.character_name }}</td>
                {%  if fat.station != "No Station" %}
                <td class="text-center">{% blocktrans %}Docked in {% endblocktrans %}{{ fat.system }}</td>
                {% else %}
                <td class="text-center">{{ fat.system }}</td>
                {% endif %}
                <td class="text-center">{{ fat.shiptype }}</td>
                <td class="text-center">{{ fat.fatlink.fatdatetime }}</td>
            </tr>
            {% endfor %}
        </table>
        {% else %}
        <div class="alert alert-warning text-center">{% translate "No fleet activity on record." %}</div>
        {% endif %}

        {% if perms.auth.fleetactivitytracking%}
            <table class="table">
                <tr>
                    <th class="col-md-10">
                        <h4><b>{% translate "Most recent fatlinks" %}</b>
                        </h4>
                    </th>
                    <th class="col-md-1">
                        <a href="{% url 'fatlink:statistics' %}" class="btn btn-info">
                            {% translate "View statistics" %}
                        </a>
                    </th>
                    <th class="col-md-1">
                        <a href="{% url 'fatlink:create' %}" class="btn btn-success">
                            {% translate "Create fatlink" %}
                        </a>
                    </th>
                </tr>
            </table>
        {% if fatlinks %}
        <table class="table">
            <tr>
                <th class="text-center">{% translate "Name" %}</th>
                <th class="text-center">{% translate "Creator" %}</th>
                <th class="text-center">{% translate "Fleet" %}</th>
                <th class="text-center">{% translate "Eve Time" %}</th>
                <th class="text-center">{% translate "Duration" %}</th>
                <th class="text-center">{% translate "Edit" %}</th>
            </tr>
            {% for link in fatlinks %}
            <tr>
                <td class="text-center"><a href="{%  url 'fatlink:click' link.hash %}" class="label label-primary">{{ link.fleet }}</a></td>
                <td class="text-center">{{ link.creator.username }}</td>
                <td class="text-center">{{ link.fleet }}</td>
                <td class="text-center">{{ link.fatdatetime }}</td>
                <td class="text-center">{{ link.duration }}</td>
                <td class="text-center">
                    <a href="{%  url 'fatlink:modify' link.hash %}" class="btn btn-info">
                        <span class="glyphicon glyphicon-edit"></span>
                    </a>
                </td>
            </tr>
            {%  endfor %}

        </table>
        {% else %}
        <div class="alert alert-warning text-center">{% translate "No created fatlinks on record." %}</div>
        {% endif %}
        {% endif %}
    </div>
{% endblock content %}
