{# @var module \App\Entity\ModulePage #}
{% extends 'main/_tpl.html.twig' %}
{% block javascripts_body %}
{{ parent() }}
{{ encore_entry_script_tags('module') }}
{{ encore_entry_link_tags('module') }}
{% endblock %}
{% block content %}
<div class="content">
<div class="content-head">
<div class="block">
<div class="page-head">
<ul class="breadcrumbs">
<li class="breadcrumbs__entry breadcrumbs__entry_current"><a class="breadcrumbs__lnk" href="{{ path('home') }}">Главная</a></li>
<li class="breadcrumbs__entry"><a class="breadcrumbs__lnk" href="{{ path('module_page.ru', {slug:module.slug}) }}">{{ module.title }}</a></li>
</ul>
<h1>{{ module.title }}</h1>
</div>
<p class="ta-center">{{ module.description|nl2br }}</p>
{% if module.attachments|length %}
<div class="content__main-slider">
{% for attach in module.attachments %}
<img src="{{ vich_uploader_asset(attach, 'imageFile') }}" alt="{{ module.title }}">
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% if module.capabilityTitle %}
<div class="content-text">
<div class="block block_padding">
<h2>{{ module.capabilityTitle }}</h2>
{{ module.capabilityText|raw }}
</div>
</div>
{% endif %}
{% if module.configureTitle %}
<div class="content-text">
<div class="block block_padding">
<h2>{{ module.configureTitle }}</h2>
{{ module.configureText|raw }}
</div>
</div>
{% endif %}
{% if module.featureText %}
<div class="content-feature">
<div class="block">
{% if module.featureYouTube %}
<div class="feature__video">
<iframe src="{{ module.featureYouTube|youtube_embed }}?controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
{% elseif module.featureImage %}
<img class="feature__img" src="{{ vich_uploader_asset(module, 'featureImageFile') }}" alt="">
{% endif %}
<div class="feature__text">
{{ module.featureText|raw }}
<a class="btn btn_blue" href="{{ path('register') }}" onclick="{{ YM.goal('free') }}">{{ module.featureBtnText|default('Попробовать бесплатно') }}</a>
</div>
</div>
</div>
{% endif %}
<div class="content-tariff">
<div class="block block_padding">
<h2>Модуль доступен на тарифах</h2>
<table class="tariff__tbl">
<thead>
<tr>
<th></th>
{% set tariffs = constant("App\\Entity\\ModulePage::TARIFFS") %}
{% set tariffRows = '' %}
{% for tariff,id in tariffs %}
<th>{{ tariff }}</th>
{% set tariffRows = tariffRows ~ '<td>'
~ (id in module.tariffs ? '<span class="round"></span>': '<span class="cross"></span>')
~ '</td>'
%}
{% endfor %}
</tr>
</thead>
<tbody>
<tr>
<td>{{ module.title }}</td>
{{ tariffRows|raw }}
</tr>
</tbody>
</table>
<div class="ta-center"><a class="btn btn_blue" href="{{ path('tariff.ru') }}">Посмотреть тарифы</a></div>
</div>
</div>
</div>
{% endblock %}