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

Open in your IDE?
  1. <li>
  2.     <div class="comments-list-item  {{ comment.getChildren()|length > 0 ? 'comments-list-item--has-child' }} {{ comment.isDeleted() ? 'comments-list-item--deleted' }}"
  3.          data-id="{{ comment.getID() }}" data-oid="{{ comment.getEntityID() }}" data-uid="{{ comment.getUserID() }}"
  4.          data-time="{{ comment.getCreatedOn().format('Y-m-d H:i:s') }}">
  5.         <div class="fake" id="comment{{ comment.getID() }}"></div>
  6.         {% set commentEntity = getCommentEntityByType(comment.getEntityID(), comment.getTypeID()) %}
  7.         {% if isLiveComments %}
  8.             {% set urlAction = 'Slivki:Default:details' %}
  9.             {% if (comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_SALE_COMMENT')) %}
  10.                 {% set urlAction = 'Slivki:Sale:details' %}
  11.             {% endif %}
  12.             {% if (comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_MALL_BRAND_COMMENT') or comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_DIRECTOR_COMMENT')) %}
  13.                 {% set commentEntityTitle = commentEntity.getName() %}
  14.             {% else %}
  15.                 {% set commentEntityTitle = commentEntity.getTitle() %}
  16.             {% endif %}
  17.             <a class="voteMarketActionUrl"
  18.                href="{{ getURL(urlAction, comment.getEntityID()) }}">{{ commentEntityTitle }}</a>
  19.         {% endif %}
  20.         <div class="meta">
  21.             <div class="avatar"
  22.                  style="background-image: url('{{ getProfileImageURL(comment.getUser().getProfileImageMedia(), 100, 100) }}');"></div>
  23.             <div class="col" style="display: flex; flex-direction: column;min-height: 46px;">
  24.                 <div class="author">{{ comment.getUser().getFirstName() }}</div>
  25.                 <time class="date">{{ comment.getCreatedOn().format('d.m.Y, H:i') }}</time>
  26.                 {% if comment.getRating() > 0 %}
  27.                     <ul class="rating-stars">
  28.                         {% for i in 1..5 %}
  29.                             <li {{ (comment.getRating() >= i) ? 'class="rated"' : '' }}><i class="slivki-icon-star"></i>
  30.                             </li>
  31.                         {% endfor %}
  32.                     </ul>
  33.                 {% endif %}
  34.             </div>
  35.             {% if((comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_OFFER_COMMENT') or comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_SALE_COMMENT'))
  36.                 and comment.getUser().getEmail() != 'slivkiminsk@gmail.com') %}
  37.                 <div class="date-for-registrate">
  38.                     Пользователь на сайте с {{ comment.getUser().createdOn.format('d.m.Y') }}
  39.                 </div>
  40.                 <div class="comment-codes">
  41.                     Взято кодов&nbsp;
  42.                     <div class="border-comment-codes">
  43.                         {% if comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_OFFER_COMMENT') %}
  44.                             <div class="current mr-2" data-toggle="tooltip" data-placement="top" title="По этой акции">
  45.                                 {{ comment.getUser().getCodesCountByOffer(commentEntity) }}
  46.                             </div>
  47.                         {% endif %}
  48.                         {% set splitTotalCodesCountByUser = comment.getUser().getSplitTotalCodesCount() %}
  49.                         {% set codesCountByUser = splitTotalCodesCountByUser['paidCodesCount'] %}
  50.                         {% set codesCountByUserTitle = "За всё время" %}
  51.                         <div class="all" data-toggle="tooltip" data-placement="top"
  52.                              data-original-title="{{ codesCountByUserTitle }}">{{ codesCountByUser }}</div>
  53.                     </div>
  54.                 </div>
  55.                 {% if getCommentsCountByUserID(comment.getUserID(), comment.getEntityID(), comment.getTypeID()) > 1 %}
  56.                     <div class="megaphone" data-toggle="tooltip" data-placement="top"
  57.                          data-original-title="Все отзывы пользователя к этой акции"><i
  58.                                 class="slivki-icon-volume-up"></i></div>
  59.                 {% endif %}
  60.             {% endif %}
  61.             <div class="clear"></div>
  62.             <div class="message voteComment body">
  63.                 {{ comment.isDeleted() ? 'Комментарий удален пользователем' : comment.getLinkifyComment()|raw|nl2br }}
  64.             </div>
  65.             {% if comment.getVoicePath() != '' %}
  66.                 <div id="audioPlayer" class="audio-player">
  67.                     <audio controls id="audioElement">
  68.                         <source src="{{ comment.getVoicePath() }}" type="audio/wav">
  69.                         Ваш браузер не поддерживает аудиоплеер.
  70.                     </audio>
  71.                     <div id="deleteButton" class="delete-button" onclick="deleteAudio({{ comment.getID() }}, $(this))"
  72.                          style="display: none">x
  73.                     </div>
  74.                 </div>
  75.                 <input id="voicePath" type="hidden" value="{{ comment.getVoicePath() }}">
  76.             {% endif %}
  77.             <div class="comment-media-placeholder">
  78.                 {% if comment.getMedias()|length > 0 and not comment.isDeleted() %}
  79.                     <div class="userVoteImages">
  80.                         <div class="commentImageWrapper">
  81.                             {% for media in comment.getMedias() %}
  82.                                 <a class="voteImages{{ media.getID() }}"
  83.                                    href="{{ constant('\\Slivki\\Services\\ImageService::MEDIA_ROOT') }}{{ constant('\\Slivki\\Services\\ImageService::INITIAL_PATH') }}{{ media.getPath() }}{{ media.getName() }}"
  84.                                    data-lightbox="image{{ media.getID() }}">
  85.                                     <img class="voteImage" alt="" src="{{ getImageURL(media, 0, 400) }}">
  86.                                 </a>
  87.                             {% endfor %}
  88.                         </div>
  89.                     </div>
  90.                 {% endif %}
  91.             </div>
  92.             {% if not is_granted(constant('Slivki\\Entity\\UserGroup::COMMENTS_BANNED_ROLE_NAME')) %}
  93.                 <div class="addCommentAnswerButton">
  94.                     <div class="reply link pseudo-link green"
  95.                          onclick="commentAdd({{ comment.getID() }}, {{ comment.getEntityID() }}, {{ comment.getTypeID() }})"
  96.                          data-toggle="modal" data-target="{{ app.user ? '#addVoteBox' : '#onlyRegistered' }}">Ответить
  97.                     </div>
  98.                     <div class="votesBox" id="voteBox{{ comment.getID() }}"></div>
  99.                 </div>
  100.                 <div class="likes-box float-right">
  101.                     {% set votes = comment.getLikesAmount() %}
  102.                     <a class="like-button" href="#"><i
  103.                                 class="slivki-icon-thumbs-up"></i><span>{{ votes.likesAmount }}</span></a>
  104.                     <a class="dislike-button" href="#"><i
  105.                                 class="slivki-icon-thumbs-down"></i><span>{{ votes.dislikesAmount }}</span></a>
  106.                 </div>
  107.             {% endif %}
  108.             {% if comment.getAdminComment()|length %}
  109.                 <div class="admin-comment">
  110.                     <div class="comment">
  111.                         <div class="body">
  112.                             <div class="info info-admin">
  113.                                 <img width="50" src="/images/avatar_logo.png">
  114.                             </div>
  115.                             <div class="message">{{ comment.getAdminComment()|raw }}</div>
  116.                         </div>
  117.                     </div>
  118.                 </div>
  119.             {% endif %}
  120.         </div>
  121.         <div class="all-in-offer-by-user">
  122.             <div class="all-in-offer-by-user--title">Отзывы пользователя к этой акции</div>
  123.             <div class="all-in-offer-by-user--comments"></div>
  124.             <input type="hidden" class="user-comments-url"
  125.                    value="/comments/get_by_user/{{ comment.getUser().getID() }}?offerID={{ comment.getEntityID() }}"/>
  126.         </div>
  127.     </div>
  128. </li>