{% extends 'base.html' %}
{% load static %}

{% block title %}Студенты | Автошкола{% endblock %}

{% block content %}
<div class="container">
    <div class="row mb-4">
        <div class="col">
            <h2 class="text-center mb-4">Студенты</h2>
        </div>
    </div>

    <div class="row">
        {% if students %}
            {% for student in students %}
                <div class="col-md-4 mb-4">
                    <div class="card h-100 shadow">
                        <div class="card-body">
                            <h5 class="card-title">{{ student.user.get_full_name }}</h5>
                            <p class="card-text">
                                <i class="fas fa-envelope me-2"></i>{{ student.user.email }}<br>
                                <i class="fas fa-phone me-2"></i>{{ student.phone_number }}
                            </p>
                        </div>
                        <div class="card-footer bg-transparent">
                            {% if user.is_authenticated %}
                            <a href="{% url 'student:detail' student.pk %}" class="btn btn-primary">
                                <i class="fas fa-info-circle me-2"></i>Подробнее
                            </a>
                            <a href="{% url 'student:schedule' student.pk %}" class="btn btn-success">
                                <i class="fas fa-calendar-alt me-2"></i>Расписание
                            </a>
                            {% endif %}
                        </div>
                    </div>
                </div>
            {% endfor %}
        {% else %}
            <div class="col">
                <div class="alert alert-info">
                    <i class="fas fa-info-circle me-2"></i>На данный момент нет зарегистрированных студентов.
                </div>
            </div>
        {% endif %}
    </div>
</div>
{% endblock %} 