templates/index/business.html.twig line 1

Open in your IDE?
  1. {% extends 'center.html.twig' %}
  2. {% block title %}
  3.     {{ 'title.business_list'|trans }} | {{ parent() }}
  4. {% endblock %}
  5. {% block page %}
  6.     {% if selected is null %}
  7.         <section class="overflow-hidden py-lg-5 py-xl-5 py-sm-1 py-md-2">
  8.             <div class="container mt-2 mb-5">
  9.                 <div class="row">
  10.                     <div class="col-md-6 col-lg-6 text-left text-md-start">
  11.                         <h1>{{ 'title.business_list'|trans }}</h1>
  12.                     </div>
  13.                     <div class="col-md-6 col-lg-6 text-right text-md-start">
  14.                         {{ form(form) }}
  15.                     </div>
  16.                 </div>
  17.             </div>
  18.             <div class="container">
  19.                 <div class="row g-0">
  20.                     {% for business in list %}
  21.                         {% if business.logo is not null %}
  22.                             {% set filePath = '/uploads/'~business.logo.file %}
  23.                         {% else %}
  24.                             {% set filePath = '/assets/images/nc-max-logo.png' %}
  25.                         {% endif %}
  26.                         <div class="col-sm-6 col-lg-3 col-xl-3">
  27.                             <a href="{{ path('app_city_business', {'city':city, 'url':business.url}) }}"
  28.                                class="card card-hover-gradient inverted equal-1-1 m-1">
  29.                                 <div class="card-wrap">
  30.                                     <div class="card-footer text-shadow mt-auto">
  31.                                         <h5 class="mb-0">{{ business.title }}</h5>
  32.                                         <span class="text-muted">{% if business.category is not null %}{{ business.category.name }}{% endif %}</span>
  33.                                         <br>
  34.                                         <br class="text-muted">
  35.                                             {% for openingHour in business.openingHours %}
  36.                                                 <i class="bi bi-watch"></i> {{ openingHour.timeFrom|date('H:i') }} - {{ openingHour.timeTill|date('H:i') }}</br>
  37.                                         {% endfor %}
  38.                                         <br class="text-muted">
  39.                                         {% for tag in business.tags %}
  40.                                             <i class="bi bi-pin"></i> {{ tag.name }}
  41.                                         {% endfor %}
  42.                                         </span>
  43.                                     </div>
  44.                                 </div>
  45.                                 <figure class="background"
  46.                                         style="background-image: url('{{ filePath }}'); background-size: auto !important; background-repeat: no-repeat; background-color: white;">
  47.                                 </figure>
  48.                             </a>
  49.                         </div>
  50.                     {% endfor %}
  51.                 </div>
  52.             </div>
  53.         </section>
  54.         {% block javascripts_footer %}
  55.             {{ parent() }}
  56.             <script>
  57.                 $(document).ready(function () {
  58.                     var $categorySelect = $('#category_filter_category');
  59.                     $categorySelect.on('change', function () {
  60.                         $('form[name="category_filter"]').submit();
  61.                     });
  62.                 });
  63.             </script>
  64.         {% endblock %}
  65.     {% else %}
  66.         <section class="overflow-hidden py-lg-5 py-xl-5 py-sm-1 py-md-2">
  67.             <div class="container">
  68.                 <div class="row align-items-start mb-5 mt-5">
  69.                     <div class="col-lg-8 col-md-8">
  70.                         <h1>{{ selected.title }}</h1>
  71.                         <nav aria-label="breadcrumb">
  72.                             <ol class="breadcrumb">
  73.                                 <li class="breadcrumb-item"><a
  74.                                             href="{{ path('app_city_businesses', {'city':center.url}) }}">{{ 'title.business_list'|trans }}</a>
  75.                                 </li>
  76.                                 <li class="breadcrumb-item active"><a href="#">{{ selected.category.name }}</a></li>
  77.                             </ol>
  78.                         </nav>
  79.                     </div>
  80.                     <div class="col-lg-4 col-md-4">
  81.                     </div>
  82.                 </div>
  83.                 <div class="row align-items-start mb-5 mt-5">
  84.                     {% if selected.logo is not null %}
  85.                         {% set filePath = '/uploads/'~selected.logo.file %}
  86.                     {% else %}
  87.                         {% set filePath = '/assets/images/nc-max-logo.png' %}
  88.                     {% endif %}
  89.                     <div class="col-lg-4 col-md-4">
  90.                         <img src="{{ filePath }}" class="img-fluid rounded" alt="{{ selected.title }}"/>
  91.                     </div>
  92.                     <div class="col-lg-8 col-md-8 text-justify ">
  93.                         {{ selected.description|raw }}
  94.                         <ul class="list-group list-group-minimal mb-2 mt-2">
  95.                             <li class="list-group-item d-flex align-items-center">
  96.                                 <span class="w-25 text-muted"><i class="bi bi-envelope"></i></span>
  97.                                 {{ selected.address.email }}
  98.                             </li>
  99.                             <li class="list-group-item d-flex align-items-center">
  100.                                 <span class="w-25 text-muted"><i class="bi bi-globe"></i></span>
  101.                                 <a href="{{ selected.address.website }}"
  102.                                    target="_blank">{{ selected.address.website }}</a>
  103.                             </li>
  104.                             <li class="list-group-item d-flex align-items-center">
  105.                                 <span class="w-25 text-muted"><i class="bi bi-phone"></i></span>
  106.                                 {{ selected.address.phone }}
  107.                             </li>
  108.                             <li class="list-group-item d-flex align-items-center">
  109.                                 <span class="w-25 text-muted"><i class="bi bi-instagram"></i></span>
  110.                                 {% if selected.address.instagram %}
  111.                                     <a href="{{ selected.address.instagram }}"
  112.                                        target="_blank">{{ selected.address.instagram }}</a>
  113.                                 {% endif %}
  114.                             </li>
  115.                             <li class="list-group-item d-flex align-items-center">
  116.                                 <span class="w-25 text-muted"><i class="bi bi-facebook"></i></span>
  117.                                 {% if selected.address.facebook %}
  118.                                     <a href="{{ selected.address.facebook }}"
  119.                                        target="_blank">{{ selected.address.facebook }}</a>
  120.                                 {% endif %}
  121.                             </li>
  122.                             <li class="list-group-item d-flex align-items-center">
  123.                                 <span class="w-25 text-muted" title="{{ 'label.opening_hours'|trans }}"><i
  124.                                             class="bi bi-watch"></i></span>
  125.                                 <span title="{{ 'label.opening_hours'|trans }}">
  126.                                 {% for openingHour in selected.openingHours %}
  127.                                     {{ openingHour.timeFrom|date('H:i') }} - {{ openingHour.timeTill|date('H:i') }}<br>
  128.                                 {% endfor %}
  129.                                     </span>
  130.                             </li>
  131.                         </ul>
  132.                     </div>
  133.                 </div>
  134.                 <div class="row align-items-start mb-5 mt-5">
  135.                     <h5>{{ 'title.discounts'|trans }}</h5>
  136.                     {% if discounts is empty %}
  137.                         <p>{{ 'label.no_discounts'|trans }}</p>
  138.                     {% else %}
  139.                         <div class="row align-items-start">
  140.                             {% for discount in discounts %}
  141.                                 <div class="col-md-6 col-lg-4">
  142.                                     <article class="card hover-arrow">
  143.                                         {% if discount.image is not null %}
  144.                                             {% set filePath = '/uploads/'~city~'/discounts/'~discount.image.file %}
  145.                                             <a href="{{ path('app_city_discount', {'city':city, 'url':discount.url, 'businessUrl':discount.parent.url}) }}">
  146.                                                 <img src="{{ filePath }}" class="card-img-top"
  147.                                                      alt="{{ discount.title }}"/>
  148.                                             </a>
  149.                                         {% endif %}
  150.                                         <div class="card-body p-0 pe-lg-10 mt-2">
  151.                                             <a href="{{ path('app_city_discount', {'city':city, 'url':discount.url, 'businessUrl':discount.parent.url}) }}"
  152.                                                class="card-title">
  153.                                                 <h5>{{ discount.title }}</h5>
  154.                                             </a>
  155.                                             {{ 'label.discount_until'|trans }}:
  156.                                             <time datetime="{{ discount.dateFrom|date('Y-m-d H:i') }}"
  157.                                                   class="eyebrow text-muted">{{ discount.dateFrom|date('d.m. H:i') }}</time>
  158.                                         </div>
  159.                                     </article>
  160.                                 </div>
  161.                             {% endfor %}
  162.                         </div>
  163.                     {% endif %}
  164.                 </div>
  165.                 <div class="row align-items-start mb-5 mt-5">
  166.                     <div class="col-lg-12 col-md-8">
  167.                         {% set label_floor = 'label.floor-'~selected.floor %}
  168.                         <h5>{{ 'label.map_position'|trans }} - {{ label_floor|trans }}</h5>
  169.                     </div>
  170.                     <div class="col-lg-12 text-center mt-3">
  171.                         {% if selected.map is not null %}
  172.                             <img src="/assets/images/maps/{{ center.url }}-{{ selected.floor }}.png" id="image-map"
  173.                                  usemap="#image-map" class="map img-fluid"/>
  174.                             <map name="image-map" id="image-map">
  175.                                 <area shape="poly" coords="{{ selected.map }}" id="{{ selected.url }}"
  176.                                       ondmouseover="setTitle('{{ selected.title }}')" onmouseout=""
  177.                                       title="{{ selected.title }}"/>
  178.                                 {% for business in list %}
  179.                                     {% if business.id is not same as(selected.id) %}
  180.                                     <area shape="poly" coords="{{ business.map }}" id="{{ business.url }}"
  181.                                           ondmouseover="setTitle('{{ business.title }}')" onmouseout=""
  182.                                           title="{{ business.title }}" onclick="window.location.href='{{ path('app_city_business', {city:city, url: business.url}) }}'"/>
  183.                                     {% endif %}
  184.                                 {% endfor %}
  185.                             </map>
  186.                             <script src="{{ asset('assets/js/image-map.jquery.js') }}"></script>
  187.                             <script>
  188.                                 $(document).ready(function () {
  189.                                     $('area').qtip({
  190.                                         content: '',
  191.                                         position: {
  192.                                             target: 'mouse', // Track the mouse as the positioning target
  193.                                             adjust: {x: 5, y: 5} // Offset it slightly from under the mouse
  194.                                         },
  195.                                         style: {
  196.                                             classes: 'qtip-bootstrap qtip-shadow'
  197.                                         }
  198.                                     });
  199.                                     $('#{{ selected.url }}').qtip({
  200.                                         content: '{{ selected.title }}',
  201.                                         position: {
  202.                                             adjust: {x: 0, y: 0} // Offset it slightly from under the mouse
  203.                                         },
  204.                                         show: true,
  205.                                         style: {
  206.                                             classes: 'qtip-bootstrap qtip-shadow'
  207.                                         }
  208.                                     });
  209.                                     $('.map').maphilight({
  210.                                         fill: true,
  211.                                         fillColor: 'f08d34',
  212.                                         fillOpacity: 0.5,
  213.                                         strokeColor: 'f08d34'
  214.                                     });
  215.                                     /*
  216.                                     var data = $('#{{ selected.url }}').mouseout().data('maphilight') || {};
  217.                                     data.alwaysOn = !data.alwaysOn;
  218.                                     $('#{{ selected.url }}').data('maphilight', data).trigger('alwaysOn.maphilight');
  219.                                     */
  220.                                     $('img[usemap]').imageMap();
  221.                                 });
  222.                             </script>
  223.                         {% endif %}
  224.                     </div>
  225.                 </div>
  226.             </div>
  227.         </section>
  228.     {% endif %}
  229. {% endblock %}