{% extends 'base.html' %}

{% load static %}
{% load stud_tags %}

{% block title %} 
  {{ block.super }} {{title}}
{% endblock title %} Студенты

{% block content %}
    <h2 class="text-center">{{t_title}}:</h2>
    <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>
          </tr>
        </thead>
        <tbody class="text-center">
          {% for item in objects %}
          <tr>
            <td class="text-end align-item-bottom">{{ forloop.counter }}.</td>
            <td><a href="{{ item.get_absolute_url }}">Справка № {{ item.number }} от {{ item.registered }}</a></td>
            <td><a href="{{ item.contract.client.get_absolute_url }}">{{item.contract.client.surname_cases.dative}} {{item.contract.client.name_cases.dative}} {{item.contract.client.patronymic_cases.dative}}</a></td>
            <td><a href="{{ item.order.get_absolute_url }}" target="_blank">{{item.order}}</a></td>
            {% if item.scan %}
            <td><a href="{{ item.scan.url }}" target="_blank"><span data-feather="file-text" class="align-text-bottom"></span></a></td>
            {% else %}
            <td></td>
            {% endif %}
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
{% endblock content %}






