2018-09-21 15:00:07 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
|
|
|
@section('title', trans('admin.list_comments_title'))
|
|
|
|
|
|
|
|
@section('breadcrumb')
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.comments')</li>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<h1>@yield('title')</h1>
|
|
|
|
<div class="alert alert-info" style="margin-bottom: 30px;">
|
|
|
|
<i class="fa fa-fw fa-info"></i> @lang('admin.list_comments_intro')
|
|
|
|
</div>
|
|
|
|
|
2018-10-05 22:17:41 +01:00
|
|
|
<form action="{{ url()->current() }}" method="get" class="form-inline">
|
|
|
|
<label for="comment-filter-status" class="mr-2 mb-3">@lang('forms.filter_comments_status_label')</label>
|
|
|
|
<select class="form-control mb-3 mr-2 custom-select" name="status" id="comment-filter-status">
|
|
|
|
<option value="all"{{ $filter_status == 'all' ? ' selected="selected"' : '' }}>@lang('admin.list_comments_status.all')</option>
|
|
|
|
<option value="pending"{{ $filter_status == 'pending' ? ' selected="selected"' : '' }}>@lang('admin.list_comments_status.pending')</option>
|
|
|
|
<option value="approved"{{ $filter_status == 'approved' ? ' selected="selected"' : '' }}>@lang('admin.list_comments_status.approved')</option>
|
|
|
|
<option value="rejected"{{ $filter_status == 'rejected' ? ' selected="selected"' : '' }}>@lang('admin.list_comments_status.rejected')</option>
|
|
|
|
</select>
|
|
|
|
<button type="submit" class="btn btn-primary mb-3">@lang('forms.apply_action')</button>
|
|
|
|
</form>
|
|
|
|
|
2018-09-21 15:00:07 +01:00
|
|
|
@if (count($comments) == 0)
|
2018-10-05 22:17:41 +01:00
|
|
|
<div class="text-center mt-4">
|
|
|
|
<h4 class="text-danger mb-3"><b>@lang('admin.no_comments_title')</b></h4>
|
|
|
|
<p class="mb-1">@lang('admin.no_comments_text')</p>
|
|
|
|
<p>@lang('admin.no_comments_text_2')</p>
|
2018-09-21 15:00:07 +01:00
|
|
|
</div>
|
|
|
|
@else
|
2018-10-05 22:17:41 +01:00
|
|
|
<form action="{{ route('comments.bulkAction') }}" method="post">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
<table class="table table-hover table-striped">
|
|
|
|
<tbody>
|
|
|
|
@foreach ($comments as $comment)
|
|
|
|
<tr>
|
|
|
|
<td class="text-center" style="width: 40px;">
|
|
|
|
<input type="checkbox" name="comment_ids[]" value="{{ $comment->id }}" />
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<p>
|
2020-04-18 18:25:43 +01:00
|
|
|
{{-- TODO: edit comments <a href="{{ route('comments.edit', ['comment' => $comment->id]) }}"><span style="font-size: 1.3em;">{{ $comment->name }}</span></a> --}}
|
2018-10-05 23:35:01 +01:00
|
|
|
<span style="font-size: 1.3em;">{{ $comment->name }}</span>
|
2018-10-05 22:57:39 +01:00
|
|
|
|
|
|
|
<br/>
|
2018-10-05 22:17:41 +01:00
|
|
|
<span class="text-muted" style="font-size: smaller;">{{ trans('admin.comment_summary', ['album_name' => $comment->photo->album->name, 'photo_name' => $comment->photo->name, 'comment_date' => date(UserConfig::get('date_format'), strtotime($comment->created_at))]) }}</span>
|
|
|
|
</p>
|
|
|
|
<blockquote>{!! $comment->textAsHtml() !!}</blockquote>
|
|
|
|
</td>
|
2018-10-05 22:57:39 +01:00
|
|
|
<td>
|
|
|
|
<p class="text-right">
|
|
|
|
@if (!$comment->isModerated())
|
|
|
|
<span class="badge badge-primary" style="font-size: 85%;">@lang('admin.comment_badge.new')</span>
|
|
|
|
@elseif ($comment->isApproved())
|
|
|
|
<span class="badge badge-success" style="font-size: 85%;">@lang('admin.comment_badge.approved')</span>
|
|
|
|
@elseif ($comment->isRejected())
|
|
|
|
<span class="badge badge-warning" style="font-size: 85%;">@lang('admin.comment_badge.rejected')</span>
|
|
|
|
@endif
|
|
|
|
</p>
|
|
|
|
|
2020-04-19 15:31:48 +01:00
|
|
|
<div class="btn-toolbar float-right">
|
2018-10-05 22:57:39 +01:00
|
|
|
<div class="btn-group mr-2">
|
|
|
|
@if (!$comment->isModerated())
|
2020-04-18 18:25:43 +01:00
|
|
|
<a href="{{ route('comments.approve', ['comment' => $comment->id]) }}" class="btn btn-outline-info">@lang('forms.approve_action')</a>
|
|
|
|
<a href="{{ route('comments.reject', ['comment' => $comment->id]) }}" class="btn btn-outline-info">@lang('forms.reject_action')</a>
|
2018-10-05 22:57:39 +01:00
|
|
|
@elseif ($comment->isApproved())
|
2020-04-18 18:25:43 +01:00
|
|
|
<a href="{{ route('comments.reject', ['comment' => $comment->id]) }}" class="btn btn-outline-info">@lang('forms.reject_action')</a>
|
2018-10-05 22:57:39 +01:00
|
|
|
@elseif ($comment->isRejected())
|
2020-04-18 18:25:43 +01:00
|
|
|
<a href="{{ route('comments.approve', ['comment' => $comment->id]) }}" class="btn btn-outline-info">@lang('forms.approve_action')</a>
|
2018-10-05 22:57:39 +01:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
2020-04-18 18:25:43 +01:00
|
|
|
<a href="{{ route('comments.delete', ['comment' => $comment->id]) }}" class="btn btn-danger">@lang('forms.delete_action')</a>
|
2018-10-05 22:57:39 +01:00
|
|
|
</div>
|
2018-10-05 22:17:41 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2018-10-05 23:11:19 +01:00
|
|
|
<div class="btn-toolbar mb-4" role="group">
|
|
|
|
<div class="btn-group mr-2">
|
|
|
|
<button type="submit" name="bulk_approve" class="btn btn-outline-info">@lang('forms.approve_selected_action')</button>
|
|
|
|
<button type="submit" name="bulk_reject" class="btn btn-outline-info">@lang('forms.reject_selected_action')</button>
|
|
|
|
</div>
|
2018-10-05 22:17:41 +01:00
|
|
|
<button type="submit" name="bulk_delete" class="btn btn-danger">@lang('forms.delete_selected_action')</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-09-21 15:00:07 +01:00
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
|
{{ $comments->links() }}
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|