mail_verification.blade.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @extends('admin.partial.template-full')
  2. @section('section')
  3. <div class="title mb-3 d-flex justify-content-between align-items-center">
  4. <div>
  5. <h3 class="font-weight-bold d-inline-block">Email Verification Requests</h3>
  6. @if($ignored)
  7. <p>
  8. You are ignoring <strong>{{ count($ignored) }}</strong> mail verification requests. <a href="#" class="font-weight-bold clear-ignored">Clear ignored requests</a>
  9. </p>
  10. @endif
  11. </div>
  12. <div class="float-right">
  13. </div>
  14. </div>
  15. <div class="col-12 col-md-8 offset-md-2">
  16. <div class="card shadow-none border">
  17. <div class="list-group list-group-flush">
  18. @foreach($reports as $report)
  19. <div class="list-group-item">
  20. <div class="media align-items-center">
  21. <img src="{{ $report['avatar'] }}" width="50" height="50" class="rounded-circle border mr-3">
  22. <div class="media-body">
  23. <p class="font-weight-bold mb-0">{{ $report['username'] }}</p>
  24. <p class="text-muted mb-0">{{ $report['email'] }}</p>
  25. </div>
  26. <div>
  27. <button class="action-btn btn btn-light font-weight-bold mr-2" data-action="ignore" data-id="{{$report['id']}}">Ignore</button>
  28. <button class="action-btn btn btn-primary font-weight-bold" data-action="approve" data-id="{{$report['id']}}"><i class="far fa-check-circle fa-lg mr-2"></i>Approve</button>
  29. </div>
  30. </div>
  31. </div>
  32. @endforeach
  33. @if(count($reports) == 0)
  34. <div class="list-group-item">
  35. <p class="font-weight-bold mb-0">No email verification requests found!</p>
  36. </div>
  37. @endif
  38. </div>
  39. </div>
  40. </div>
  41. @endsection
  42. @push('scripts')
  43. <script type="text/javascript">
  44. $('.clear-ignored').click((e) => {
  45. e.preventDefault();
  46. if(!window.confirm('Are you sure you want to clear all ignored requests?')) {
  47. return;
  48. }
  49. axios.post('/i/admin/reports/email-verifications/clear-ignored')
  50. .then(res => {
  51. location.reload();
  52. });
  53. });
  54. $('.action-btn').click((e) => {
  55. e.preventDefault();
  56. let type = e.currentTarget.getAttribute('data-action');
  57. let id = e.currentTarget.getAttribute('data-id');
  58. if(!window.confirm(`Are you sure you want to ${type} this email verification request?`)) {
  59. return;
  60. }
  61. axios.post('/i/admin/reports/email-verifications/' + type, {
  62. id: id
  63. }).then(res => {
  64. location.href = '/i/admin/reports';
  65. }).catch(err => {
  66. swal('Oops!', 'An error occured', 'error');
  67. console.log(err);
  68. })
  69. });
  70. </script>
  71. @endpush