{% extends "base.html" %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h1 class="h2">Dettaglio Documento</h1>
    <div>
        <a href="{% url 'document_delete' document.pk %}" class="btn btn-danger">Elimina</a>
    </div>
</div>

<div class="card">
    <div class="card-header">
        <h3>{{ document.name }}</h3>
    </div>
    <div class="card-body">
        <p><strong>Cliente:</strong> <a href="{% url 'client_detail' document.client.pk %}">{{ document.client.name }}</a></p>
        <p><strong>Descrizione:</strong></p>
        <p>{{ document.description|linebreaksbr }}</p>
        <p><strong>Data Caricamento:</strong> {{ document.created_at|date:"d/m/Y H:i" }}</p>
        <p><strong>File:</strong> <a href="{{ document.file.url }}" target="_blank">Visualizza/Scarica</a></p>
    </div>
    <div class="card-footer text-muted">
        <a href="{% url 'document_list' %}" class="btn btn-light">Torna alla lista</a>
    </div>
</div>
{% endblock %}