{% extends 'base.html.twig' %}
{% block stylesheets %}
<link rel="stylesheet" href="/css/swiper/swiper.min.css" />
{{ parent() }}
{% endblock %}
{% block mainColumnClass %}
{{ parent() }}
one-column comments-live-content
{% endblock %}
{% block header %}
{% if isMobileDevice() %}
{% embed 'header_mobile.html.twig' %}
{% block menuBlock %}
<li class="title"><span>ОТЗЫВЫ</span></li>
{% for item in topMenu %}
<li><a href="{{ item.getURL() }}">{{ item.getAlias() != null ? item.getAlias() : item.getName() }}</a></li>
{% endfor %}
{% endblock %}
{% endembed %}
{% else %}
{% embed 'header.html.twig' %}
{% block headerTopMenu %}
{% include 'Slivki/header_menu.html.twig' with {'menuSelected': constant('Slivki\\Entity\\MainMenu::MENU_ID_COMMENT')} %}
{% endblock %}
{% endembed %}
{% endif %}
{% endblock %}
{% block main_content %}
<div id="commentsBox">
<div class="breadcrumbs">
<a href="{{ base_url }}">Главная</a>
{% if category is defined %}
<i class="fa fa-angle-right"></i> <a href="{{ path('commentsLive') }}">Отзывы</a>
{% for parentCategory in parentCategories %}
<i class="fa fa-angle-right"></i> <a href="/otzyvy{{ getCategoryURL(parentCategory) }}">{{ parentCategory.getName() }}</a>
{% endfor %}
<i class="fa fa-angle-right"></i> {{ category.getName() }}
{% else %}
<i class="fa fa-angle-right"></i> Отзывы
{% endif %}
</div>
<div class="clear"></div>
<div class="stock-group-header">
{% if title is defined %}
<div class="title">{{ title|raw }}</div>
{% endif %}
{% if subCategories is defined %}
<div class="subcategories-list">
{% for subCategory in subCategories %}
<a href="{{ getURL(constant('Slivki\\Repository\\SeoRepository::RESOURCE_URL_CATEGORY_COMMENTS'), subCategory.getID()) }}">
{{ subCategory.getName() }}
<span class="green">({{ subCategory.getEntityCount() }})</span>
</a>
{% endfor %}
</div>
{% endif %}
</div>
<div class="clear"></div>
{% if categoryID is defined %}
{{ getUserCommentsMediaBlockByEntityID(categoryID, 'category') }}
{% else %}
{% if offerID is defined %}
{% set userCommentMediaBlock = getUserCommentsMediaBlockByEntityID(offerID, 'offer') %}
{% set offerSupplierPhotoBlock = getSupplierOfferPhotoBlockByOfferID(offerID) %}
{% if userCommentMediaBlock != '' and offerSupplierPhotoBlock != '' %}
<ul id="commentPhotoTabs" class="nav nav-tabs" role="tablist">
<li class="active single-line"><a href="#commentSupplierPhotoTab" role="tab" data-toggle="tab">Фото работ</a></li>
<li class="single-line"><a href="#commentUserPhotoTab" role="tab" data-toggle="tab">Фото из отзывов</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade" id="commentSupplierPhotoTab">
{{ offerSupplierPhotoBlock|raw }}
</div>
<div class="tab-pane fade in active show" id="commentUserPhotoTab">
{{ userCommentMediaBlock|raw }}
</div>
</div>
{% elseif userCommentMediaBlock != '' %}
{{ userCommentMediaBlock|raw }}
{% elseif offerSupplierPhotoBlock != '' %}
{{ offerSupplierPhotoBlock|raw }}
{% endif %}
{% else %}
{{ getUserCommentsMediaBlockByEntityID(null, 'all') }}
{% endif %}
{% endif %}
<div class="comments-list userVotes message">
<div><img class="ajaxLoader" src="/images/image-preview-ajax-loader.gif" alt="Загрузка..."></div>
{{ comments|raw }}
</div>
</div>
{% if offerID is defined %}
<input type="hidden" id="stock-id" value="{{ offerID }}">
{% if (not is_granted(constant('Slivki\\Entity\\UserGroup::COMMENTS_BANNED_ROLE_NAME'))) %}
<span style="display: none" id="addVoteLink" data-oid="{{ offerID }}" data-type="{{ constant('Slivki\\Entity\\Comment::TYPE_OFFER_COMMENT') }}" data-action="comment_add" data-toggle="modal" data-target="{{ app.user ? '#addVoteBox' : '#onlyRegistered' }}" >Добавить отзыв</span>
{% endif %}
{% endif %}
{% if categoryID is defined %}
<input type="hidden" id="category-id" value="{{ categoryID }}">
{% if category.getTypeID == constant('Slivki\\Entity\\Category::SUPPLIER_CATEGORY_TYPE') %}
{% include 'Slivki/pagination.html.twig' with {'paginationID': 'categoryCommentPagination', 'total': commentsCount//10, 'current': page, 'url': app.request.pathInfo() ~ '?page='} %}
{% endif %}
{% endif %}
{% endblock %}
{% block popups %}
{{ parent() }}
{% include 'Slivki/popups/comment_media_block_popup.html.twig' %}
{% if not isMobileDevice() %}
{% if app.user %}
{% include 'Slivki/popups/add_comment_popup.html.twig' with {'id': 'addVoteBox'} %}
{% include 'Slivki/popups/edit_comment_popup.html.twig' with {'id': 'editVoteBox'} %}
{% else %}
{% include 'Slivki/popups/comment_only_registered_popup.html.twig' with {'id': 'onlyRegistered'} %}
{% endif %}
{% endif %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="/js/jquery.jcarousel.min.js?v=1"></script>
<script src="/js/swiper-js/swiper.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
uploadPhoto('/comment/image_upload', '/comment/image_remove');
});
{% if offerID is defined %}
initVoteBox();
initSupplierPhotoSwiper();
{% endif %}
</script>
{% endblock %}
{% block assetsBottom %}
{{ parent() }}
{% endblock %}