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

{% block title %}{{ course.title }} | Автошкола{% endblock %}

{% block content %}
<div class="container">
    <div class="row mb-4">
        <div class="col">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{% url 'course:list' %}">Курсы</a></li>
                    <li class="breadcrumb-item active">{{ course.title }}</li>
                </ol>
            </nav>
        </div>
    </div>

    <div class="row">
        <div class="col-md-8">
            <div class="card shadow">
                <div class="card-body">
                    <h2 class="card-title mb-4">{{ course.title }}</h2>
                    <p class="card-text">{{ course.description }}</p>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card shadow">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0">Информация о курсе</h5>
                </div>
                <div class="card-body">
                    <p><strong>Создан:</strong> {{ course.created_at|date:"d.m.Y" }}</p>
                    <p><strong>Последнее обновление:</strong> {{ course.updated_at|date:"d.m.Y" }}</p>
                </div>
            </div>

            {% if user.is_authenticated and user.instructor %}
                <div class="card shadow mt-4">
                    <div class="card-body">
                        <a href="{% url 'course:update' course.pk %}" class="btn btn-warning w-100 mb-2">
                            <i class="fas fa-edit me-2"></i>Редактировать
                        </a>
                        <a href="{% url 'course:delete' course.pk %}" class="btn btn-danger w-100">
                            <i class="fas fa-trash me-2"></i>Удалить
                        </a>
                    </div>
                </div>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %} 