{% 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 '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 'Action handler' %}</th>
                        <td class="align-middle">{{obj.responsible.handler|default_if_none:""}}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Deductions for' %}</th>
                        <td class="align-middle">
                            {% for deduction in deductions %}
                                <a href="{% url 'intervention:report' deduction.intervention__id %}">
                                    {{deduction.intervention__identifier}} - {{deduction.intervention__title}}
                                </a>
                                <br>
                            {% empty %}
                                {% trans 'None' %}
                            {% endfor %}
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans 'Last modified' %}</th>
                        <td class="align-middle">
                            {{obj.modified.timestamp|default_if_none:""|naturalday}}
                        </td>
                    </tr>
            </table>
        </div>

        {% include 'compensation/detail/compensation/includes/states-before.html' %}
        {% include 'compensation/detail/compensation/includes/states-after.html' %}
        {% include 'compensation/detail/compensation/includes/actions.html' %}
    </div>
    <div class="col-sm-12 col-md-12 col-lg-12 col-xl-6">
        <div class="row">
            {% include 'map/geom_form.html' %}
        </div>
        <div class="row">
            {% include 'konova/includes/parcels.html' %}
        </div>
        <div class="row">
            <div class="col-sm-6 col-md-6 col-lg-6">
                <h4>{% trans 'Open in browser' %}</h4>
                {{ qrcode|safe }}
            </div>
            <div class="col-sm-6 col-md-6 col-lg-6">
                <h4>{% trans 'View in LANIS' %}</h4>
                {{ qrcode_lanis|safe }}
            </div>
        </div>

    </div>
</div>

{% endblock %}