@inject('markdown', 'Parsedown') @php // TODO: There should be a better place for this. $markdown->setSafeMode(true); @endphp
@if($comment->commenter->avatar) {{ $comment->commenter->global_name ?? $comment->commenter->username }} Avatar @else {{ $comment->commenter->global_name ?? $comment->commenter->username }} Avatar @endif
@if($comment->commenter->is_patreon)
{{ $comment->commenter->global_name ?? $comment->commenter->username }} - {{ $comment->created_at->diffForHumans() }}
@else
{{ $comment->commenter->global_name ?? $comment->commenter->username }} - {{ $comment->created_at->diffForHumans() }}
@endif
{!! $markdown->line($comment->comment) !!}
@if (! Illuminate\Support\Facades\Route::is('profile.comments'))
@can('reply-to-comment', $comment) @endcan @can('edit-comment', $comment) @endcan @can('delete-comment', $comment) @lang('comments::comments.delete') @endcan
@endif @can('edit-comment', $comment) @include('modals.comment-edit') @endcan @can('reply-to-comment', $comment) @include('modals.comment-reply') @endcan
{{-- Margin bottom --}} {{-- Recursion for children --}} @if($grouped_comments->has($comment->getKey()) && $indentationLevel <= $maxIndentationLevel) {{-- TODO: Don't repeat code. Extract to a new file and include it. --}} @foreach($grouped_comments[$comment->getKey()] as $child)
@include('comments::_comment', [ 'comment' => $child, 'grouped_comments' => $grouped_comments ])
@endforeach @endif
{{-- Recursion for children --}} @if($grouped_comments->has($comment->getKey()) && $indentationLevel > $maxIndentationLevel) {{-- TODO: Don't repeat code. Extract to a new file and include it. --}} @foreach($grouped_comments[$comment->getKey()] as $child) @include('comments::_comment', [ 'comment' => $child, 'grouped_comments' => $grouped_comments ]) @endforeach @endif