{% extends 'courses.html.twig' %}
{% block title %}{{ attributeGroup.name }} | Všechny kurzy{% endblock %}
{% block content %}
{% set showMap = showMap|default(false) %}
<div class="container-fluid">
<div class="row">
<div class="col-12 col-md-6 position-relative">
{% include 'form/_searchForm.html.twig' %}
</div>
<div class="col-12 col-md-6 homepage-box d-md-block d-none">
<div class="row">
<div class="col-{% if(showMap) %}12{% else %}6{% endif %}">
<h1>{{ attributeGroup.name }}</h1>
<p>
{{ attributeGroup.description }}
</p>
</div>
{% if(showMap) %}
<div class="col-12">
{% include 'course/map.html.twig' with courses %}
</div>
{% else %}
<div class="col-6">
{% if(attributeGroup.image is not empty) %}
{% thumbnail attributeGroup.image, 'big' %}
{% else %}
<img src="/images/hp.png" alt="{{ attributeGroup.name }}" class="img-fluid"/>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% if(attributeGroup.attributes|length>0) %}
<div class="container-fluid mt-5">
<div class="row text-center">
{% for attribute in attributeGroup.attributes %}
<div class="col-12 col-md-6 col-lg-3 mb-3">
<a style="height: 60px;" class="btn btn-light w-100" href="{{ path('attribute_group_attr_index', {'slug': attributeGroup.identifier, 'attributeSlug': attribute.identifier}) }}">{{ attribute.name }}</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% if(submenuGroups|length>0) %}
<div class="container-fluid mt-5">
<div class="row">
{% for attributeGroupSub in submenuGroups %}
{% for attribute in attributeGroupSub.attributes %}
<div class="col-12 col-md-6 col-lg-3 mb-3">
<a style="height: 60px;" class="btn btn-light w-100" href="{{ path('attribute_group_attr_index', {'slug': attributeGroupSub.identifier, 'attributeSlug': attribute.identifier}) }}">{{ attribute.name }}</a>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
<div class="container mt-5">
<div class="row">
{% for course in courses %}
<div class="col-12">
{% include 'course/item/default.html.twig' with {'course': course} %}
</div>
{% else %}
Nebyly nalezeny žádné kurzy
{% endfor %}
<div class="navigation">
{{ knp_pagination_render(courses) }}
</div>
</div>
{% endblock %}
{% block map %}
<script type="text/javascript">
const locations = [
{% for item in courses %}
{% if(item.latitude is not empty and item.longitude is not empty) %}
{
'title': '{{ item.name }}',
'position': {lat: {{ item.latitude }}, lng: {{ item.longitude }} },
{#'url': '{{ path('course_show', {'slug': item.slug}) }}'#}
},
{% endif %}
{% endfor %}
];
</script>
{% endblock %}