{% extends 'base.html' %}

{% load static %}

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

{% block content %}

<div class="row text-center mt-1">
    <p class="fs-5">
        {{ object.type_order }} № <strong> {{ object.number }}</strong> от {{object.registered}}<br>
        вступает в силу с {{ object.event_date}}
    </p>
</div>
<div class="row fs-6">
    <div class="table-responsive">
        <table class="table table-striped table-sm table-hover table-bordered">
          <thead class="text-center table-secondary">
            <tr>
              <th scope="col" class="text-end">№</th>
              <th scope="col">Фамилия</th>
              <th scope="col">Имя</th>
              <th scope="col">Отчество</th>
              <th scope="col">Дата рождения</th>
              <th scope="col">СНИЛС</th>
              <th scope="col">Диплом серия/номер</th>
              <th scope="col">Начало обучения</th>
              <th scope="col">Конец обучения</th>
              <th scope="col">Сгенерировать</th>
            </tr>
          </thead>
          <tbody class="text-center">
            {% for item in contracts %}
            <tr class="align-middle">
              <td class="text-end align-item-bottom">{{ forloop.counter }}.</td>
              <td>{{ item.client.surname }}</td>
              <td>{{ item.client.name }}</td>
              <td>{{ item.client.patronymic }}</td>
              <td>{{ item.client.birthdate|date:"SHORT_DATE_FORMAT" }}</td>
              <td>{{ item.client.snils }}</td>
              <td>{{ item.client.diploma.series }} - {{ item.client.diploma.number }}</td>
              <td>{{ item.start_date|date:"SHORT_DATE_FORMAT" }}</td>
              <td>{{ item.end_date|date:"SHORT_DATE_FORMAT" }}</td>
              <td><a href="{{ item.get_gen_diploma_url }}">Дипом</a> <br> <a href="{{ item.get_gen_supplement_url }}">Приложение</a></td>
          </tr>
            {% endfor %}
          </tbody>
        </table>
      </div>
  
</div>

<div class="row text-center fs-5">
    <p>
        Ректор - {{ object.structure.rector }}
    </p>
</div>

<div class="row border">
    <div class="col text-center p-1">
        <a href="{% url 'gen_for_registry' object.pk %}" class="btn btn-outline-primary btn-block" >Подготовить файл</a>
    </div>

</div>

{% endblock content %}

