<!-- Ejemplo con un Modal de Bootstrap en download_page.html -->
{% extends "base.html" %}

{% block title %}Download File {{ paste.id }}{% endblock %}

{% block content %}
<div class="container mt-4">
    <h1>Descargar Paste {{ paste.id }}</h1>
    <p>You are about to download the following file:</p>
    <ul>
        <li>Content Type: {{ paste.content_type }}</li>
        <li>Tamaño: {{ paste.size }} bytes</li>
        {% if paste.filename %}
            <li>File Name: {{ paste.filename }}</li>
        {% endif %}
    </ul>
    <!-- Botón para abrir el modal de confirmación -->
    <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#confirmDownloadModal">
        Start download
    </button>
    <a href="{{ url_for('get_paste', id=paste.id) }}" class="btn btn-secondary">Cancel</a>

    <!-- Modal de Confirmación -->
    <div class="modal fade" id="confirmDownloadModal" tabindex="-1" aria-labelledby="confirmDownloadModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Confirm Download</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    ¿Are you sure?
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
                    <a href="{{ url_for('download_file', id=paste.id) }}" class="btn btn-primary">Yes, Download</a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

