{% extends "django_eveonline_connector/adminlte/corporations/view_corporation.html" %}

{% block title %}
Corporation Structures
{% endblock %}

{% block tab_content %}
<div class="card card-success card-outline">
    <div class="card-header">
        <h3 class="card-title">Structures</h3>
    </div>
    <div class="card-body">
        <table class="table table-bordered table-striped dataTable">
            <thead>
                <th>Structure</th>
                <th>Fuel Expires</th>
                <th>Timer</th>
            </thead>
            <tbody>
                {% for structure in structures %}
                <tr>
                    <td>
                        <img src="https://images.evetech.net/types/{{structure.type_id}}/icon?size=32"
                            class="img-circle" alt="Avatar" width="32px" title="{{character.character.name}}">
                        {{structure.name}}
                    </td>
                    <td>
                        {% if structure.fuel_expires %}
                        <p
                        {% if structure.fuel_expires_soon %}
                        class="text-danger"
                        {% endif %}>
                        {{structure.fuel_expires}}
                        </p>
                        {% else %}
                        <p class="text-warning"><b>Low Power</b></p>
                        {% endif %}
                        
                        
                    </td>
                    <td>
                        {{structure.reinforcement_time|date:'H' }}:00
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>

{% endblock %}

{% block scripts %}
<script>
    $.fn.DataTable.ext.pager.numbers_length = 5;
    $(function () {
        $('table').DataTable({
            'paging': true,
            'lengthChange': true,
            'searching': true,
            'ordering': true,
            'order': [[1, 'asc']],
            'pageLength': 5,
            "autoWidth": false,
        })
    })
</script>
<script>
    $(document).ready(function () {
        $('#structures').addClass('active');
    });
</script>

{% endblock %}