{% extends 'buybackprogram/base.html' %}
{% load i18n %}
{% load humanize %}
{% load program_settings %}

{% block details %}

<div class="table-responsive">
    <table style="width: 100%; margin: auto;" class="table table-striped table-condensed">
        <thead>
            <tr>
                <th>{% trans "System" %}</th>
                <th>{% trans "Structure" %}</th>
                <th>{% trans "Tax" %}</th>
                <th>{% trans "Manager" %}</th>
                <th>{% trans "Settings" %}</th>
                <th class="text-center" >{% trans "Actions" %}</th>
            </tr>
        </thead>
        <tbody>
            {% for program in programs %}
            <tr>
                <td>{{ program.location.eve_solar_system }} </td>

                <td>{{ program.location.name }} </td>

                <td>{{ program.tax }} %</td>

                {% if program.is_corporation %}
                    <td >{{ program.owner.corporation }}</td>
                {% else %}
                    <td >{{ program.owner.character.character }}</td>
                {% endif %}
                <td>
                    {% for setting in program|program_setting %}
                        <i style="color: {{setting.color}};" class="fas {{setting.icon}}" title="{{setting.message}}"></i>
                    {% endfor %}

                </td>


                <td class="text-center">
                    <a class="btn btn-success btn-sm" href="{% url 'buybackprogram:program_calculate' program_pk=program.id %}">
                        Use
                    </a>
                    <a class="btn btn-sm btn-warning" href="{% url 'buybackprogram:program_special_taxes' program_pk=program.id %}">Special taxes</a>
                    {% if perms.buybackprogram.manage_programs and program.owner.user == request.user %}
                        <a class="btn btn-sm btn-warning" href="{% url 'buybackprogram:program_edit' program_pk=program.id %}">Edit program</a>
                        <a class="btn btn-danger btn-sm" href="{% url 'buybackprogram:program_remove' program_pk=program.id %}">
                        Delete
                    </a>
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

{% endblock %}

{% block extra_javascript %}
{% endblock %}

{% block extra_css %}
{% endblock %}

{% block extra_script %}
{% endblock %}
