list.blade.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <input type="hidden" name="total" id="total" value="{{ $comment->total }}"/>
  2. <input type="hidden" name="page" id="page" value="{{ $params->page }}"/>
  3. <input type="hidden" name="per_page" id="perPage" value="{{ $params->perPage }}"/>
  4. @if($comment->total > 0)
  5. @foreach($comment->list as $row)
  6. @continue($row->is_delete && $row->replyRows <= 0 && $row->depth == 0) {{-- 삭제된 댓글이며 답변이 없으면 비공개 --}}
  7. <ul id="comment_{{ $row->comment_id }}" style="margin-left: {{ ($row->depth > 0 ? $row->depth * 25 : 0) }}px;">
  8. <li class="media">
  9. @if($row->is_delete)
  10. @if($row->isBlind)
  11. 관리자에 의해 차단된 댓글입니다.
  12. @else
  13. 작성자에 의해 삭제된 댓글입니다.
  14. @endif
  15. @elseif($boardMeta->comment_blame_blind_count && $row->blame >= $boardMeta->comment_blame_blind_count)
  16. 신고 누적으로 비공개 처리되었습니다. 해당 댓글은 관리자 확인 후 이용규칙에 따라 처리됩니다.
  17. @else
  18. @if($boardMeta->use_comment_profile)
  19. <img src="{{ $row->user->thumb }}" class="media-thumb" width="82" height="82"/>
  20. @endif
  21. <div class="media-body">
  22. <form name="f_comment_list" class="f-comment-list" novalidate accept-charset="UTF-8">
  23. <input type="hidden" name="bid" value="{{ $row->board_id }}"/>
  24. <input type="hidden" name="pid" value="{{ $row->post_id }}"/>
  25. <input type="hidden" name="cid" value="{{ $row->comment_id }}"/>
  26. <input type="hidden" name="content" value="{{ $row->content }}"/>
  27. <input type="hidden" name="is_secret" value="{{ $row->is_secret }}"/>
  28. <dl>
  29. <dt>
  30. <div class="row">
  31. <div class="col">
  32. <strong @if($row->user_id == UID) class="text-primary" @endif>{{ $row->user->name }}</strong><span>{{ $row->createdAt }}</span>
  33. </div>
  34. <div class="col-auto">
  35. <div class="btn-group btn-cmt-manager">
  36. <button type="button" name="btn_comment_manager" class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown" data-bs-offset="0,5">관리</button>
  37. <div class="dropdown-menu dropdown-menu-right w-auto">
  38. @auth
  39. @if($row->user_id == UID)
  40. @if(!$boardMeta->use_comment_not_edit || IS_ADMIN) {{-- 수정 금지 --}}
  41. <button type="button" name="btn_comment_modify" class="dropdown-item btn-comment-modify">수정</button>
  42. @endif
  43. <button type="button" name="btn_comment_delete" class="dropdown-item btn-comment-delete">삭제</button>
  44. @endif
  45. @endauth
  46. @if($boardMeta->use_comment_blame)
  47. <button type="button" name="btn_comment_blame" class="dropdown-item btn-comment-blame" data-bs-toggle="modal" data-bs-target="#commentBlameModal">신고</button>
  48. @endif
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </dt>
  54. <dd>
  55. <p>
  56. @if($row->is_secret)
  57. <i class="fas fa-lock"></i>
  58. @if($row->user_id != UID)
  59. @php $row->content = '비밀글입니다.'; @endphp
  60. @endif
  61. @endif
  62. {!! nl2br($row->content) !!}
  63. </p>
  64. </dd>
  65. <dd>
  66. @if($boardMeta->use_comment_like)
  67. <button type="button" name="btn_comment_like" class="btn-comment-like" value="1" data-active="{{ $row->isLike ? 1 : 0 }}" data-rows="{{ $row->like }}">
  68. @if($row->isLike)
  69. <i class="fas fa-thumbs-up"></i>
  70. @else
  71. <i class="far fa-thumbs-up"></i>
  72. @endif
  73. <span>{{ $row->like }}</span>
  74. </button>
  75. @endif
  76. @if($boardMeta->use_comment_dislike)
  77. <button type="button" name="btn_comment_dislike" class="btn-comment-dislike" value="2" data-active="{{ $row->isDislike ? 1 : 0 }}" data-rows="{{ $row->dislike }}">
  78. @if($row->isDislike)
  79. <i class="fas fa-thumbs-down"></i>
  80. @else
  81. <i class="far fa-thumbs-down"></i>
  82. @endif
  83. <span>{{ $row->dislike }}</span>
  84. </button>
  85. @endif
  86. <button type="button" name="btn_comment_reply" class="btn-comment-reply">답글</button>
  87. </dd>
  88. </dl>
  89. </form>
  90. @auth
  91. <div id="fCommentWrite_{{ $row->comment_id }}"></div>
  92. @endauth
  93. </div>
  94. @endif
  95. </li>
  96. </ul>
  97. <hr/>
  98. @endforeach
  99. {{ $comment->pagination }}
  100. @endif