{% load i18n %}
{% load humanize %}
{% load evelinks %}
{% load ledger %}

{% if mode == "TAX" %}
    {% trans "TAX" as mode_trans %}
{% else %}
    {% trans "Ratting" as mode_trans %}
{% endif %}

<!--############################## SUMMARY #######################-->
<div class="tab-pane panel panel-default active" id="tab-summary">
    <div class="card-body modal-tab">
        {% for key, label in character.income_types %}
            {% with value=character|get_item:key %}
                {% if value %}
                    <div class="row description-row">
                        <div class="col-sm-6">{{ label }}:</div>
                        <div class='col-sm-4 text-end'>
                            <span class="text-success">
                                {{ value.total_amount|floatformat:0|intcomma }}
                            </span> ISK
                        </div>
                    </div>
                {% endif %}
            {% endwith %}
        {% endfor %}

        <!--############################## Costs #######################-->

        {% for key, label in character.cost_types %}
            {% with value=character|get_item:key %}
                {% if value %}
                    <div class="row description-row">
                        <div class="col-sm-6">{{ label }} {% trans "Cost" %}:</div>
                        <div class='col-sm-4 text-end'>
                            <span class="text-danger">{{ value.total_amount|floatformat:0|intcomma }}</span> ISK
                        </div>
                    </div>
                {% endif %}
            {% endwith %}
        {% endfor %}

        <!--############################## SUMMARY #######################-->
        <hr>
        <div class="row description-row">
            <div class="col-sm-6">{% trans "Summary" %}:</div>
            <div class='col-sm-4 text-end'>
            <span class="{% if character.summary.total_amount < 0 %}text-danger{% else %}text-success{% endif %}">
                {{ character.summary.total_amount|floatformat:0|intcomma }}
            </span> ISK</div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
        var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
          return new bootstrap.Tooltip(tooltipTriggerEl)
        })
    });
</script>
