{% extends request.is_ajax|yesno:'nullcont.htm,abonapp/ext.htm' %}
{% load i18n guardian_tags %}
{% block content %}

    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th>{% trans 'Sum' %}</th>
            <th>{% trans 'Date of payment' %}</th>
            <th>{% trans 'Author of payment' %}</th>
            <th>{% trans 'Comment' %}</th>
        </tr>
        </thead>
        <tbody>
        {% for ph in pay_history %}
            <tr>
                <td>{{ ph.amount|floatformat:2 }}</td>
                <td>{{ ph.date|date:'d F Y, H:i:s' }}</td>
                <td>
                {% if ph.author %}
                    <a href="{% url 'acc_app:other_profile' ph.author.pk %}">{{ ph.author.username }}</a>
                {% else %}
                    {% trans 'System' %}
                {% endif %}
                </td>
                <td>{{ ph.comment }}</td>
            </tr>
        {% empty %}
            <tr>
                <td colspan="4">{% trans 'Payment history is empty' %}</td>
            </tr>
        {% endfor %}
        </tbody>
        <tfoot>
        <tr>
            <td colspan="4" class="btn-group btn-group-sm">
                {% if perms.abonapp.can_add_ballance %}
                    <a href="{% url 'abonapp:abon_amount' group.pk abon.username %}" class="btn btn-default btn-modal">
                        <span class="glyphicon glyphicon-credit-card"></span> {% trans 'Fill account' %}
                    </a>
                {% else %}
                    <a href="#" class="btn btn-default" title="{%  trans 'Permission denied' %}" disabled>
                        <span class="glyphicon glyphicon-credit-card"></span> {% trans 'Fill account' %}
                    </a>
                {% endif %}
                <a href="{% url 'abonapp:abon_debts' group.pk abon.username %}" class="btn btn-default">
                    <span class="glyphicon glyphicon-gbp"></span> {% trans 'Debts' %}
                </a>
            </td>
        </tr>
        </tfoot>

    </table>

{% endblock %}
