{% load i18n main_extras %}
<dl class="accounts">
  {% for acc in accounts %}
    <div class="account {% if not search and acc.archived %}archived{% endif %}">
      <dt>
        <a href="{{ acc.get_absolute_url }}">{{ acc.icon|remix }}{{ acc }}</a>
      </dt>
      <dd class="value">
        {% if acc.statement_set.first %}{{ acc.statement_set.first.value|value }}{% endif %}
      </dd>
    </div>
  {% endfor %}
  {% if index %}
    <div class="more account">
      <dt>
        <a href="{% url "accounts" %}">{{ "gallery-view"|remixnl }}{% translate "All accounts" %}</a>
      </dt>
      <dd class="value">
        {{ accounts|balance|value }}
      </dd>
    </div>
  {% elif not search %}
    <div class="more account">
      <dt>
        <label class="wi" for="show-archived-accounts">
          {{ "archive"|remix }}{% translate "Show archived" %}
        </label>
      </dt>
      <dd>
        <input type="checkbox" class="show-archived" id="show-archived-accounts" />
      </dd>
    </div>
    <div class="new account">
      <dt>
        <a href="{% url "new_account" %}">{{ "add-box"|remix }}{% translate "Create account" %}</a>
      </dt>
    </div>
  {% endif %}
</dl>
