index.blade.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <ul id="comment_{{ $row->id }}" style="margin-left: {{ ($row->depth > 0 ? $row->depth * 25 : 0) }}px;">
  7. <li class="media">
  8. @if($row->is_delete)
  9. @if($row->isBlind)
  10. 관리자에 의해 차단된 댓글입니다.
  11. @else
  12. 작성자에 의해 삭제된 댓글입니다.
  13. @endif
  14. @elseif($row->isBlame)
  15. 신고 누적으로 비공개 처리되었습니다. 해당 댓글은 관리자 확인 후 이용규칙에 따라 처리됩니다.
  16. @else
  17. @if($boardMeta->show_user_thumb_in_comment)
  18. <img src="{{ $row->user->thumb }}" class="media-thumb" width="82" height="82" alt="{{ $row->username }}" onerror="this.src='{{ NO_IMAGE_THUMB_SRC }}'"/>
  19. @endif
  20. <div class="media-body">
  21. <form name="f_comment_list" id="fCommentList_{{ $row->id }}" accept-charset="UTF-8" autocomplete="off" rel="nofollow">
  22. @csrf
  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->id }}"/>
  26. <input type="hidden" name="uid" value="{{ $row->user_id }}"/>
  27. <input type="hidden" name="username" value="{{ $row->username }}"/>
  28. <input type="hidden" name="content" value="{{ $row->content }}"/>
  29. <input type="hidden" name="is_secret" value="{{ $row->is_secret }}"/>
  30. <dl>
  31. <dt>
  32. <div class="row">
  33. <div class="col">
  34. <strong>{{ $row->username }}</strong>
  35. <span>{{ $row->createdAt }}</span>
  36. @if($boardMeta->show_comment_ip || IS_ADMIN)
  37. <span>{!! $row->ipAddress !!}</span>
  38. @endif
  39. </div>
  40. <div class="col-auto">
  41. <div class="btn-group">
  42. <button type="button" name="btn_comment_manager" class="btn btn-link dropdown-toggle" aria-expanded="false" data-bs-toggle="dropdown" data-bs-offset="0,5">관리</button>
  43. <div class="dropdown-menu dropdown-menu-end">
  44. @can('update', [$row, $boardMeta])
  45. <button type="button" name="btn_comment_edit" class="dropdown-item btn-comment-edit">수정</button>
  46. @endcan
  47. @can('delete', [$row, $boardMeta])
  48. <button type="button" name="btn_comment_delete" class="dropdown-item btn-comment-delete">삭제</button>
  49. @endcan
  50. @if($boardMeta->use_comment_blame)
  51. <button type="button" name="btn_comment_blame" class="dropdown-item btn-comment-blame" data-bs-toggle="modal" data-bs-target="#commentBlameModal">신고</button>
  52. @endif
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </dt>
  58. <dd>
  59. <p>
  60. @can('view', $row)
  61. @if($row->is_secret) <i class="fas fa-lock me-1"></i> @endif {!! nl2br($row->content) !!}
  62. @else
  63. <i class="fas fa-lock"></i> <span class="ms-1">비밀글입니다.</span>
  64. @endcan
  65. </p>
  66. </dd>
  67. <dd>
  68. @if($boardMeta->use_comment_like)
  69. <button type="button" name="btn_comment_like" class="btn-comment-like" value="1" data-active="{{ $row->isLike ? 1 : 0 }}" data-rows="{{ $row->like }}">
  70. @if($row->isLike)
  71. <i class="fas fa-thumbs-up"></i>
  72. @else
  73. <i class="far fa-thumbs-up"></i>
  74. @endif
  75. <span>{{ $row->like }}</span>
  76. </button>
  77. @endif
  78. @if($boardMeta->use_comment_dislike)
  79. <button type="button" name="btn_comment_dislike" class="btn-comment-dislike" value="2" data-active="{{ $row->isDislike ? 1 : 0 }}" data-rows="{{ $row->dislike }}">
  80. @if($row->isDislike)
  81. <i class="fas fa-thumbs-down"></i>
  82. @else
  83. <i class="far fa-thumbs-down"></i>
  84. @endif
  85. <span>{{ $row->dislike }}</span>
  86. </button>
  87. @endif
  88. <button type="button" name="btn_comment_reply" class="btn-comment-reply">답글</button>
  89. </dd>
  90. </dl>
  91. </form>
  92. <div id="fCommentWrite_{{ $row->id }}"></div>
  93. </div>
  94. @endif
  95. </li>
  96. </ul>
  97. <hr/>
  98. @endforeach
  99. {{ $comment->list->onEachSide($params->pageCount)->links('desktop.board.component.pagination') }}
  100. @endif
  101. @if($boardMeta->use_comment_blame)
  102. {{-- 신고하기 --}}
  103. <div class="modal fade" id="commentBlameModal" tabindex="-1" aria-labelledby="commentBlameModalLabel" aria-hidden="true">
  104. <div class="modal-dialog modal-dialog-centered">
  105. <div class="modal-content">
  106. <div class="modal-header bg-dark text-white">
  107. <h5 class="modal-title" id="commentBlameModalLabel">댓글 신고하기</h5>
  108. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
  109. </div>
  110. <div class="modal-body">
  111. <form name="f_comment_blame" id="fCommentBlame" autocomplete="off">
  112. <div class="mb-3">
  113. <label for="type" class="form-label">신고 유형</label>
  114. <select name="type" class="form-select">
  115. <option value="">신고 유형을 선택해주세요.</option>
  116. @foreach(MAP_BLAME_TYPE as $k => $v)
  117. <option value="{{ $k }}">{{ $v }}</option>
  118. @endforeach
  119. </select>
  120. </div>
  121. <div class="mb-3">
  122. <label for="reason" class="form-label">신고 내용</label>
  123. <textarea name="reason" class="form-control" rows="4" minlength="1" maxlength="1000" placeholder="신고 내용을 상세하게 입력해주세요."></textarea>
  124. </div>
  125. </form>
  126. </div>
  127. <div class="modal-footer justify-content-center">
  128. <button type="submit" class="btn btn-primary" form="fCommentBlame">확인</button>
  129. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">취소</button>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. @endif
  135. @push('styles')
  136. <link rel="stylesheet" href="{{ asset('css/desktop/board/comment.css') }}"/>
  137. @endpush