{% 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>
            <th scope="col">Студенты</th>
            <th scope="col">Скан</th>
            <th scope="col"><a href="{% url 'admin:main_orders_add' %}" >Создать</a></th>
          </tr>
        </thead>
        <tbody class="text-center">
          {% for item in objects %}
          <tr class="align-middle">
            <td class="text-end align-item-bottom">{{ forloop.counter }}.</td>
            <td>{{item.event_date}}</td>
            <td><a href="{{ item.get_absolute_url }}" target="_blank">{{ item.type_order }}</a></td>
            <td class="">{{ item.number }}</td>
            <td><a href="{% url 'gen_order' order_id=item.pk %}" >Сохранить</a></td>
            <td>{% show_students_by_order item.id %} </td>
            {% if item.scan %}
            <td class="align-middle"><a href="{{ item.scan.url }}" target="_blank"><span data-feather="file-text" class="align-text-bottom"></span></a></td>
            {% else %}
            <td></td>
            {% endif %}
            <td>
              <a href="{% url 'admin:main_orders_change' item.pk %}" >Редактировать</a> |
              <a href="{% url 'admin:main_orders_delete' item.pk %}" >Удалить</a>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>

    </div>
{% endblock content %}






