{% load i18n %}
{% load django_ledger %}

<div class="table-container">
    <table class="table is-narrow is-fullwidth is-bordered django-ledger-table-bottom-margin-75">
        <thead>
        <tr class="has-text-centered is-error">
            <th>Dated Posted</th>
            <th>Description</th>
            <th>Amount</th>
            <th>Activity</th>
            <th>Entity Unit</th>
            <th>Map To</th>
            <th>TX</th>
            <th>Actions</th>
        </tr>
        </thead>
        <tbody>
        {% for imported_tx in imported_txs %}
            <tr>
                <td>{{ imported_tx.date_posted }}</td>
                <td>{{ imported_tx.name }}</td>
                <td class="{% if imported_tx.get_amount < 0.00 %}has-text-danger{% endif %} has-text-centered">
                    {% currency_symbol %}{{ imported_tx.get_amount }}</td>
                <td>{% if imported_tx.activity %}
                    {{ imported_tx.get_activity_display }}
                {% endif %}</td>
                <td>{% if imported_tx.entity_unit %}{{ imported_tx.entity_unit }}{% endif %}</td>
                <td>{{ imported_tx.account_model }}</td>
                <td>{{ imported_tx.transaction_model }}</td>
                <td class="has-text-centered">
                    <a href="{% url 'django_ledger:je-detail' entity_slug=import_job_model.entity_slug ledger_pk=imported_tx.transaction_model.journal_entry.ledger_id je_pk=imported_tx.transaction_model.journal_entry_id %}"
                       class="button is-small is-primary">{% trans 'View JE' %}</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>


