{% extends 'center.html.twig' %}
{% block title %}
{{ 'title.business_list'|trans }} | {{ parent() }}
{% endblock %}
{% block page %}
{% if selected is null %}
<section class="overflow-hidden py-lg-5 py-xl-5 py-sm-1 py-md-2">
<div class="container mt-2 mb-5">
<div class="row">
<div class="col-md-6 col-lg-6 text-left text-md-start">
<h1>{{ 'title.business_list'|trans }}</h1>
</div>
<div class="col-md-6 col-lg-6 text-right text-md-start">
{{ form(form) }}
</div>
</div>
</div>
<div class="container">
<div class="row g-0">
{% for business in list %}
{% if business.logo is not null %}
{% set filePath = '/uploads/'~business.logo.file %}
{% else %}
{% set filePath = '/assets/images/nc-max-logo.png' %}
{% endif %}
<div class="col-sm-6 col-lg-3 col-xl-3">
<a href="{{ path('app_city_business', {'city':city, 'url':business.url}) }}"
class="card card-hover-gradient inverted equal-1-1 m-1">
<div class="card-wrap">
<div class="card-footer text-shadow mt-auto">
<h5 class="mb-0">{{ business.title }}</h5>
<span class="text-muted">{% if business.category is not null %}{{ business.category.name }}{% endif %}</span>
<br>
<br class="text-muted">
{% for openingHour in business.openingHours %}
<i class="bi bi-watch"></i> {{ openingHour.timeFrom|date('H:i') }} - {{ openingHour.timeTill|date('H:i') }}</br>
{% endfor %}
<br class="text-muted">
{% for tag in business.tags %}
<i class="bi bi-pin"></i> {{ tag.name }}
{% endfor %}
</span>
</div>
</div>
<figure class="background"
style="background-image: url('{{ filePath }}'); background-size: auto !important; background-repeat: no-repeat; background-color: white;">
</figure>
</a>
</div>
{% endfor %}
</div>
</div>
</section>
{% block javascripts_footer %}
{{ parent() }}
<script>
$(document).ready(function () {
var $categorySelect = $('#category_filter_category');
$categorySelect.on('change', function () {
$('form[name="category_filter"]').submit();
});
});
</script>
{% endblock %}
{% else %}
<section class="overflow-hidden py-lg-5 py-xl-5 py-sm-1 py-md-2">
<div class="container">
<div class="row align-items-start mb-5 mt-5">
<div class="col-lg-8 col-md-8">
<h1>{{ selected.title }}</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="{{ path('app_city_businesses', {'city':center.url}) }}">{{ 'title.business_list'|trans }}</a>
</li>
<li class="breadcrumb-item active"><a href="#">{{ selected.category.name }}</a></li>
</ol>
</nav>
</div>
<div class="col-lg-4 col-md-4">
</div>
</div>
<div class="row align-items-start mb-5 mt-5">
{% if selected.logo is not null %}
{% set filePath = '/uploads/'~selected.logo.file %}
{% else %}
{% set filePath = '/assets/images/nc-max-logo.png' %}
{% endif %}
<div class="col-lg-4 col-md-4">
<img src="{{ filePath }}" class="img-fluid rounded" alt="{{ selected.title }}"/>
</div>
<div class="col-lg-8 col-md-8 text-justify ">
{{ selected.description|raw }}
<ul class="list-group list-group-minimal mb-2 mt-2">
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted"><i class="bi bi-envelope"></i></span>
{{ selected.address.email }}
</li>
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted"><i class="bi bi-globe"></i></span>
<a href="{{ selected.address.website }}"
target="_blank">{{ selected.address.website }}</a>
</li>
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted"><i class="bi bi-phone"></i></span>
{{ selected.address.phone }}
</li>
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted"><i class="bi bi-instagram"></i></span>
{% if selected.address.instagram %}
<a href="{{ selected.address.instagram }}"
target="_blank">{{ selected.address.instagram }}</a>
{% endif %}
</li>
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted"><i class="bi bi-facebook"></i></span>
{% if selected.address.facebook %}
<a href="{{ selected.address.facebook }}"
target="_blank">{{ selected.address.facebook }}</a>
{% endif %}
</li>
<li class="list-group-item d-flex align-items-center">
<span class="w-25 text-muted" title="{{ 'label.opening_hours'|trans }}"><i
class="bi bi-watch"></i></span>
<span title="{{ 'label.opening_hours'|trans }}">
{% for openingHour in selected.openingHours %}
{{ openingHour.timeFrom|date('H:i') }} - {{ openingHour.timeTill|date('H:i') }}<br>
{% endfor %}
</span>
</li>
</ul>
</div>
</div>
<div class="row align-items-start mb-5 mt-5">
<h5>{{ 'title.discounts'|trans }}</h5>
{% if discounts is empty %}
<p>{{ 'label.no_discounts'|trans }}</p>
{% else %}
<div class="row align-items-start">
{% for discount in discounts %}
<div class="col-md-6 col-lg-4">
<article class="card hover-arrow">
{% if discount.image is not null %}
{% set filePath = '/uploads/'~city~'/discounts/'~discount.image.file %}
<a href="{{ path('app_city_discount', {'city':city, 'url':discount.url, 'businessUrl':discount.parent.url}) }}">
<img src="{{ filePath }}" class="card-img-top"
alt="{{ discount.title }}"/>
</a>
{% endif %}
<div class="card-body p-0 pe-lg-10 mt-2">
<a href="{{ path('app_city_discount', {'city':city, 'url':discount.url, 'businessUrl':discount.parent.url}) }}"
class="card-title">
<h5>{{ discount.title }}</h5>
</a>
{{ 'label.discount_until'|trans }}:
<time datetime="{{ discount.dateFrom|date('Y-m-d H:i') }}"
class="eyebrow text-muted">{{ discount.dateFrom|date('d.m. H:i') }}</time>
</div>
</article>
</div>
{% endfor %}
</div>
{% endif %}
</div>
<div class="row align-items-start mb-5 mt-5">
<div class="col-lg-12 col-md-8">
{% set label_floor = 'label.floor-'~selected.floor %}
<h5>{{ 'label.map_position'|trans }} - {{ label_floor|trans }}</h5>
</div>
<div class="col-lg-12 text-center mt-3">
{% if selected.map is not null %}
<img src="/assets/images/maps/{{ center.url }}-{{ selected.floor }}.png" id="image-map"
usemap="#image-map" class="map img-fluid"/>
<map name="image-map" id="image-map">
<area shape="poly" coords="{{ selected.map }}" id="{{ selected.url }}"
ondmouseover="setTitle('{{ selected.title }}')" onmouseout=""
title="{{ selected.title }}"/>
{% for business in list %}
{% if business.id is not same as(selected.id) %}
<area shape="poly" coords="{{ business.map }}" id="{{ business.url }}"
ondmouseover="setTitle('{{ business.title }}')" onmouseout=""
title="{{ business.title }}" onclick="window.location.href='{{ path('app_city_business', {city:city, url: business.url}) }}'"/>
{% endif %}
{% endfor %}
</map>
<script src="{{ asset('assets/js/image-map.jquery.js') }}"></script>
<script>
$(document).ready(function () {
$('area').qtip({
content: '',
position: {
target: 'mouse', // Track the mouse as the positioning target
adjust: {x: 5, y: 5} // Offset it slightly from under the mouse
},
style: {
classes: 'qtip-bootstrap qtip-shadow'
}
});
$('#{{ selected.url }}').qtip({
content: '{{ selected.title }}',
position: {
adjust: {x: 0, y: 0} // Offset it slightly from under the mouse
},
show: true,
style: {
classes: 'qtip-bootstrap qtip-shadow'
}
});
$('.map').maphilight({
fill: true,
fillColor: 'f08d34',
fillOpacity: 0.5,
strokeColor: 'f08d34'
});
/*
var data = $('#{{ selected.url }}').mouseout().data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$('#{{ selected.url }}').data('maphilight', data).trigger('alwaysOn.maphilight');
*/
$('img[usemap]').imageMap();
});
</script>
{% endif %}
</div>
</div>
</div>
</section>
{% endif %}
{% endblock %}