home.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @extends('admin.partial.template-full')
  2. @section('section')
  3. <div class="title mb-3">
  4. <h3 class="font-weight-bold d-inline-block">Reports</h3>
  5. <span class="float-right">
  6. <a class="btn btn-{{request()->input('filter')=='all'||request()->input('filter')==null?'primary':'light'}} btn-sm font-weight-bold" href="{{route('admin.reports')}}">
  7. ALL
  8. </a>
  9. <a class="btn btn-{{request()->input('filter')=='open'?'primary':'light'}} btn-sm font-weight-bold" href="{{route('admin.reports',['filter'=>'open', 'page' => request()->input('page') ?? 1])}}">
  10. OPEN
  11. </a>
  12. <a class="btn btn-{{request()->input('filter')=='closed'?'primary':'light'}} btn-sm mr-3 font-weight-bold" href="{{route('admin.reports',['filter'=>'closed', 'page' => request()->input('page') ?? 1])}}">
  13. CLOSED
  14. </a>
  15. </span>
  16. </div>
  17. @php($ai = App\AccountInterstitial::whereNotNull('appeal_requested_at')->whereNull('appeal_handled_at')->count())
  18. @php($spam = App\AccountInterstitial::whereType('post.autospam')->whereNull('appeal_handled_at')->count())
  19. @if($ai || $spam)
  20. <div class="mb-4">
  21. <a class="btn btn-outline-primary px-5 py-3 mr-3" href="/i/admin/reports/appeals">
  22. <p class="font-weight-bold h4 mb-0">{{$ai}}</p>
  23. Appeal {{$ai == 1 ? 'Request' : 'Requests'}}
  24. </a>
  25. <a class="btn btn-outline-primary px-5 py-3" href="/i/admin/reports/autospam">
  26. <p class="font-weight-bold h4 mb-0">{{$spam}}</p>
  27. Flagged {{$ai == 1 ? 'Post' : 'Posts'}}
  28. </a>
  29. </div>
  30. @endif
  31. @if($reports->count())
  32. <div class="card shadow-none border">
  33. <div class="list-group list-group-flush">
  34. @foreach($reports as $report)
  35. <div class="list-group-item {{$report->admin_seen ? 'bg-light' : 'bg-white'}}">
  36. <div class="p-4">
  37. <div class="media d-flex align-items-center">
  38. <div class="mr-3 border rounded d-flex justify-content-center align-items-center media-avatar">
  39. <span class="text-lighter lead"><i class="fas fa-camera"></i></span>
  40. </div>
  41. <div class="media-body">
  42. <p class="mb-1 small"><span class="font-weight-bold text-uppercase">{{$report->type}}</span></p>
  43. @if($report->reporter && $report->status)
  44. <p class="mb-0 lead"><a class="font-weight-bold text-dark" href="{{$report->reporter->url()}}">{{$report->reporter->username}}</a> reported this <a href="{{$report->status->url()}}" class="font-weight-bold text-dark">post</a></p>
  45. @else
  46. <p class="mb-0 lead">
  47. @if(!$report->reporter)
  48. <span class="font-weight-bold text-dark">Deleted user</span>
  49. @else
  50. <a class="font-weight-bold text-dark" href="{{$report->reporter->url()}}">{{$report->reporter->username}}</a>
  51. @endif
  52. reported this
  53. @if(!$report->status)
  54. <span class="font-weight-bold text-muted">deleted post</span>
  55. @else
  56. <a href="{{$report->status->url()}}" class="font-weight-bold text-dark">post</a>
  57. @endif
  58. </p>
  59. @endif
  60. </div>
  61. <div class="float-right">
  62. {{-- @if($report->admin_seen == null)
  63. <a class="btn btn-outline-primary btn-sm font-weight-bold py-1 px-2 mr-2" href="{{$report->url()}}/action"><i class="fas fa-check"></i></a>
  64. @endif
  65. <a class="btn btn-outline-primary btn-sm font-weight-bold py-1 px-2 mr-2" href="{{$report->url()}}/action"><i class="fas fa-cog"></i></a> --}}
  66. @if($report->status)
  67. <a class="btn btn-primary btn-sm font-weight-bold py-1 px-3" href="{{$report->url()}}">VIEW</a>
  68. @endif
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. @endforeach
  74. </div>
  75. </div>
  76. @else
  77. <div class="card shadow-none border">
  78. <div class="card-body">
  79. <p class="mb-0 p-5 text-center font-weight-bold lead">No reports found</p>
  80. </div>
  81. </div>
  82. @endif
  83. <div class="d-flex justify-content-center mt-5 small">
  84. {{$reports->appends(['layout'=>request()->layout, 'filter' => request()->filter])->links()}}
  85. </div>
  86. @endsection
  87. @push('styles')
  88. <style type="text/css">
  89. .custom-control-label:after, .custom-control-label:before {
  90. top: auto;
  91. bottom: auto;
  92. }
  93. .media-avatar {
  94. width:64px;
  95. height:64px;
  96. background:#e9ecef;
  97. }
  98. </style>
  99. @endpush
  100. @push('scripts')
  101. @endpush