File: //home/armgroup/libs/resources/views/account/comments/index.blade.php
@extends('layouts.app')
@section('footer')
<script>
$(document).on('click', '.showComment', function(event) {
event.preventDefault();
$('.modal-body').html($(this).data('comment'));
$('#commentModal').modal('show');
});
</script>
@endsection
@section('content')
<div class="container my-5 body-content">
<div class="row">
<div class="col-lg-3 col-sm-12">
@include('account.sidebar')
</div>
<div class="col-lg-9 col-sm-12">
<div class="card">
<h5 class="card-header">{{ __('Comments') }}</h5>
<div class="card-body">
<table class="table table-sm">
<thead class="thead-dark">
<tr>
<th scope="col">{{ __('Comment') }}</th>
<th scope="col">{{ __('Status') }}</th>
<th scope="col">{{ __('Date') }}</th>
<th scope="col">{{ __('Actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($comments as $comment)
<tr>
<td>{{ words($comment->comment, 7) }}</td>
<td>
<span class="badge bg-{{ \App\Models\Comment::STATUS_COLOR[$comment->status] }}">
{{ __(\App\Models\Comment::STATUS_TRANSLATE[$comment->status]) }}
</span>
</td>
<td>{{ to_persian_numbers(jdate($comment->created_at)) }}</td>
<td>
<button type="button"
class="btn btn-info btn-sm showComment"
data-comment="{{ $comment->comment }}">
<span class="fa fa-eye"></span> {{ __('Comment') }}
</button>
<a href="{{ optional($comment->commentable)->url }}"
class="btn btn-secondary btn-sm"
target="_blank">
<span class="fa fa-eye"></span> {{ $comment->getCommentType()['show-name'] }}
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $comments->links() }}
</div>
</div>
</div>
</div>
<div class="modal fade" id="commentModal" style="z-index: 999999999" tabindex="-1" role="dialog" aria-labelledby="commentModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="commentModalLabel">{{ __('Comment') }}</h5>
</div>
<div class="modal-body text-justify"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">بستن</button>
</div>
</div>
</div>
</div>
@endsection