{% set current_theme = current_theme() %}
<!doctype html>
<html lang="{{ current_locale() }}" class="h-100">
    <head>
        {{ current_theme.headertags() }}
        <title>{{ curso.nombre | title }}</title>

        {{ current_theme.local_style() }}
    </head>

    <body>
        {{ current_theme.navbar() }}

        <main>
            {{ current_theme.notify() }}
            <br />

            <div class="container">
                <div class="d-flex justify-content-between border-bottom">
                    <h4>
                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item">
                                    <a class="text-reset text-decoration-none link-dark" href="{{ url_for('home.panel') }}"
                                        >{{ _("Inicio") }}</a
                                    >
                                </li>
                                <li class="breadcrumb-item">{{ curso.nombre }}</li>
                            </ol>
                        </nav>
                    </h4>
                </div>

                <div class="row row-cols-1 row-cols-sm-2 row-cols-md-2 g-2">
                    <div class="col-md-4 border-right">
                        {% if curso.logo %}
                        <img
                            src="{{ url_for('static', filename='/files/public/images/resources_files/' + curso.codigo + '.jpg') }}"
                            width="100%"
                            height="225"
                            alt="{{ _('Portada del Curso') }}"
                        />
                        {% else %}
                        <svg
                            class="bd-placeholder-img card-img-top"
                            width="100%"
                            height="225"
                            xmlns="http://www.w3.org/2000/svg"
                            role="img"
                            aria-label="Placeholder: Thumbnail"
                            preserveAspectRatio="xMidYMid slice"
                            focusable="false"
                        >
                            <title>{{ curso.nombre }}</title>
                            <rect width="100%" height="100%" fill="#55595c" />
                            <text x="50%" y="50%" fill="#eceeef" dy=".3em">{{ curso.nombre }}</text>
                        </svg>
                        {% endif %} {% if current_user.is_authenticated %} {% else %}
                        <div class="d-flex d-flex justify-content-around">
                            <a
                                href="{{ url_for('user.inicio_sesion') }}"
                                class="btn btn-primary"
                                role="button"
                                aria-disabled="true"
                            >
                                Iniciar Sesión
                            </a>
                            <a
                                href="{{ url_for('user.crear_cuenta') }}"
                                class="btn btn-warning"
                                role="button"
                                aria-disabled="true"
                            >
                                {{ _("Crear") }} Cuenta
                            </a>
                        </div>
                        {% endif %}
                    </div>
                    <div class="col-md-8">
                        <h3>{{ tipo[curso.tipo] | safe }}} {{ curso.nombre }}</h3>
                        <p>{{ curso.descripcion }}</p>
                        <a href="{{ url_for('resource.descargar_recurso', resource_code=curso.id) }}"
                            ><i class="bi bi-cloud-download-fill" aria-hidden="true"></i> Descarga El {{ _("Recurso") }}</a
                        >
                    </div>
                </div>
            </div>
        </main>
    </body>
</html>
