{% load i18n main_extras %}
<div id="invoices">
  <ul class="invoices">
    {% for invoice in invoices %}
      <li>
        {% if not transaction %}
          <a class="transaction" href="{{ invoice.transaction.get_absolute_url }}">
            {{ "receipt"|remix }}{{ invoice.transaction.name }}
          </a>
        {% endif %}
        <a class="title" href="{{ invoice.file.url }}">{{ "file"|remix }}{{ invoice.name }} [{{ invoice.file|extension }}]</a>
        {% if transaction %}
          <a href="{{ invoice.get_absolute_url }}">{{ "file-edit"|remix }}{% translate "Edit" %}</a>
        {% endif %}
      </li>
    {% endfor %}
    {% if transaction %}
      <li class="new">
        <span>
          <a href="{% url "new_invoice" transaction.pk %}">{{ "file-add"|remix }}{% translate "New invoice" %}</a>
        </span>
      </li>
    {% endif %}
  </ul>
</div>
