@if($comment->user)
<div id="reply-{{$comment->id}}" class="reply reply-{{$comment->id}} media">
    <div class="media-object pull-left">
        <a href="{{$page->present()->url()}}" data-ajaxify="true"><img src="{{$page->present()->getAvatar(50)}}"/></a>
    </div>
    <div class="media-body">
        <h5 class="media-heading">
            <a href="{{$page->present()->url()}}" data-ajaxify="true">{{$page->title}}</a>
            {!! Theme::section('page.verified', ['page' => $page]) !!} 
        </h5>
 		<?php $countLikes = $comment->countLikes()?>
        <span class="comment-text" id="{{$comment->id}}-comment-text">
        
        	<?php /*?>{{$comment->present()->text()}}<?php */?>
            
            @if($comment->present()->hasTooMuchText())
                
                {{$comment->present()->text(Str::limit($comment->text, 200))}}
                
                <div class="hidden" id="full-text-content-comment-{{$comment->id}}">
                	{{$comment->present()->text()}}
                </div>
                
                <a href="" class="comment-read-more-text" data-id="{{$comment->id}}"
                   data-content="">{{trans('post.read-more')}}</a>
            @else
                {!! $comment->present()->text() !!}
            @endif
            
            {!! Theme::section('post.last-activity-comment', ['type' => 'comment','type_id' =>$comment->id,'likes'=>$countLikes]) !!} 
            
        </span>
         <br />
         
        @if ($comment->present()->canDelete())
        <div style="display:none" id="comment-inline-editor-{{$comment->id}}" class="comment-inline-editor clearfix">
            <form  action="" method="post">
                {{ csrf_field() }}
                <textarea name="text" >{{$comment->text}}</textarea>
                <br/><br/>
                <div class="pull-right">
                    <a href="" data-text="{{$comment->text}}" data-id="{{$comment->id}}" class="comment-edit-save-button btn btn-success btn-xs">{{trans('post.done-editing')}}</a>
                    <a data-id="{{$comment->id}}" class="cancel-inline-editor btn btn-default btn-xs">{{trans('post.cancel')}}</a>
                </div>
            </form>
        </div>
        @endif

        @if($image = $comment->present()->getImage())
        <a class="reply-image preview-image" href="{{Image::url($image, '600')}}"><img src="{{Image::url($image, 600)}}"/> </a>

        @endif
        <span class="post-time"><i class="icon ion-ios7-time-outline"></i> <span title="{{$comment->present()->time()}}">{{formatDTime($comment->created_at)}}</span></span>
		&nbsp;
		
        <?php $hasLike = $comment->hasLiked()?>

        <a data-target="#comment-like-count-{{$comment->id}}" data-is-login="{{Auth::check()}}" data-status="{{($hasLike) ? '1' : 0}}" class="like-button" data-like="{{trans('like.like')}}" data-unlike="{{trans('like.unlike')}}" data-id="{{$comment->id}}" data-type="comment" href=""id='like-comment-{{$comment->id}}' data-photo_type='post-photos' style="color:#000;">Emoji Reactions</a>
		<?php /*?><span id="comment-like-count-{{$comment->id}}">
           
			@if($countLikes)
                {{$countLikes}}
            @endif
        </span><?php */?>
        <!--<a href="">Like</a>-->
		<?php /*?>@if ($comment->present()->canDelete())
        	<a data-type="{{$comment->type}}" data-type-id="{{$comment->type_id}}" data-warning="{{trans('comment.confirm-delete')}}" class="delete-button" data-id="{{$comment->id}}" href=""><i class="fa fa-trash"></i> {{trans('comment.delete')}}</a>
        @endif<?php */?>
        &nbsp;
        @if($comment->comment_id==0)
        	|
        	&nbsp;
        	<span class="comment-reply-count brand-colored-texts" data-id="{{$comment->id}}">Comments (<span class="comment-reply-count-{{$comment->id}}">{{$comment->countComments()}}</span>)</span>
        @endif
        &nbsp;
        @if ($comment->present()->canDelete())
        	|
        	&nbsp;
       		<a data-comment-id="{{$comment->id}}" class="comment-edit-button black-color-button btn-sm" href=""><i class="icon ion-edit"></i> {{trans('global.edit')}}</a>
        @endif
    </div>
    
    <div class="comment-comments-section">
            <div class="post-replies" id="{{$comment->id}}-comment-replies" data-limit="3" data-offset="3" data-type="comment"
         data-type-id="{{$comment->id}}">
                @if ($comment->countComments() > 3)
                    <a href="" class="load-more-comment" data-target="#{{$comment->id}}-comment-replies">
                        <i class="icon ion-chatbox"></i> View more replies <img class="indicator"
                                                                                                     src="{{Theme::asset()->img('theme/images/loading.gif')}}"/>
                    </a>
                @endif
                    
                <div id="comment-{{$comment->id}}-reply-lists" class="@if($comment->comment_id==0) comment-reply-list @endif comment-replies-list">
                    @foreach($comment->comments->take(3) as $com)
                        {!! Theme::section('comment.display', ['comment' => $com]) !!} 
                    @endforeach
                </div>
                @if($comment->comment_id==0)
                	<div class="add-comment-comment-form-{{$comment->id}} add-comment-comment-form">
                		{!! Theme::section('comment.form', ['typeId' => $comment->id, 'type' => 'comment','comment_id'=>$comment->id]) !!} 
            		</div>
                @endif
            </div>
     </div>
</div>
@else
    <?php $comment->delete()?>
@endif
