{% extends "sidebar_table_layout.html" %} {% block sidebar %}
<div id="table_overflow">{{ balance_table(show_weight=False) }}</div>
{% endblock %} {% block content %}
<table id="bill_table" class="split_bills table table-striped">
  <thead>
    <tr>
      <th>{{ _("Who pays?") }}</th>
      <th>{{ _("To whom?") }}</th>
      <th>{{ _("How much?") }}</th>
      <th>{{ _("Settled?") }}</th>
    </tr>
  </thead>
  <tbody>
    {% for transaction in transactions %}
    <tr receiver="{{transaction.receiver.id}}">
      <td>{{ transaction.ower }}</td>
      <td>{{ transaction.receiver }}</td>
      <td>{{ transaction.amount|currency }}</td>
      <td>
        <span id="settle-bill" class="ml-auto pb-2">
          <form class="" action="{{ url_for(".add_settlement_bill") }}" method="POST">
              {{ settlement_form.csrf_token }}
              {{ settlement_form.amount(value=transaction.amount) }}
              {{ settlement_form.sender_id(value=transaction.ower.id) }}
              {{ settlement_form.receiver_id(value=transaction.receiver.id) }}
              <button class="btn btn-primary" type="submit" title="{{ _("Settle") }}">
                <div
                  data-toggle="tooltip"
                  title='{{ _("Click here to record that the money transfer has been done") }}'
                >
                {{ _("Settle") }}
                </div>
              </button>
          </form>
        </span>
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% endblock %}
