private-info.blade.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <div class="bg-white py-5 border-bottom">
  2. <div class="container">
  3. <div class="row">
  4. <div class="col-12 col-md-4 d-flex">
  5. <div class="profile-avatar mx-auto">
  6. <img class="rounded-circle box-shadow" src="/storage/avatars/default.jpg?v=1" width="172px" height="172px">
  7. </div>
  8. </div>
  9. <div class="col-12 col-md-8 d-flex align-items-center">
  10. <div class="profile-details">
  11. <div class="username-bar pb-2 d-flex align-items-center">
  12. <span class="font-weight-ultralight h3">{{$user->username}}</span>
  13. @auth
  14. @if($is_following == true)
  15. <span class="pl-4">
  16. <button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="button" onclick="unfollowProfile()">Unfollow</button>
  17. </span>
  18. @elseif($requested == true)
  19. <span class="pl-4">
  20. <button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="button" onclick="unfollowProfile()">Follow Requested</button>
  21. </span>
  22. @elseif($is_following == false)
  23. <span class="pl-4">
  24. <button class="btn btn-primary font-weight-bold px-4 py-0" type="button" onclick="followProfile()">Follow</button>
  25. </span>
  26. @endif
  27. <span class="pl-4">
  28. <i class="fas fa-cog fa-lg text-muted cursor-pointer" data-toggle="modal" data-target="#ctxProfileMenu"></i>
  29. <div class="modal" tabindex="-1" role="dialog" id="ctxProfileMenu">
  30. <div class="modal-dialog modal-dialog-centered modal-sm">
  31. <div class="modal-content">
  32. <div class="modal-body p-0">
  33. <div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="window.App.util.clipboard('{{$user->url()}}');$('#ctxProfileMenu').modal('hide')">
  34. Copy Link
  35. </div>
  36. @auth
  37. <div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="muteProfile()">
  38. Mute
  39. </div>
  40. <a class="list-group-item cursor-pointer text-center rounded text-dark text-decoration-none" href="i/report?type=user&id={{$user->id}}">
  41. Report User
  42. </a>
  43. <div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="blockProfile()">
  44. Block
  45. </div>
  46. @endauth
  47. <div class="list-group-item cursor-pointer text-center rounded text-muted" onclick="$('#ctxProfileMenu').modal('hide')">
  48. Close
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </span>
  55. @endauth
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. @push('scripts')
  63. @auth
  64. <script type="text/javascript">
  65. function muteProfile() {
  66. axios.post('/i/mute', {
  67. type: 'user',
  68. item: '{{$user->id}}'
  69. }).then(res => {
  70. $('#ctxProfileMenu').modal('hide');
  71. $('#ctxProfileMenu').hide();
  72. swal('Muted Profile', 'You have successfully muted this profile.', 'success');
  73. });
  74. }
  75. function blockProfile() {
  76. axios.post('/i/block', {
  77. type: 'user',
  78. item: '{{$user->id}}'
  79. }).then(res => {
  80. $('#ctxProfileMenu').modal('hide');
  81. $('#ctxProfileMenu').hide();
  82. swal('Blocked Profile', 'You have successfully blocked this profile.', 'success');
  83. });
  84. }
  85. function followProfile() {
  86. axios.post('/api/v1/accounts/{{$user->id}}/follow')
  87. .then(res => {
  88. location.reload();
  89. })
  90. }
  91. function unfollowProfile() {
  92. axios.post('/api/v1/accounts/{{$user->id}}/unfollow')
  93. .then(res => {
  94. location.reload();
  95. })
  96. }
  97. </script>
  98. @endauth
  99. @endpush