{% extends 'website/main.template.html.twig' %}
{% from 'utils.html.twig' import ico, moeda, imgUpload, btnAddCart %}
{% block body %}
{% include 'website/includes/search-section.html.twig' %}
{% set infoOffer = getInfoAccessProductOffer(productOffer) %}
{% embed 'website/includes/page-title.html.twig' with { pageTitle: lesson.title }%}
{% block migalhas %}
<a href="{{ path('home') }}">{{ getLanguage('home', 'lesson_demo') }}</a> / <a href="{{ path('home') }}">{{ getLanguage('course', 'lesson_demo') }}</a> / <span>{{ lesson.title }}</span>
{% endblock %}
{% endembed %}
<div class="aula-demo">
{# PLAYER #}
<div class="demo-player">
{# FRAME #}
<div class="container">
{% include 'website/includes/frame-play.html.twig' with { library: lesson.library } %}
</div>
</div>
<div class="container">
<div class="aula-info">
{# PROFESSOR #}
<div class="professor">
<div class="foto">
{% if lesson.user.photo %}
<a href="{{ path('userProfilePublic', { username: lesson.user.username }) }}">
{{ imgUpload(lesson.user.photo, enum('AbstractEnum::PATH_PROFILES'), 'user-profile', lesson.user.name) }}
</a>
{% endif %}
</div>
<div>
<a href="{{ path('userProfilePublic', { username: lesson.user.username }) }}">
<h4>{{ lesson.user.name }}</h4>
<p class="desc">{{ lesson.user.biography }}</p>
</a>
{% include 'website/includes/sociais.html.twig' with { profile: lesson.user } %}
</div>
</div>
{# MATRICULAR #}
<div class="matricula">
<p class="tit">
{% if productOffer.saleOption == enum('ProductOfferEnum::FREE') %}
{{ getLanguage('access_full_course_free', 'lesson_demo') }}
{% elseif infoOffer.allowBuyNow == false and infoOffer.isFree == false %}
{{ getLanguage('access_wishlist', 'lesson_demo') }}
{% else %}
{{ getLanguage('access_full_course', 'lesson_demo') }}
{% endif %}
</p>
<div class="desc">
{% if infoOffer.allowBuyNow == true or infoOffer.userHasProduct == true or infoOffer.isFree == true %}
<div class="price">
{# FREE #}
{% if productOffer.saleOption == enum('ProductOfferEnum::FREE') %}
<p class="free">{{ getLanguage('free', 'lesson_demo') }}</p>
{# NOT FREE #}
{% else %}
{% if parcelInfo.maxInstallments > 1 %}
<span class="prazo">
{{ parcelInfo.maxInstallments }} × {{ getLanguage('of', 'lesson_demo') }} {{ productOffer.currencySymbol }}
<b>{{ moeda(parcelInfo.parcelPrice, false) }}</b>
</span>
<span class="prazo-vista">{{ moeda(productOffer.getPriceRealCopy()) }} {{ getLanguage('in_cash', 'lesson_demo') }}</span>
{% else %}
<span class="vista">{{ productOffer.currencySymbol }}
<b>{{ moeda(productOffer.getPriceRealCopy(), false) }}</b>
<span>{{ getLanguage('in_cash', 'lesson_demo') }}</span>
</span>
{% endif %}
{% endif %}
</div>
{% endif %}
<div class="actions">
{{
btnAddCart(
getLanguage(infoOffer.text, 'product'),
productOffer,
infoOffer,
'enroll',
)
}}
<button class="back" onclick="window.open(document.referrer,'_self')">{{ getLanguage('back', 'lesson_demo') }}</button>
</div>
</div>
</div>
</div>
</div>
{# MÓDULOS #}
{% if lessonModules %}
<div class="container">
{% include 'website/product/product-detail-course-content-section.html.twig' with { show: 3, open: 1 } %}
</div>
{% endif %}
{# TESTIMONIALS #}
<div class="container mobile--wid">
{% include 'website/course/course-testimonial-section.html.twig' with { layout: 'lesson' } %}
</div>
{# SUGESTÃO DO UPSELL #}
{% if productOfferSuggestions is not empty %}
<div class="container">
{% include 'website/product/product-detail-upsell-section.html.twig' with { suggestions: productOfferSuggestions } %}
</div>
{% endif %}
</div>
{# MODAL -- WAITLIST #}
{% include 'website/includes/modal-waitlist.html.twig' with { languageKey: 'lesson_demo' } %}
{# MODAL -- FAST USER REGISTER #}
{% include 'website/includes/modal-register.html.twig' with { languageKey: 'lesson_demo' } %}
{# MODAL -- TERMOS DE USO #}
{% embed "website/includes/modal.html.twig" with {'id': 'modal-terms-of-use', 'title': getLanguage('ready_terms', 'register'), 'back': true } %}
{% block content %}
{{ getConfig('contract')|raw }}
{% endblock %}
{% endembed %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{# EAD PLAYER #}
{% if lesson.library.type in [
enum('LibraryEnum::CONTENT_AUDIO'),
enum('LibraryEnum::CONTENT_VIDEO_FILE'),
]%}
<script src="{{ path('eadPlayerNew') }}" type="text/javascript"></script>
{% endif %}
{% endblock %}