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

{% block page_title %}Doctrines - FleetUp{% endblock page_title %}

{% block content %}
<div class="col-lg-12">
    {% include "fleetup/menu.html" %}
    <div class="panel">
        {% if doctrines_list %}
        {% for a, j in doctrines_list.items %}
        {% regroup j|dictsort:"FolderName" by FolderName as folder_list %}
            {% for FolderName in folder_list %}
            <div class="col-lg-8">
            <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><b>{{ FolderName.grouper }}</b></h3>
                        </div>
                        <div class="panel-body">
                            <table class="table table-condensed table-hover table-striped">
                                <tr>
                                    <th class="col-lg-1"></th>
                                    <th class="col-lg-4">{% trans "Name" %}</th>
                                    <th class="col-lg-3">{% trans "Doctrine" %}</th>
                                    <th class="col-lg-4">{% trans "Last updated" %}</th>
                                    <!--<th class="col-lg-1">Owner</th>
                                    <th class="col-lg-2">Note</th>-->
                                </tr>
                                {% for item in FolderName.list %}
                
                                <tr>
                                    <td>
                                    <a href="{% url 'fleetup:doctrine' item.DoctrineId %}"><img src="https://image.eveonline.com/InventoryType/{{ item.IconId }}_32.png"></a>
                                    </td> 
                                    <td>
                                    {{ item.Name }}
                                    </td>
                                    <td>
                                    <a href="{% url 'fleetup:doctrine' item.DoctrineId %}" class="btn btn-info btn-sm">{{ item.FolderName }}</a>
                                    </td>
                                    <td>
                                    {{ item.LastUpdatedString }}
                                    </td>
                                </tr>
                                {% endfor %}
                            </table>
                        </div>
            </div>
            </div>
            {% endfor %}
    </div>
        {% endfor %}

        {% else %}
        <h3>{% trans "There seems to be no Doctrines in here at the moment!" %}</h3>
        {% endif %}
    </div>
</div>

{% endblock content %}
