{% extends 'pootest/base.html' %}
{% load i18n %}
{% load tz %}
{% load humanize %}

{% block content %}

<div class="card card-default">
    <div class="card-body">
        <h5 class="card-title">{% translate "Corporation Structures" %}</h5>

        {% if error %}
            <div class="alert alert-warning" role="alert">{{ error }}</div>
        {% endif %}

        {% if structures %}
            <p class="text-muted mb-3">
                {{ structure_count }} structure{{ structure_count|pluralize }} found.
            </p>

            {% for s in structures %}
            <div class="card mb-2 pootest-structure">
                <div class="card-body">
                    <dl class="row mb-0">
                        <dt class="col-sm-5 col-md-4">{% translate "System:" %}</dt>
                        <dd class="col-sm-7 col-md-8">{{ s.system }}</dd>

                        <dt class="col-sm-5 col-md-4">{% translate "Name:" %}</dt>
                        <dd class="col-sm-7 col-md-8">{{ s.name }}</dd>

                        <dt class="col-sm-5 col-md-4">{% translate "Structure Type:" %}</dt>
                        <dd class="col-sm-7 col-md-8">{{ s.type }}</dd>

                        <dt class="col-sm-5 col-md-4">{% translate "Current Fuel Level / Days Remaining:" %}</dt>
                        <dd class="col-sm-7 col-md-8">{{ s.fuel }}</dd>

                        <dt class="col-sm-5 col-md-4">{% translate "Last Update:" %}</dt>
                        <dd class="col-sm-7 col-md-8">{{ s.last_update|utc|date:"Y-m-d H:i:s" }} UTC</dd>
                    </dl>
                </div>
            </div>
            {% endfor %}
        {% elif not error %}
            <p class="mb-0">{% translate "No structures found for this corporation." %}</p>
        {% endif %}

        <a href="{% url 'pootest:index' %}" class="btn btn-secondary mt-3">{% translate "Back" %}</a>
    </div>
</div>

{% endblock %}
