templates/attributeGroup/index.html.twig line 1

Open in your IDE?
  1. {% extends 'courses.html.twig' %}
  2. {% block title %}{{ attributeGroup.name }} | Všechny kurzy{% endblock %}
  3. {% block content %}
  4. {% set showMap = showMap|default(false) %}
  5. <div class="container-fluid">
  6.     <div class="row">
  7.         <div class="col-12 col-md-6 position-relative">
  8.             {% include 'form/_searchForm.html.twig' %}
  9.         </div>
  10.         <div class="col-12 col-md-6 homepage-box d-md-block d-none">
  11.             <div class="row">
  12.                 <div class="col-{% if(showMap) %}12{% else %}6{% endif %}">
  13.                     <h1>{{ attributeGroup.name }}</h1>
  14.                     <p>
  15.                         {{ attributeGroup.description }}
  16.                     </p>
  17.                 </div>
  18.                 {% if(showMap) %}
  19.                     <div class="col-12">
  20.                         {% include 'course/map.html.twig' with courses %}
  21.                     </div>
  22.                 {% else %}
  23.                     <div class="col-6">
  24.                         {% if(attributeGroup.image is not empty) %}
  25.                             {% thumbnail attributeGroup.image, 'big' %}
  26.                         {% else %}
  27.                             <img src="/images/hp.png" alt="{{ attributeGroup.name }}" class="img-fluid"/>
  28.                         {% endif %}
  29.                     </div>
  30.                 {% endif %}
  31.             </div>
  32.         </div>
  33.     </div>
  34. </div>
  35. {% if(attributeGroup.attributes|length>0) %}
  36.     <div class="container-fluid mt-5">
  37.         <div class="row text-center">
  38.                 {% for attribute in attributeGroup.attributes %}
  39.                     <div class="col-12 col-md-6 col-lg-3 mb-3">
  40.                         <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>
  41.                     </div>
  42.                 {% endfor %}
  43.         </div>
  44.     </div>
  45. {% endif %}
  46.     {% if(submenuGroups|length>0) %}
  47.         <div class="container-fluid mt-5">
  48.             <div class="row">
  49.                 {% for attributeGroupSub in submenuGroups %}
  50.                     {% for attribute in attributeGroupSub.attributes %}
  51.                         <div class="col-12 col-md-6 col-lg-3 mb-3">
  52.                             <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>
  53.                         </div>
  54.                     {% endfor %}
  55.                 {% endfor %}
  56.             </div>
  57.         </div>
  58.     {% endif %}
  59. <div class="container mt-5">
  60.     <div class="row">
  61.         {% for course in courses %}
  62.             <div class="col-12">
  63.                 {% include 'course/item/default.html.twig' with {'course': course} %}
  64.             </div>
  65.         {% else %}
  66.             Nebyly nalezeny žádné kurzy
  67.         {% endfor %}
  68.         <div class="navigation">
  69.             {{ knp_pagination_render(courses) }}
  70.         </div>
  71.     </div>
  72. {% endblock %}
  73. {% block map %}
  74.     <script type="text/javascript">
  75.         const locations = [
  76.             {% for item in courses %}
  77.             {% if(item.latitude is not empty and item.longitude is not empty) %}
  78.             {
  79.                 'title': '{{ item.name }}',
  80.                 'position': {lat: {{ item.latitude }}, lng: {{ item.longitude }} },
  81.                 {#'url': '{{ path('course_show', {'slug': item.slug}) }}'#}
  82.             },
  83.             {% endif %}
  84.             {% endfor %}
  85.         ];
  86.     </script>
  87. {% endblock %}