templates/Slivki/comments/comments_live.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block stylesheets %}
  3.     <link rel="stylesheet" href="/css/swiper/swiper.min.css" />
  4.     {{ parent() }}
  5. {% endblock %}
  6. {% block mainColumnClass %}
  7.     {{ parent() }}
  8.     one-column comments-live-content
  9. {% endblock %}
  10. {% block header %}
  11.     {% if isMobileDevice() %}
  12.         {% embed 'header_mobile.html.twig' %}
  13.             {% block menuBlock %}
  14.                 <li class="title"><span>ОТЗЫВЫ</span></li>
  15.                 {% for item in topMenu %}
  16.                     <li><a href="{{ item.getURL() }}">{{ item.getAlias() != null ? item.getAlias() : item.getName() }}</a></li>
  17.                 {% endfor %}
  18.             {% endblock %}
  19.         {% endembed %}
  20.     {% else %}
  21.         {% embed 'header.html.twig' %}
  22.             {% block headerTopMenu %}
  23.                 {% include 'Slivki/header_menu.html.twig' with {'menuSelected': constant('Slivki\\Entity\\MainMenu::MENU_ID_COMMENT')} %}
  24.             {% endblock %}
  25.         {% endembed %}
  26.     {% endif %}
  27. {% endblock %}
  28. {% block main_content %}
  29.     <div id="commentsBox">
  30.         <div class="breadcrumbs">
  31.             <a href="{{ base_url }}">Главная</a>
  32.             {% if category is defined  %}
  33.                 <i class="fa fa-angle-right"></i>&nbsp; <a href="{{ path('commentsLive') }}">Отзывы</a>
  34.                 {% for parentCategory in parentCategories %}
  35.                     <i class="fa fa-angle-right"></i>&nbsp;<a href="/otzyvy{{ getCategoryURL(parentCategory) }}">{{ parentCategory.getName() }}</a>
  36.                 {% endfor %}
  37.                 <i class="fa fa-angle-right"></i>&nbsp;{{ category.getName() }}
  38.             {% else %}
  39.                 <i class="fa fa-angle-right"></i>&nbsp;Отзывы
  40.             {% endif %}
  41.         </div>
  42.         <div class="clear"></div>
  43.         <div class="stock-group-header">
  44.             {% if title is defined %}
  45.                 <div class="title">{{ title|raw }}</div>
  46.             {% endif %}
  47.             {% if subCategories is defined %}
  48.                 <div class="subcategories-list">
  49.                     {% for subCategory in subCategories %}
  50.                         <a href="{{ getURL(constant('Slivki\\Repository\\SeoRepository::RESOURCE_URL_CATEGORY_COMMENTS'), subCategory.getID()) }}">
  51.                             {{ subCategory.getName() }}
  52.                             <span class="green">({{ subCategory.getEntityCount() }})</span>
  53.                         </a>
  54.                     {% endfor %}
  55.                 </div>
  56.             {% endif %}
  57.         </div>
  58.         <div class="clear"></div>
  59.         {% if categoryID is defined %}
  60.             {{ getUserCommentsMediaBlockByEntityID(categoryID, 'category') }}
  61.         {% else %}
  62.             {% if offerID is defined %}
  63.                 {% set userCommentMediaBlock = getUserCommentsMediaBlockByEntityID(offerID, 'offer') %}
  64.                 {% set offerSupplierPhotoBlock = getSupplierOfferPhotoBlockByOfferID(offerID) %}
  65.                 {% if userCommentMediaBlock != '' and offerSupplierPhotoBlock != '' %}
  66.                     <ul id="commentPhotoTabs" class="nav nav-tabs" role="tablist">
  67.                         <li class="active single-line"><a href="#commentSupplierPhotoTab" role="tab" data-toggle="tab">Фото работ</a></li>
  68.                         <li class="single-line"><a href="#commentUserPhotoTab" role="tab" data-toggle="tab">Фото из отзывов</a></li>
  69.                     </ul>
  70.                     <div class="tab-content">
  71.                         <div class="tab-pane fade" id="commentSupplierPhotoTab">
  72.                             {{ offerSupplierPhotoBlock|raw }}
  73.                         </div>
  74.                         <div class="tab-pane fade in active show" id="commentUserPhotoTab">
  75.                             {{ userCommentMediaBlock|raw }}
  76.                         </div>
  77.                     </div>
  78.                 {% elseif userCommentMediaBlock != '' %}
  79.                     {{ userCommentMediaBlock|raw }}
  80.                 {% elseif offerSupplierPhotoBlock != '' %}
  81.                     {{ offerSupplierPhotoBlock|raw }}
  82.                 {% endif %}
  83.             {% else %}
  84.                 {{ getUserCommentsMediaBlockByEntityID(null, 'all') }}
  85.             {% endif %}
  86.         {% endif %}
  87.         <div class="comments-list userVotes message">
  88.             <div><img class="ajaxLoader" src="/images/image-preview-ajax-loader.gif" alt="Загрузка..."></div>
  89.             {{ comments|raw }}
  90.         </div>
  91.     </div>
  92.     {% if offerID is defined %}
  93.         <input type="hidden" id="stock-id" value="{{ offerID }}">
  94.         {% if (not is_granted(constant('Slivki\\Entity\\UserGroup::COMMENTS_BANNED_ROLE_NAME'))) %}
  95.             <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>
  96.         {% endif %}
  97.     {% endif %}
  98.     {% if categoryID is defined %}
  99.         <input type="hidden" id="category-id" value="{{ categoryID }}">
  100.         {% if category.getTypeID ==  constant('Slivki\\Entity\\Category::SUPPLIER_CATEGORY_TYPE') %}
  101.             {% include 'Slivki/pagination.html.twig' with {'paginationID': 'categoryCommentPagination', 'total': commentsCount//10, 'current': page, 'url': app.request.pathInfo() ~ '?page='} %}
  102.         {% endif %}
  103.     {% endif %}
  104. {% endblock %}
  105. {% block popups %}
  106.     {{ parent() }}
  107.     {% include 'Slivki/popups/comment_media_block_popup.html.twig' %}
  108.     {% if not isMobileDevice() %}
  109.         {% if app.user %}
  110.             {% include 'Slivki/popups/add_comment_popup.html.twig' with {'id': 'addVoteBox'} %}
  111.             {% include 'Slivki/popups/edit_comment_popup.html.twig' with {'id': 'editVoteBox'} %}
  112.         {% else %}
  113.             {% include 'Slivki/popups/comment_only_registered_popup.html.twig' with {'id': 'onlyRegistered'} %}
  114.         {% endif %}
  115.     {% endif %}
  116. {% endblock %}
  117. {% block javascripts %}
  118.     {{ parent() }}
  119.     <script src="/js/jquery.jcarousel.min.js?v=1"></script>
  120.     <script src="/js/swiper-js/swiper.min.js"></script>
  121.     <script type="text/javascript">
  122.         $(document).ready(function(){
  123.             uploadPhoto('/comment/image_upload', '/comment/image_remove');
  124.         });
  125.         {% if offerID is defined %}
  126.             initVoteBox();
  127.             initSupplierPhotoSwiper();
  128.         {% endif %}
  129.     </script>
  130. {% endblock %}
  131. {% block assetsBottom %}
  132.     {{ parent() }}
  133. {% endblock %}