98 lines
5.6 KiB
Twig
98 lines
5.6 KiB
Twig
<section class="py-5">
|
|
<div class="container">
|
|
<div class="row align-items-center">
|
|
|
|
{# 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>
|
|
|
|
{% 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) %}
|
|
|
|
{% 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 %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% 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>
|
|
<span class="visually-hidden">Anterior</span>
|
|
</button>
|
|
<button class="carousel-control-next" type="button" data-bs-target="#videosCarousel" data-bs-slide="next">
|
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
|
<span class="visually-hidden">Siguiente</span>
|
|
</button>
|
|
|
|
<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>
|
|
{% 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>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">No hay artículos de opinión disponibles.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|