{% 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('careerpath_large_webp') }}" type="image/webp">
<source srcset="{{ vich_uploader_asset(entry.imageFull, 'imageFile') | imagine_filter('careerpath_large') }}" type="image/jpeg">
<img src="{{ vich_uploader_asset(entry.imageFull, 'imageFile') | imagine_filter('careerpath_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>
<div uk-grid class="uk-child-width-1-3@s">
{% for ccourse in courses %}
{% set course = ccourse.course %}
<div>
<div class="uk-card uk-card-default">
<div class="uk-card-media-top">
{% if (course.imageIntro.imageName) %}
<picture>
<source srcset="{{ vich_uploader_asset(course.imageIntro, 'imageFile') | imagine_filter('course_list_webp') }}" type="image/webp">
<source srcset="{{ vich_uploader_asset(course.imageIntro, 'imageFile') | imagine_filter('course_list') }}" type="image/jpeg">
<img src="{{ vich_uploader_asset(course.imageIntro, 'imageFile') | imagine_filter('course_list') }}" alt="{{ entry.title }}">
</picture>
{% endif %}
</div>
<div class="uk-card-body">
<h3 class="uk-card-title">{{ course.title }}</h3>
<div class="uk-text-meta uk-margin-small">
{{ 'Created at'|trans }}: {{ course.createdAt|date("d/m/Y") }},
{{ 'Posted at'|trans }}:
{% for category in course.categoryOrdering %}
<a href="{{ path('client_course_category_list', {'slug': category.category.slug }) }}">{{ category.category.title }}</a>
{% if not (loop.last) %}, {% endif %}
{% endfor %}
</div>
<div>{{ course.intro|raw }}</div>
<div>
<a class="uk-button uk-button-primary" href="{{ path('client_course_view', {'slug': course.slug}) }}">{{ 'Read more...'|trans }}</a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% if is_granted('ROLE_CLIENT') and not userActive %}
<div class="uk-margin">
<form method="post" action="{{ path('client_assign_career_path') }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('addcareerpath') }}">
<input type="hidden" name="careerPath" value="{{ entry.id }}" />
<button class="uk-button uk-button-primary" type="submit">{{ 'Add to my Paths'|trans }}</button>
</form>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}