@extends('core::base.layouts.master') @section('title') {{ translate('Post Comment') }} @endsection @section('custom_css') @include('core::base.includes.data_table.css') @endsection @section('main_content')

{{ translate('Comments') }} @if (request()->blog) @php $blog = Core\Models\TlBlog::where('id', request()->blog)->first(); @endphp @if (isset($blog)) {{ $blog->translation('name', getLocale()) }} {{ translate('View Post') }} @endif @endif

{{-- Comment Filter Buttons --}}
@php if (request()->blog) { $count = ['tl_blog_comments.blog_id', '=', request()->blog]; $if_blog = '&blog=' . request()->blog; $all_blog_request = '?status=singel_blog_comment&blog=' . request()->blog; $search = ''; } elseif (request()->search) { $count = ['tl_blog_comments.id', '!=', null]; $if_blog = '&search=' . request()->search; $all_blog_request = '?status=search_text&search=' . request()->search; $search = request()->search; } elseif (request()->ip_address) { $count = ['tl_blog_comments.user_ip_address', '=', request()->ip_address]; $if_blog = '&ip_address=' . request()->ip_address; $all_blog_request = '?status=user_ip_address&ip_address=' . request()->ip_address; $search = ''; } else { $count = ['tl_blog_comments.id', '!=', null]; $if_blog = ''; $all_blog_request = ''; $search = ''; } @endphp {{ translate('All') }}({{ getCommentCount([$count], $search) }}) {{ translate('Mine') }}({{ getCommentCount([$count, ['tl_blog_comments.user_id', '=', Auth::user()->id]], $search) }}) {{ translate('Pending') }}({{ getCommentCount([$count, ['tl_blog_comments.status', '=', config('settings.blog_comment_status.pending')]], $search) }}) {{ translate('Approve') }}({{ getCommentCount([$count, ['tl_blog_comments.status', '=', config('settings.blog_comment_status.approve')]], $search) }}) {{ translate('Spam') }}({{ getCommentCount([$count, ['tl_blog_comments.status', '=', config('settings.blog_comment_status.spam')]], $search) }}) {{ translate('Trash') }}({{ getCommentCount([$count, ['tl_blog_comments.status', '=', config('settings.blog_comment_status.trash')]], $search) }}) @if (request()->input('ip_address')) {{ translate('Result For') }} : ({{ request()->input('ip_address') }}) @elseif(request()->input('search')) {{ translate('Result For') }} : ({{ request()->input('search') }}) @endif
{{-- Comment Filter Buttons End --}}
@if (!request()->blog) @endif @php $key = 1; @endphp @foreach ($comments as $comment) {{-- Check if Comments is Filter By Blog Or not --}} @if (!request()->blog) @endif @php $key++; @endphp @endforeach
{{ translate('Author') }} {{ translate('Comment') }}{{ translate('In Response to') }}{{ translate('Submitted on') }}
@php $comment_setting = commentFormSettings(); $author = Core\Models\User::where('id', $comment->user_id)->first(); $author_image = $comment->user_type == 'admin' || $comment->user_type == 'user' ? userImage($author) : null; $author_name = $comment->user_type == 'admin' || $comment->user_type == 'user' ? $author->name : null; $author_name = isset($author_name) ? $author_name : $comment->user_name; $author_email = $comment->user_type == 'admin' || $comment->user_type == 'user' ? $author->email : $comment->user_email; @endphp
{{ $author_name }}
@if (isset($comment->user_website) && $comment->user_website != '') {{ $comment->user_website }}
@endif {{ $author_email }}
{{ $comment->user_ip_address }}
@if (isset($comment->parent)) @php $parent_comment = Core\Models\TlBlogComment::where('id', $comment->parent)->first()->user_name; @endphp {{ translate('In reply to') }} {{ $parent_comment }} @endif {{ $comment->comment }}
{{-- if status pending and approve --}} @if ($comment->status == '1' || $comment->status == '2') @if ($comment->status == '1') {{ translate('Unapprove') }} | {{ translate('Reply') }} | @elseif($comment->status == '2') {{ translate('Approve') }} | @endif {{ translate('Edit') }} | {{ translate('Spam') }} | {{ translate('Trash') }} @else {{-- if status trash and spam --}} @if ($comment->status == '3') {{ translate('Not Spam') }} | @elseif($comment->status == '4') {{ translate('Spam') }} | {{ translate('Restore') }} | @endif {{ translate('Delete Permanently') }} @endif
{{ getCommentCount([['tl_blog_comments.blog_id', '=', $comment->blog_id], ['tl_blog_comments.status', '=', config('settings.blog_comment_status.pending')]]) }} {{ getCommentCount([['tl_blog_comments.blog_id', '=', $comment->blog_id], ['tl_blog_comments.status', '=', config('settings.blog_comment_status.approve')]]) }} {{ getFormatedDateTime($comment->comment_date, 'Y/m/d \a\t H:i a') }}
@if (!(request()->input('page') && request()->input('page') > $comments->lastPage())) {{-- pagination --}}
{{-- Comment Page Count Info --}}

{{ translate('Showing') }} @if (!request()->input('page') || request()->input('page') == 1) 1 to {{ count($comments) }} @else @php if (request()->input('per_page')) { $per_page_count = request()->input('per_page'); } else { $per_page_count = 10; } $start_count = ((int) request()->input('page') - 1) * $per_page_count + 1; if (request()->input('page') == $comments->lastPage()) { $end_count = $comments->total(); } else { $end_count = (int) request()->input('page') * $per_page_count; } @endphp {{ $start_count . ' to ' . $end_count }} @endif {{ translate('items of') }} {{ $comments->total() }}

@endif
@endsection @section('custom_scripts') @include('core::base.includes.data_table.script') @endsection