26 lines
1.5 KiB
PHP
26 lines
1.5 KiB
PHP
@php
|
|
$is_reply = (isset($is_reply) && $is_reply);
|
|
@endphp
|
|
|
|
<div class="card photo-comment mt-2" data-comment-id="{{ $comment->id }}"@if (!$is_reply) style="margin-left: {{ $comment->depth() * 20 }}px;"@endif>
|
|
<div class="card-body">
|
|
<img class="img-thumbnail rounded float-left mr-3 mb-2" src="{{ Theme::gravatarUrl($comment->email) }}" alt="{{ $comment->authorDisplayName() }}" title="{{ $comment->authorDisplayName() }}">
|
|
<h5 class="card-title mt-1"><b>{{ $comment->authorDisplayName() }}</b></h5>
|
|
<h6 class="card-subtitle mb-4 text-muted">{{ date(UserConfig::get('date_format'), strtotime($comment->created_at)) }}</h6>
|
|
{!! $comment->textAsHtml() !!}
|
|
|
|
@if (!$is_reply && ($comment->depth() < UserConfig::get('photo_comments_thread_depth') - 1) && \App\User::currentOrAnonymous()->can('post-comment', $photo))
|
|
<a href="{{ $photo->replyToCommentFormUrl($comment->id) }}" v-on:click="replyToComment" class="card-link">@lang('gallery.photo_comments_reply_action')</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
@if (!$is_reply)
|
|
@foreach ($comment->children as $childComment)
|
|
@if ($childComment->isApproved())
|
|
@include(Theme::viewName('partials.photo_single_comment'), ['comment' => $childComment])
|
|
@elseif (!$childComment->isModerated() && Gate::allows('moderate-comments', $photo))
|
|
@include(Theme::viewName('partials.photo_single_comment_moderate'), ['comment' => $childComment])
|
|
@endif
|
|
@endforeach
|
|
@endif |