{% load i18n %}
{% load static %}
{% load humanize %}
{% load evelinks %}
{% load ledger %}
<!--############################## HOURLY #######################-->
<div class="tab-pane panel panel-default" id="tab-hourly">
    <div class="card-body modal-tab">
        {% if character.bounty %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. {{ mode }} per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.bounty.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.bounty %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. {{ mode }} Tick per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: yellow">{{ character.bounty.average_hour_tick|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.ess %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. ESS per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.ess.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.stolen.average_hour %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Stolen per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: yellow">{{ character.stolen.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.mission %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Mission Rewards per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.mission.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.mining %}
        <div class="row description-row">
            <div class="col-sm-6">Avg. Mining per Hour:</div>
            <div class='col-sm-4 text-end'><span style="color: green">{{ character.mining.average_hour|floatformat:0|intcomma }}</span> ISK</div>
        </div>
        {% endif %}

        <!--############################## Misc #######################-->

        {% if character.transaction %}
            <hr>
            <div class="row description-row">
                <div class="col-sm-6">Avg. Trading per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.transaction.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.contract %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Contracts per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.contract.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.donation %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Donations per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.donation.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.insurance %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Insurance per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: green">{{ character.insurance.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        <!--############################## COSTS #######################-->

        {% if character.production_cost or character.market_cost or character.contract_cost or character.asset_cost or character.traveling_cost %}
            <hr>
        {% endif %}
        {% if character.contract_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Contract Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.contract_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.production_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Production Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.production_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.market_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Trading Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.market_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.traveling_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Traveling Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.traveling_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.asset_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Asset Safety Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.asset_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.skill_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Skill Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.skill_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.insurance_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Insurance Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.insurance_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.planetary_cost %}
            <div class="row description-row">
                <div class="col-sm-6">Avg. Planetary Cost per Hour:</div>
                <div class='col-sm-4 text-end'><span style="color: red">{{ character.planetary_cost.average_hour|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}
        <!--############################## SUMMARY HOURLY #######################-->
        {% if character.date %}
            <hr>
            <div class="row description-row">
                <div class="col-sm-6">Avg. Summary Hour:</div>
                <div class='col-sm-4 text-end'>
                    <span style="{% if character.summary.total_amount_hour < 0 %}color: red{% else %}color: green{% endif %}">
                        {{ character.summary.total_amount_hour|floatformat:0|intcomma }}
                    </span> ISK
                </div>
            </div>
        {% endif %}
    </div>
</div>
