{% extends '/client/common/base.html.twig' %}
{% block title %}Home{% endblock %}
{% block body %}
<div class="uk-container uk-container-large uk-margin-large uk-margin-large-top">
<h1>{{ entry.title }}</h1>
<div>
<div class="uk-card">
<div class="uk-card-media-top">
{% if (entry.imageIntro.imageName) %}
<picture>
<source srcset="{{ vich_uploader_asset(entry.imageFull, 'imageFile') | imagine_filter('course_large_webp') }}" type="image/webp">
<source srcset="{{ vich_uploader_asset(entry.imageFull, 'imageFile') | imagine_filter('course_large') }}" type="image/jpeg">
<img src="{{ vich_uploader_asset(entry.imageFull, 'imageFile') | imagine_filter('course_large') }}" alt="{{ entry.title }}">
</picture>
{% endif %}
</div>
<div class="uk-card-body">
<div class="uk-text-meta uk-margin-bottom">
{{ 'Created at'|trans }}: {{ entry.createdAt|date("d/m/Y") }},
{{ 'Posted at'|trans }}:
{% for category in entry.categoryOrdering %}
<a href="{{ path('client_course_category_list', {'slug': category.category.slug }) }}">{{ category.category.title }}</a>
{% if not (loop.last) %}, {% endif %}
{% endfor %}
</div>
<div>{{ entry.description|raw }}</div>
{% if is_granted('ROLE_CLIENT') %}
<div class="cart">
<h3>{{ 'Price' }}: {{ entry.priceFinal }} €</h3>
<form method="post" action="{{ path('app_client_add_cart') }}">
<input type="hidden" name="course" value="{{ entry.id }}" />
<button class="uk-button uk-button-primary" type="submit">{{ 'Add to Cart'|trans }}</button>
</form>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}