{% extends "base.html" %}

{% block page_content %}
  <div class="row">

  {% include "admin/admin_tasks.html" %}

    <div class="col-md-12">
    <div class="panel panel-danger">
      <div class="panel-heading">Transactions</div>
      <div class="panel-body">

        <div class="table-responsive">
          <table class="table table-hover table-striped table-condensed cf">
          <thead>
            <tr>
              <th></th>
              <th>Description</th>
              <th>Amount</th>
              <th>Date</th>
              <th></th>
            </tr>
          </thead>
 
          <tbody>
          {% for transaction in transactions %}
            {% if transaction.value > 0 %}
              <tr class="default">
                <td><span class="glyphicon glyphicon-asterisk"></span></td>
                <td>{{ transaction.description }}</td>
                <td>{{ transaction.value }} {{ transaction.currency }}</td>
                <td>{{ transaction.date_created.strftime('%d %b %Y - %H:%m') }}</td>
                <td><a href="{{ url_for('admin.transaction', user_pid=transaction.owner.pid) }}">{{ transaction.owner.email }}</a></td>
            {% else %}
              <tr class="success">
                <td><span class="glyphicon glyphicon-plus"></span></td>
                <td>{{ transaction.description }}</td>
                <td>{{ transaction.value }} {{ transaction.currency }}</td>
                <td>{{ transaction.date_created.strftime('%d %b %Y - %H:%m') }}</td>
                <td><a href="{{ url_for('admin.transaction', user_pid=transaction.owner.pid) }}">{{ transaction.owner.email }}</a></td>
            {% endif %}
              </tr>
           </tbody>
           {% endfor %}
        </table>
       </div>

        </div>
      </div>


  </div>

{% endblock %}