{% load i18n %}
{% load static %}
{% load humanize %}
{% load structures %}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">{{structure.eve_solar_system.name}} - {{structure.name}}</h4>
</div>

<div class="modal-body">
    {% include "structures/modals/fitting_gfx.html" %}
    <br>

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active">
            <a href="#tab-structure-general" aria-controls="modules" role="tab" data-toggle="tab">
                {% translate "General" %}
            </a>
        </li>
        <li role="presentation">
            <a href="#tab-structure-fuel" aria-controls="fuel" role="tab" data-toggle="tab">
                {% translate "Fuel" %} <small>({{ fuel_blocks_total|default:"-"|intcomma }})</small>
            </a>
        </li>
        <li role="presentation">
            <a href="#tab-structure-ammo" aria-controls="ammo" role="tab" data-toggle="tab">
                {% translate "Ammo" %} <small>({{ ammo_total|default:"-"|intcomma }})</small>
            </a>
        </li>
        <li role="presentation">
            <a href="#tab-structure-fighters" aria-controls="ammo" role="tab" data-toggle="tab">
                {% translate "Fighters" %} <small>({{ fighters_total|default:"-"|intcomma }})</small>
            </a>
        </li>
        <li role="presentation">
            <a href="#tab-structure-modules" aria-controls="modules" role="tab" data-toggle="tab">
                {% translate "Modules" %} <small>({{ modules_count }})</small>
            </a>
        </li>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="tab-structure-general">
            {% include "structures/modals/tab_general_detail.html" %}
        </div>

        <div role="tabpanel" class="tab-pane" id="tab-structure-fuel">
            <ul class="list-group">
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Fuel Bay") asset_list=assets_grouped.fuel_bay %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Fuel Usage") asset_list=assets_grouped.fuel_usage %}
            </ul>
        </div>

        <div role="tabpanel" class="tab-pane" id="tab-structure-ammo">
            <ul class="list-group">
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Ammo Hold") asset_list=assets_grouped.ammo_hold %}
            </ul>
        </div>

        <div role="tabpanel" class="tab-pane" id="tab-structure-fighters">
            <ul class="list-group">
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Fighter Bay") asset_list=assets_grouped.fighter_bay %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Fighter Tubes") asset_list=slot_assets.fighter_tubes %}
            </ul>
            <p class="text-muted">Quantities for fighters in tubes are estimated.</p>
        </div>

        <div role="tabpanel" class="tab-pane" id="tab-structure-modules">
            <ul class="list-group">
                {% include "structures/modals/fitting_assets.html" with slot_name=_("High Slots") asset_list=slot_assets.high_slots %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Medium Slots") asset_list=slot_assets.med_slots %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Low Slots") asset_list=slot_assets.low_slots %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Rig Slots") asset_list=slot_assets.rig_slots %}
                {% include "structures/modals/fitting_assets.html" with slot_name=_("Service Slots") asset_list=slot_assets.service_slots %}
            </ul>
        </div>

    <p class="text-muted">Last updated {{ last_updated|naturaltime|default:"?" }}</p>
</div>
