{% extends "front/base.html.twig" %}
{% block title %}
{{ tuto.title }}
{% endblock %}
{% block body %}
<section class="first-section single-tutorial">
<div class="container">
<div class="row">
<div class="col-12 mb-1">
<a href="{{ path('tutos') }}" class="nav-link d-flex align-items-center px-0"><i class="fas fa-chevron-left h4 m-0"></i><span class="ml-2">{{ "tuto.back" | trans }}</span></a>
</div>
<div class="col-12">
<div class="tuto-content">
<h1 class="title m-0">{{ tuto.title }}</h1>
<ul class="d-flex p-0 nav category">
{% for category in tuto.categories %}
<li class="nav-link pl-0 pt-0">
<span>{{ category.title }}</span>
</li>
{% endfor %}
</ul>
{% if tuto.video %}
{% set embed_url = tuto.video|replace({'watch?v=': 'embed/'}) %}
<div class="content-main-video" data-video="{{ embed_url }}">
<iframe width="100%" height="100%" src="{{ embed_url }}" title="{{ tuto.title }}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
{% else %}
<div class="cover">
<img loading="lazy" src="{{ asset('images/tuto/' ~ tuto.photo) }}" alt="{{ tuto.title }}">
</div>
{% endif %}
<div class="content-text">
{{ tuto.description | raw }}
</div>
</div>
</div>
</div>
<div class="row tutorials-section">
<div class="col-12">
<h2 class="section-title-underline">{{ "tuto.discover_also" | trans }}</h2>
<div class="tutos-grid">
{% for tuto in othersTuto %}
<a class="tuto-card" href="{{ path('tuto_detail', {'slug' : tuto.slug}) }}">
<div class="cover">
<img loading="lazy" src="{{ asset('images/tuto/' ~ tuto.photo) }}" alt="{{ tuto.title }}">
</div>
<h3 class="title">{{ tuto.title }}</h3>
</a>
{% endfor %}
</div>
</div>
</div>
</div>
</section>
{% endblock %}