{% load i18n %}
{% load static %}
{% load humanize %}
{% load moonmining %}

<div class="table-responsive">
    {% if ledger|length > 0 %}
        <table class="table table-striped table-width-fix" id="table-ledger-ledger">
            <thead>
                <tr>
                    <th>Day</th>
                    <th>Main</th>
                    <th>Character</th>
                    <th>Corporation</th>
                    <th>Ore</th>
                    <th>Unit Price</th>
                    <th>Quantity</th>
                    <th>Total Price</th>
                </tr>
            </thead>
            <tbody>
                {% for record in ledger %}
                    <tr>
                        <td>{{ record.day }}</td>
                        <td>{{ record.user.profile.main_character.character_name }}</td>
                        <td>{{ record.character.name }}</td>
                        <td>{{ record.corporation.name }}</td>
                        <td>{{ record.ore_type.name }}</td>
                        <td data-order="{{ record.ore_type.extras.refined_price }}">{{ record.ore_type.extras.refined_price|formatisk }}</td>
                        <td data-order="{{ record.quantity }}">{{ record.quantity|intcomma }}</td>
                        <td data-order="{{ record.total_price }}">{{ record.total_price|formatisk }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p class="text-muted">No data.</p>
    {% endif %}
</div>
