{% extends 'base.html' %}

{% load static %}

{% block title %} 
    {{ block.super }}{{title}}
{% endblock title %} 

{% block content %}

<div class="row m-1 p-1 border">
    <div class="col-md-3 col-lg-2 d-md-block p-1">
        <img src="
        {% if object.photo %}
        {{ object.photo.url }}
        {% else %}
        {% static 'img/blank.png' %}
        {% endif %}
        "  class="rounded-4 border border-dark" width="95%" />
    </div>
    <div class="col-md-9 col-lg-10 ms-sm-auto md-4 bg-light">
        <div class="p-3 h-auto border border-dark"> 
            {{ object.surname }} {{ object.name}} {{object.patronymic}}<br>
            {{ object.phone }}<br>
            <div class="row">
                <div class="col-5">
                    {% if orders %}
                        <p class="p-0 m-0">Приказы:</p>
                        {% for item in orders %}
                        <a href="{{item.get_absolute_url}}">
                            {{ item }}
                        </a>
                        {% if item.scan %}
                        <a href="{{ item.scan.url }}" target="_blank"><span data-feather="file-text" class="align-text-bottom"></span></a>
                        {% endif %}
                        <br>
                        {% endfor %}
                    {% endif %}
                </div>
                <div class="col-3 border">
                    {% if contracts %}
                        <p class="m-0">Договоры:</p>
                        {% for item in contracts %}
                        <a href="{{item.get_absolute_url}}">
                            {{ item.number }}
                        </a> 
                        {% if item.scan %}
                        <a href="{{ item.scan.url }}" target="_blank"><span data-feather="file-text" class="align-text-bottom"></span></a>
                        {% endif %}
                        <br>
                        {% endfor %}
                    {% endif %}
                </div>
                <div class="col-4 border">
                    {% if sertificates %}
                        <p class="m-0">Справки:</p>
                        {% for item in sertificates %}
                        <a href="{{item.get_absolute_url}}">
                           № {{ item.number }} от {{ item.registered }}
                        </a> 
                        {% if item.scan %}
                        <a href="{{ item.scan.url }}" target="_blank"><span data-feather="file-text" class="align-text-bottom"></span></a>
                        {% endif %}
                        <br>
                        {% endfor %}
                    {% endif %}
                </div>
            </div>
            <div class="row">


            </div>
        </div>
    </div>

</div>

{% endblock content %}

