{% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %}

{% block title %}{% trans 'Add debt' %}{% 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><a href="{% url 'abonapp:people_list' group.id %}">{{ group.title }}</a></li>
        <li><a href="{% url 'abonapp:abon_home' group.id abon.username %}">{{ abon.fio }}</a></li>
        <li class="active">{% trans 'Add debt' %}</li>
    </ol>
{% endblock %}

{% block main %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans 'Add receipt for' %}
                <u><a href="{% url 'abonapp:abon_home' group.id abon.username %}">{{ abon.fio }}</a></u>
            </h3>
        </div>
        <div class="panel-body">
            <form role="form" action="{% url 'abonapp:add_invoice' group.id abon.username %}"
                  method="post">{% csrf_token %}
                <div class="form-group">
                    <label for="pamount">{% trans 'Sum of pay' %}</label>

                    <div class="input-group">
                        <span class="input-group-addon">&#8381;</span>
                        <input id="pamount" type="text" name="curr_amount" placeholder="0" required pattern="^\d+$"
                               class="form-control">
                    </div>
                </div>
                <div class="checkbox">
                    <label>
                        <input id="paystat" type="checkbox" name="status">
                        {% trans 'Pay status' %}
                    </label>
                </div>
                <div class="form-group">
                    <label for="comm">{% trans 'Comment' %}</label>
                    <textarea id="comm" name="comment" required maxlength="128" rows="3"
                              class="form-control"></textarea>
                </div>
                <div class="btn-group">
                    <button type="submit" class="btn btn-sm btn-primary">
                        <span class="glyphicon glyphicon-save"></span> {% trans 'Save' %}
                    </button>
                    <button type="reset" class="btn btn-sm btn-default">
                        <span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Reset' %}
                    </button>
                </div>
            </form>
        </div>
        <div class="panel-footer">
            <p>
                <span class="glyphicon glyphicon-warning-sign"></span>
                {% blocktrans trimmed %}
                    This credit will be visible in user page, be careful with your text.
                {% endblocktrans %}
            </p>
        </div>
    </div>
{% endblock %}
