ADD portada, backend & styles
This commit is contained in:
@ -1,48 +1,73 @@
|
||||
<section class="py-5">
|
||||
<section class="py-4">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="row align-items-stretch">
|
||||
|
||||
{# Primera columna - Carousel con vídeos embebidos #}
|
||||
<div class="col-lg-8 col-12 mb-4 mb-lg-0">
|
||||
<h2 class="mb-4">Últimos Vídeos</h2>
|
||||
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">VÍDEOS</p>
|
||||
|
||||
{% if videos_carousel %}
|
||||
<div id="videosCarousel" class="carousel slide" data-bs-ride="carousel">
|
||||
<div class="carousel-inner">
|
||||
{% for pair in videos_carousel|batch(2, null) %}
|
||||
<div class="carousel-item {% if loop.first %}active{% endif %}">
|
||||
<div class="row">
|
||||
{% for video in pair %}
|
||||
{% if video %}
|
||||
<div class="col-6">
|
||||
<div class="video-item">
|
||||
{% set url_video = video.meta('url_video') %}
|
||||
{% set video_data = generar_embed(url_video) %}
|
||||
{% for pair in videos_carousel|batch(2, null) %}
|
||||
|
||||
<div class="carousel-item {% if loop.first %}active{% endif %}">
|
||||
<div class="row">
|
||||
{% for video in pair %}
|
||||
{% if video %}
|
||||
<div class="col-6">
|
||||
<div class="video-item">
|
||||
{% set url_video = video.meta('url_video') %}
|
||||
{% set video_data = generar_embed(url_video) %}
|
||||
{% if video_data %}
|
||||
|
||||
{# Thumbnail clickeable en lugar del iframe #}
|
||||
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#videoModal"
|
||||
data-video-url="{{ video_data.embed_url }}"
|
||||
data-video-title="{{ video.titulo }}"
|
||||
data-video-allow="{{ video_data.allow }}"
|
||||
style="cursor: pointer;
|
||||
background-image: url('{{ video_data.thumbnail_url }}');
|
||||
background-size: cover;
|
||||
background-position: center;">
|
||||
|
||||
{% if video_data %}
|
||||
<div class="ratio ratio-1x1">
|
||||
<iframe src="{{ video_data.embed_url }}"
|
||||
title="{{ video.titulo }}"
|
||||
frameborder="0"
|
||||
allow="{{ video_data.allow }}"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
<h5>{{ video.titulo }}</h5>
|
||||
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{# Overlay con botón play #}
|
||||
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
|
||||
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
|
||||
style="width: 60px; height: 60px;">
|
||||
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Overlay oscuro al hover #}
|
||||
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
|
||||
style="transition: opacity 0.3s ease;">
|
||||
</div>
|
||||
|
||||
{# Título del vídeo #}
|
||||
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
|
||||
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
<h5>{{ video.titulo }}</h5>
|
||||
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{# carousel controls buttons#}
|
||||
{% if videos_carousel|length > 1 %}
|
||||
<button class="carousel-control-prev" type="button" data-bs-target="#videosCarousel" data-bs-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
@ -53,45 +78,80 @@
|
||||
<span class="visually-hidden">Siguiente</span>
|
||||
</button>
|
||||
|
||||
<div class="carousel-indicators">
|
||||
{# <div class="carousel-indicators">
|
||||
{% for pair in videos_carousel|batch(2, null) %}
|
||||
<button type="button" data-bs-target="#videosCarousel" data-bs-slide-to="{{ loop.index0 }}"
|
||||
{% if loop.first %}class="active"{% endif %} aria-label="Slide {{ loop.index }}"></button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div> #}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<p>No hay vídeos disponibles.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Segunda columna - Último artículo de opinión #}
|
||||
<div class="col-lg-4 col-12 opinion-article">
|
||||
<h2 class="mb-4">Última Opinión</h2>
|
||||
|
||||
{% if ultimo_articulo_opinion %}
|
||||
<div class="h-100">
|
||||
{% for article in ultimo_articulo_opinion %}
|
||||
<div class="card secondary-article">
|
||||
<a href="{{ article.link }}">
|
||||
<img src="{{ article.thumbnail.src('medium') }}"
|
||||
alt="{{ article.thumbnail.alt }}"
|
||||
class="card-img"/>
|
||||
<div class="card-img-overlay">
|
||||
<h3 class="card-title text-wrap">
|
||||
<a href="{{ article.link }}">{{ article.title }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
</a>
|
||||
{# MODAL PARA REPRODUCIR VÍDEO #}
|
||||
<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="videoModalLabel"></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
|
||||
</div>
|
||||
<div class="modal-body p-0">
|
||||
<div class="ratio ratio-16x9">
|
||||
<iframe id="modalVideoIframe"
|
||||
src=""
|
||||
title=""
|
||||
frameborder="0"
|
||||
allow=""
|
||||
allowfullscreen
|
||||
loading="lazy">
|
||||
</iframe>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">No hay artículos de opinión disponibles.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Segunda columna - Último artículo de opinión #}
|
||||
<div class="col-lg-4 col-12 opinion-article d-flex flex-column">
|
||||
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">OPINIÓN</p>
|
||||
|
||||
<div class="flex-grow-1 d-flex">
|
||||
{% if ultimo_articulo_opinion %}
|
||||
{% for article in ultimo_articulo_opinion %}
|
||||
<div class="card w-100 h-100 secondary-article">
|
||||
<a class="h-100" href="{{ article.link }}">
|
||||
<img src="{{ article.thumbnail.src('medium') }}"
|
||||
alt="{{ article.thumbnail.alt }}"
|
||||
class="card-img h-100 object-fit-cover"/>
|
||||
|
||||
<div class="card-img-overlay d-flex flex-column justify-content-end align-items-start">
|
||||
<div>
|
||||
<!-- Título -->
|
||||
<p class="card-title text-wrap fs-6">
|
||||
<a href="{{ article.link }}" class="text-white text-decoration-none">{{ article.title }}</a>
|
||||
</p>
|
||||
|
||||
<!-- Icono + autor -->
|
||||
<p class="text-white mb-0 fs-7 d-flex align-items-center">
|
||||
<i class="bi bi-person me-1"></i>
|
||||
{{ article.author }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p class="text-muted">No hay artículos de opinión disponibles.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
Reference in New Issue
Block a user