{% extends 'public_base.html' %}
{% load i18n fontawesome_5 humanize %}

{% block body %}
<div class="row">
    <div class="col-sm-12 col-md-12 col-lg-12 col-xl-6">
        <h3>{% trans 'Report' %}</h3>
        <h4>{{obj.identifier}}</h4>
        <div class="table-container">
            <table class="table table-hover">
                    <tr>
                        <th class="w-25" scope="row">{% trans 'Title' %}</th>
                        <td class="align-middle">{{obj.title|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Process type' %}</th>
                        <td class="align-middle">{{obj.legal.process_type|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Law' %}</th>
                        <td class="align-middle">
                            {% for law in obj.legal.laws.all %}
                                <div class="badge pill-badge rlp-r-outline">{{law.short_name}} - {{law.long_name}}</div>
                                <br>
                            {% endfor %}
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Registration office' %}</th>
                        <td class="align-middle">{{obj.responsible.registration_office.str_as_office|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Registration office file number' %}</th>
                        <td class="align-middle">{{obj.responsible.registration_file_number|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Conservation office' %}</th>
                        <td class="align-middle">{{obj.responsible.conservation_office.str_as_office|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Conservation office file number' %}</th>
                        <td class="align-middle">{{obj.responsible.conservation_file_number|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Compensations' %}</th>
                        <td class="align-middle">
                            {% for comp in obj.compensations.all %}
                                <a href="{% url 'compensation:report' comp.id %}">
                                    {{comp.identifier}} - {{comp.title}}
                                </a>
                                <br>
                            {% empty %}
                            {% trans 'None' %}
                            {% endfor %}
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Deductions of eco-accounts' %}</th>
                        <td class="align-middle">
                            {% for deduction in deductions %}
                                <a href="{% url 'compensation:acc:report' deduction.account.id %}">
                                    {{deduction.account.identifier}} - {{deduction.account.title}}
                                </a>
                                <br>
                            {% empty %}
                            {% trans 'None' %}
                            {% endfor %}
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Payments' %}</th>
                        <td class="align-middle">
                            {% if obj.payments.all %}
                                {% trans 'Exist' %}
                            {% else %}
                                {% trans 'None' %}
                            {% endif %}
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Registration date' %}</th>
                        <td class="align-middle">{{obj.legal.registration_date|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Binding on' %}</th>
                        <td class="align-middle">{{obj.legal.binding_date|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Last modified' %}</th>
                        <td class="align-middle">
                            {{obj.created.timestamp|default_if_none:""|naturalday}}
                        </td>
                    </tr>
            </table>
        </div>
    </div>
    <div class="col-sm-12 col-md-12 col-lg-12 col-xl-6">
        <div class="row">
            <div class="col-sm-12">
                {% include 'map/geom_form.html' %}
            </div>
        </div>
        <div class="row">
            {% include 'konova/includes/parcels/parcels.html' %}
        </div>
        <div class="row qrcodes">
            {% include 'konova/includes/report/qrcodes.html' %}
        </div>

    </div>
</div>

{% endblock %}