<div class="card comment" data-id="{{ comment.getID() }}" data-uid="{{ comment.getUser().getID() }}" 
     data-time="{{ comment.getCreatedOn().format('Y-m-d H:i:s') }}"> 
    <div class="card-header"> 
        {% set commentEntity = getCommentEntityByType(comment.getEntityID(), comment.getTypeID()) %} 
        {% if isLiveComments %} 
            {% set urlAction = 'Slivki:Default:details' %} 
            {% if (comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_SALE_COMMENT')) %} 
                {% set urlAction = 'Slivki:Sale:details' %} 
            {% endif %} 
            {% if (comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_MALL_BRAND_COMMENT') or comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_DIRECTOR_COMMENT')) %} 
                {% set commentEntityTitle = commentEntity.getName() %} 
            {% else %} 
                {% set commentEntityTitle = commentEntity.getTitle() %} 
            {% endif %} 
            {#            <a class="text-dark d-block w-100 pb-1" href="{{ getURL(urlAction, comment.getEntityID()) }}"> #} 
            {#                <strong>{{ commentEntityTitle }}</strong> #} 
            {#            </a> #} 
        {% endif %} 
        <div class="d-flex"> 
            <div class="col-2 pl-0"> 
                <div class="avatar" 
                     style="background-image: url('{{ getProfileImageURL(comment.getUser().getProfileImageMedia(), 100, 100) }}');"></div> 
            </div> 
            <div class="col pr-1"> 
                <strong>{{ comment.getUser().getFirstName() }}</strong> 
                <time>{{ comment.getCreatedOn().format('d.m.Y, H:i') }}</time> 
                {% if comment.getRating() > 0 %} 
                    <ul class="rating-stars"> 
                        {% for i in 1..5 %} 
                            <li {{ (comment.getRating() >= i) ? 'class="rated"' : '' }}><i class="slivki-icon-star"></i> 
                            </li> 
                        {% endfor %} 
                    </ul> 
                {% endif %} 
            </div> 
            <div class="col px-0"> 
                <div class="date-for-registrate"> 
                    На сайте с {{ comment.getUser().getCreatedOn()|date('d.m.Y') }} 
                </div> 
                <div class="comment-codes"> 
                    Взято кодов   
                    <div class="border-comment-codes"> 
                        {% if comment.getTypeID() == constant('Slivki\\Entity\\Comment::TYPE_OFFER_COMMENT') %} 
                            <div class="current mr-1" data-toggle="tooltip" data-placement="top" title="По этой акции"> 
                                {{ comment.getUser().getCodesCountByOffer(commentEntity) }} 
                            </div> 
                        {% endif %} 
 
                        {% set splitTotalCodesCountByUser = comment.getUser().getSplitTotalCodesCount() %} 
                        {% set codesCountByUser = splitTotalCodesCountByUser['paidCodesCount'] %} 
                        {% set codesCountByUserTitle = "За всё время" %} 
                        <div class="all" data-toggle="tooltip" data-placement="top" 
                             data-original-title="{{ codesCountByUserTitle }}">{{ codesCountByUser }}</div> 
                    </div> 
                </div> 
                {% if getCommentsCountByUserID(comment.getUserID(), comment.getEntityID(), comment.getTypeID()) > 1 %} 
                    <div class="megaphone" data-toggle="tooltip" data-placement="top" 
                         data-original-title="Все отзывы пользователя к этой акции"><i 
                                class="slivki-icon-volume-up"></i></div> 
                {% endif %} 
            </div> 
        </div> 
    </div> 
    <div class="card-body py-1 message {{ comment.isDeleted() ? ' text-muted' }}"> 
        {{ comment.isDeleted() ? 'Комментарий удален пользователем' : comment.getLinkifyComment()|raw|nl2br }} 
        {% if comment.getMedias()|length > 0 and not comment.isDeleted() %} 
            <div class="comment-media"> 
                {% for media in comment.getMedias() %} 
                    <a data-fancybox="gallery" 
                       href="{{ constant('\\Slivki\\Services\\ImageService::MEDIA_ROOT') }}{{ constant('\\Slivki\\Services\\ImageService::INITIAL_PATH') }}{{ media.getPath() }}{{ media.getName() }}"> 
                        <img alt="" src="{{ getImageURL(media, 0, 400) }}"> 
                    </a> 
                {% endfor %} 
            </div> 
        {% endif %} 
    </div> 
    {% if comment.getVoicePath() != '' %} 
        <div id="audioPlayer" class="audio-player"> 
            <audio controls id="audioElement"> 
                <source src="{{ comment.getVoicePath() }}" type="audio/wav"> 
                Ваш браузер не поддерживает аудиоплеер. 
            </audio> 
            <div id="deleteButton" class="delete-button" onclick="deleteAudio({{ comment.getID() }}, $(this))" style="display: none">x</div> 
        </div> 
        <input id="voicePath" type="hidden" value="{{ comment.getVoicePath() }}"> 
 
        <div id="comment-transcription" style="display: none">{{ comment.getTranscription() }}</div> 
    {% endif %} 
    {% if not is_granted(constant('Slivki\\Entity\\UserGroup::COMMENTS_BANNED_ROLE_NAME')) %} 
        <div class="card-footer my-2 d-flex sf-bold-font"> 
            <div class="reply link pseudo-link green text-slivki mr-2" 
                 onclick="commentAdd({{ comment.getID() }}, {{ comment.getEntityID() }}, {{ comment.getTypeID() }})" 
                 data-toggle="modal" data-target="{{ app.user ? '#addVoteBox' : '#onlyRegistered' }}">Ответить 
            </div> 
            {% if app.user and app.user.getID() == comment.getUser().getID() and not comment.isDeleted() %} 
                {% if comment.getCreatedOn|date('U') > '-7 days'|date('U') and comment.getChildren()|length == 0 %} 
                    <div class="editCommentAnswerButton edit text-warning"> 
                        <div class="reply link pseudo-link green mr-2" onclick="commentEdit({{ comment.getID() }})"> 
                            Редактировать 
                        </div> 
                    </div> 
                {% endif %} 
                {% if comment.getCreatedOn|date('U') > '-24 hours'|date('U') %} 
                    <div class="editCommentAnswerButton delete text-danger"> 
                        <div class="reply link pseudo-link red mr-2">Удалить</div> 
                    </div> 
                {% endif %} 
            {% endif %} 
        </div> 
        <div class="likes-box"> 
            {% set votes = comment.getLikesAmount() %} 
            <a class="like-button mr-2" href="#"><i 
                        class="slivki-icon-thumbs-up"></i><span>{{ votes.likesAmount }}</span></a> 
            <a class="dislike-button" href="#"><i 
                        class="slivki-icon-thumbs-down"></i><span>{{ votes.dislikesAmount }}</span></a> 
        </div> 
    {% endif %} 
    <div class="all-in-offer-by-user"> 
        <div class="all-in-offer-by-user--title">Отзывы пользователя к этой акции</div> 
        <div class="all-in-offer-by-user--comments"></div> 
        <input type="hidden" class="user-comments-url" 
               value="/comments/get_by_user/{{ comment.getUser().getID() }}?offerID={{ comment.getEntityID() }}"/> 
    </div> 
</div>