reply.blade.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container reply-container">
  4. <div class="col-12 col-md-8 offset-md-2 mt-4">
  5. <div class="card shadow-none border">
  6. @php($authed = request()->user())
  7. @php($pid = $authed ? request()->user()->profile_id : null)
  8. @php($gp = $status->parent()->parent())
  9. @if($gp)
  10. <div class="card-body p-0 m-0 bg-light border-bottom">
  11. @if(
  12. !in_array($gp->scope, ['public', 'unlisted', 'private']) ||
  13. ($gp->scope == 'private' && !$authed) ||
  14. ($gp->scope == 'private' && ($gp->profile_id != $pid && \App\Services\FollowerService::follows($pid, $gp->profile_id) == false))
  15. )
  16. <p class="text-center mb-0 py-5 font-weight-bold">This status cannot be viewed at this time.</p>
  17. @else
  18. <div class="d-flex p-0 m-0 align-items-center">
  19. @if($gp->media()->count())
  20. <img src="{{$gp->thumb()}}" width="150px" height="150px" class="post-thumbnail" onerror="this.onerror=null;this.src='/storage/no-preview.png?v=0';">
  21. @endif
  22. <div class="p-4 w-100">
  23. <div class="">
  24. <div class="media">
  25. <img src="{{$gp->profile->avatarUrl()}}" class="rounded-circle img-thumbnail mb-1 mr-3" width="30px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
  26. <div class="media-body">
  27. <span class="font-weight-bold" v-pre>{{$gp->profile->username}}</span>
  28. <div class="">
  29. <p class="w-100 text-break" v-pre>{!!$gp->rendered!!}</p>
  30. </div>
  31. <div class="mb-0 small">
  32. <a href="{{$gp->url()}}" class="text-muted">
  33. {{$gp->created_at->diffForHumans()}}
  34. </a>
  35. </div>
  36. </div>
  37. <a class="float-right" href="{{$gp->url()}}"><i class="far fa-share-square"></i></a>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. @endif
  43. </div>
  44. @endif
  45. @php($parent = $status->parent())
  46. <div class="card-body p-0 m-0 bg-light border-bottom">
  47. @if(
  48. !in_array($parent->scope, ['public', 'unlisted', 'private']) ||
  49. ($parent->scope == 'private' && !$authed) ||
  50. ($parent->scope == 'private' && ($parent->profile_id != $pid && \App\Services\FollowerService::follows($pid, $parent->profile_id) == false))
  51. )
  52. <p class="text-center mb-0 py-5 font-weight-bold">This status cannot be viewed at this time.</p>
  53. @else
  54. <div class="d-flex p-0 m-0 align-items-center">
  55. @if($parent->media()->count())
  56. <img src="{{$parent->thumb()}}" width="150px" height="150px" class="post-thumbnail" onerror="this.onerror=null;this.src='/storage/no-preview.png?v=0';">
  57. @endif
  58. <div class="p-4 w-100">
  59. <div class="">
  60. <div class="media">
  61. <img src="{{$parent->profile->avatarUrl()}}" class="rounded-circle img-thumbnail mb-1 mr-3" width="30px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
  62. <div class="media-body">
  63. <span class="font-weight-bold" v-pre>{{$parent->profile->username}}</span>
  64. <div class="">
  65. <p class="w-100 text-break" v-pre>{!!$parent->rendered!!}</p>
  66. </div>
  67. <div class="mb-0 small">
  68. <a href="{{$parent->url()}}" class="text-muted">
  69. {{$parent->created_at->diffForHumans()}}
  70. </a>
  71. </div>
  72. </div>
  73. <a class="float-right" href="{{$parent->url()}}"><i class="far fa-share-square"></i></a>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. @endif
  79. </div>
  80. <div class="card-body border-bottom">
  81. @if($status->is_nsfw)
  82. <details class="cw">
  83. <summary class="px-3 px-md-5">
  84. <p class="py-5 mb-0 text-center">This comment may contain sensitive content. <span class="float-right font-weight-bold text-primary">Show</span></p>
  85. </summary>
  86. <div class="media py-5">
  87. <img class="mr-3 rounded-circle img-thumbnail" src="{{$status->profile->avatarUrl()}}" width="60px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
  88. <div class="media-body">
  89. <h5 class="mt-0 font-weight-bold" v-pre>{{$status->profile->username}}</h5>
  90. <p class="" v-pre>{!! $status->rendered !!}</p>
  91. <div class="mb-0 small">
  92. <a href="{{$status->url()}}" class="text-muted">
  93. {{$status->created_at->diffForHumans()}}
  94. </a>
  95. </div>
  96. </div>
  97. </div>
  98. </details>
  99. @else
  100. <div class="media py-5">
  101. <img class="mr-3 rounded-circle img-thumbnail" src="{{$status->profile->avatarUrl()}}" width="60px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
  102. <div class="media-body">
  103. <h5 class="mt-0 font-weight-bold" v-pre>{{$status->profile->username}}</h5>
  104. <p class="" v-pre>{!! $status->rendered !!}</p>
  105. <div class="mb-0 small">
  106. <a href="{{$status->url()}}" class="text-muted">
  107. {{$status->created_at->diffForHumans()}}
  108. </a>
  109. @if(Auth::check() && $status->profile_id == Auth::user()->profile->id)
  110. <form class="float-right" method="POST" action="/i/delete">
  111. @csrf
  112. <input type="hidden" name="item" value="{{$status->id}}">
  113. <input type="hidden" name="type" value="status">
  114. <button class="btn btn-outline-danger small font-weight-bold btn-sm py-1">Delete</button>
  115. </form>
  116. @endif
  117. </div>
  118. </div>
  119. </div>
  120. @endif
  121. </div>
  122. @if($status->comments->count())
  123. <div class="card-body p-0 m-0 bg-light border-bottom">
  124. <div class="d-flex p-0 m-0 align-items-center">
  125. @if($status->comments()->first()->media()->count())
  126. <img src="{{$status->comments()->first()->thumb()}}" width="150px" height="150px" class="post-thumbnail" onerror="this.onerror=null;this.src='/storage/no-preview.png?v=0';">
  127. @endif
  128. <div class="p-4 w-100">
  129. <div class="">
  130. <div class="media">
  131. <img src="{{$status->comments()->first()->profile->avatarUrl()}}" class="rounded-circle img-thumbnail mb-1 mr-3" width="30px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
  132. <div class="media-body">
  133. <span class="font-weight-bold" v-pre>{{$status->comments()->first()->profile->username}}</span>
  134. <div class="">
  135. <p class="w-100 text-break" v-pre>{!!$status->comments()->first()->rendered!!}</p>
  136. </div>
  137. <div class="mb-0 small">
  138. <a href="{{$status->comments()->first()->url()}}" class="text-muted">
  139. {{$status->comments()->first()->created_at->diffForHumans()}}
  140. </a>
  141. </div>
  142. </div>
  143. <a class="float-right" href="{{$status->comments()->first()->url()}}"><i class="far fa-share-square"></i></a>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. @endif
  150. </div>
  151. </div>
  152. </div>
  153. @endsection
  154. @push('styles')
  155. <style type="text/css">
  156. @keyframes fadeInDown {
  157. 0% {
  158. opacity: 0;
  159. transform: translateY(-1.25em);
  160. }
  161. 100% {
  162. opacity: 1;
  163. transform: translateY(0);
  164. }
  165. }
  166. .cw[open] {
  167. animation-name: fadeInDown;
  168. animation-duration: 0.5s;
  169. }
  170. .cw>summary {
  171. display: flex;
  172. flex-flow: column;
  173. justify-content: center;
  174. border: 0;
  175. background-color: #fff;
  176. padding-top: 50px;
  177. padding-bottom: 50px;
  178. text-align: center;
  179. }
  180. .cw[open] > summary {
  181. display: none!important;
  182. }
  183. </style>
  184. @endpush
  185. @push('scripts')
  186. <script type="text/javascript">
  187. $(document).ready(function() {
  188. $('.reactions').hide();
  189. $('.more-comments').hide();
  190. $('.card-footer').hide();
  191. new Vue({
  192. el: '#content'
  193. });
  194. });
  195. </script>
  196. @endpush