{% extends 'base.html' %}
{% load i18n %}

{% block title %}{% trans 'History of subscriber' %}{% endblock %}

{% block breadcrumb %}
    <ol class="breadcrumb">
        <li><span class="glyphicon glyphicon-home"></span></li>
        <li><a href="{% url 'abonapp:group_list' %}">{% trans 'User groups' %}</a></li>
        <li class="active">{% trans 'Subscribers actions' %}</li>
    </ol>
{% endblock %}

{% block page-header %}
    {% trans 'History of subscriber' %}
{% endblock %}

{% block main %}
    <div class="table-responsive">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>{% trans 'Sum' %}</th>
                <th>{% trans 'Sub' %}</th>
                <th>{% trans 'Comment' %}</th>
                <th width="250">{% trans 'Date' %}</th>
                <th width="150">{% trans 'Author' %}</th>
            </tr>
            </thead>
            <tbody>
            {% for l in logs %}
                <tr>
                    <td>{% if l.amount >= 0 %}
                        <span class="glyphicon glyphicon-hand-up"></span>
                    {% else %}
                        <span class="glyphicon glyphicon-hand-down"></span>
                    {% endif %} {{ l.amount }}</td>
                    <td>
                    {% if l.abon.group %}
                        <a href="{% url 'abonapp:abon_home' l.abon.group.pk l.abon.username %}">{{ l.abon.username }}</a>
                    {% else %}
                        {{ l.abon.username }}
                    {% endif %}
                    </td>
                    <td>{{ l.comment }}</td>
                    <td>{{ l.date|date:"D d E Y H:i:s" }}</td>
                    <td>
                        {% if l.author %}
                            <a href="{% url 'acc_app:other_profile' l.author.id %}">{{ l.author.username }}</a></td>
                        {% else %}
                            ---
                        {% endif %}
                </tr>
            {% empty %}
                <tr>
                    <td colspan="5">{% trans 'Actions not found' %}</td>
                </tr>
            {% endfor %}
            </tbody>

        </table>
    </div>
{% endblock %}
