From a680cdf79a5cdaa92459973bbf73a4c457e81566 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 10 Feb 2019 17:12:02 -0700 Subject: [PATCH] Update admin moderation view --- resources/views/admin/reports/home.blade.php | 56 +++++++++++++++----- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/resources/views/admin/reports/home.blade.php b/resources/views/admin/reports/home.blade.php index 688fad12..b7099514 100644 --- a/resources/views/admin/reports/home.blade.php +++ b/resources/views/admin/reports/home.blade.php @@ -15,12 +15,12 @@ - - +@if(request()->input('layout') == 'list') +
@@ -98,7 +98,7 @@ - + @if(!$report->admin_seen) @else @@ -109,8 +109,30 @@ @endforeach
- +
@@ -86,7 +86,7 @@
- +
{{$report->reporter->username}} {{$report->type}}{{str_limit($report->reported()->url(), 25)}}{{str_limit($report->reported()->url(), 25)}}Unresolved
+@else +
+ @foreach($reports as $report) +
+
+ + +
+
+ @endforeach +
+@endif
- {{$reports->links()}} + {{$reports->appends(['layout'=>request()->layout, 'filter' => request()->filter])->links()}}
@endsection @@ -141,19 +163,25 @@ $('.row-check-item[data-resolved=false]').attr('checked', '').prop('checked', true); } - let len = $('.row-check-item[checked]').length; + let len = $('.row-check-item:checked').length; $('.bulk-count').text(len).attr('data-count', len); }); $(document).on('click', '.row-check-item', function(e) { var el = $(this)[0]; let len = $('.bulk-count').attr('data-count'); + console.log(el.checked); if(el.checked == true) { + $('.bulk-actions').removeClass('d-none'); len++; $('.bulk-count').text(len).attr('data-count', len); } else { - len--; - $('.bulk-count').text(len).attr('data-count', len); + if(len == 0) { + $('.bulk-actions').addClass('d-none'); + } else { + len--; + $('.bulk-count').text(len).attr('data-count', len); + } } if(len == 0) { $('.bulk-actions').addClass('d-none');