You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
9.5 KiB

7 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
7 years ago
6 years ago
7 years ago
6 years ago
7 years ago
6 years ago
7 years ago
  1. <div class="container">
  2. <div class="ax-button-group">
  3. <div class="left">
  4. <h2><?=$board['brd_title']?></h2>
  5. </div>
  6. </div>
  7. <div data-ax-tbl>
  8. <div data-ax-tr>
  9. <div data-ax-td class="width-100">
  10. <div data-ax-td-label>제목</div>
  11. <div data-ax-td-wrap><p class="form-control-static"><?=html_escape($view['post_title'])?></p></div>
  12. </div>
  13. </div>
  14. <div data-ax-tr>
  15. <div data-ax-td>
  16. <div data-ax-td-label>작성자</div>
  17. <div data-ax-td-wrap><p class="form-control-static"><?=$view['post_nickname']?></p></div>
  18. </div>
  19. <div data-ax-td>
  20. <div data-ax-td-label>작성시간</div>
  21. <div data-ax-td-wrap><p class="form-control-static"><?=$view['reg_datetime']?></p></div>
  22. </div>
  23. <div data-ax-td>
  24. <div data-ax-td-label>최종수정</div>
  25. <div data-ax-td-wrap><p class="form-control-static"><?=$view['upd_datetime']?></p></div>
  26. </div>
  27. <div data-ax-td>
  28. <div data-ax-td-label>조회수</div>
  29. <div data-ax-td-wrap><p class="form-control-static"><?=number_format($view['post_hit'])?></p></div>
  30. </div>
  31. </div>
  32. <div data-ax-tr>
  33. <div data-ax-td>
  34. <div data-ax-td-label>작성IP</div>
  35. <div data-ax-td-wrap><p class="form-control-static"><?=long2ip((int)$view['post_ip'])?></p></div>
  36. </div>
  37. <div data-ax-td>
  38. <div data-ax-td-label>모바일</div>
  39. <div data-ax-td-wrap><p class="form-control-static"><?=$view['post_mobile']?></p></div>
  40. </div>
  41. </div>
  42. <div data-ax-tr>
  43. <div data-ax-td class="width-100">
  44. <div data-ax-td-label>게시글 링크</div>
  45. <div data-ax-td-wrap><p class="form-control-static"><a target="_blank" href="<?=base_url('board/'.$board['brd_key'].'/'.$view['post_idx'])?>"><?=base_url('board/'.$board['brd_key'].'/'.$view['post_idx'])?></a></p></div>
  46. </div>
  47. </div>
  48. <?php for($i=1; $i<=10; $i++):?>
  49. <?php if(element('post_ext'.$i, $view)) :?>
  50. <div data-ax-tr>
  51. <div data-ax-td class="width-100">
  52. <div data-ax-td-label>필드 <?=$i?></div>
  53. <div data-ax-td-wrap>
  54. <p class="form-control-static"><?=$view["post_ext{$i}"]?></p>
  55. </div>
  56. </div>
  57. </div>
  58. <?php endif;?>
  59. <?php endfor;?>
  60. <?php if( count($view['file']) > 0 ) :?>
  61. <div data-ax-tr>
  62. <div data-ax-td class="width-100">
  63. <div data-ax-td-label>첨부파일</div>
  64. <div data-ax-td-wrap>
  65. <?php foreach($view['file'] as $f) :?>
  66. <a class="btn btn-xs btn-default" href="<?=$f['link']?>"><i class="fal fa-download"></i> <?=$f['att_origin']?> (<?=format_size($f['att_filesize'])?>)</a>
  67. <?php endforeach;?>
  68. </div>
  69. </div>
  70. </div>
  71. <?php endif;?>
  72. <div data-ax-tr>
  73. <div data-ax-td class="width-100">
  74. <div data-ax-td-label>내용</div>
  75. <div data-ax-td-wrap>
  76. <div style="min-height:300px;line-height:1.4em">
  77. <!-- S:첨부파일중 이미지 표시 -->
  78. <?php foreach($view['file'] as $f) : if($f['att_is_image']!='Y') continue;?>
  79. <figure style="margin-bottom:10px;">
  80. <img src="<?=base_url($f['att_filepath'])?>" alt="<?=$f['att_origin']?>">
  81. <figcaption class="sr-only"><?=$f['att_origin']?></figcaption>
  82. </figure>
  83. <?php endforeach;?>
  84. <!-- E:첨부파일중 이미지 표시 -->
  85. <?=display_html_content($view['post_content'])?>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="text-center MT10">
  92. <a href="<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>" class="btn btn-default MR5">목록</a>
  93. <?php if( $board['brd_use_reply'] == 'Y' ):?>
  94. <a href="<?=$board['link']['reply']?>" class="btn btn-default MR5">답글</a>
  95. <?php endif;?>
  96. <a href="<?=$board['link']['modify']?>" class="btn btn-default MR5"><i class="fal fa-pencil"></i> 수정</a>
  97. <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 삭제</button>
  98. </div>
  99. <?php if($board['brd_use_comment'] == 'Y') :?>
  100. <div class="H30"></div>
  101. <?=form_open("admin/board/comment/{$board['brd_key']}/{$view['post_idx']}",array("id"=>"form-board-comment","data-form"=>"board-comment"))?>
  102. <input type="hidden" name="cmt_nickname" value="<?=$this->member->info('nickname')?>">
  103. <div data-ax-tbl>
  104. <div class="caption">댓글 입력</div>
  105. <div data-ax-tr>
  106. <div data-ax-td class="width-100">
  107. <div data-ax-td-label>내용</div>
  108. <div data-ax-td-wrap>
  109. <textarea class="form-control" name="cmt_content" data-autosize required placeholder="댓글 내용 입력"></textarea>
  110. </div>
  111. <button class="btn btn-primary btn-comment" style="margin:7px;"><i class="fal fa-reply"></i> 댓글 등록</button>
  112. </div>
  113. </div>
  114. </div>
  115. <?=form_close()?>
  116. <ul class="comment-list">
  117. <?php foreach($comments['list'] as $cmt) :?>
  118. <li class="comment-depth-<?=strlen($cmt['cmt_reply'])?>">
  119. <h4 class=""><?=$cmt['cmt_nickname']?> <small><?=$cmt['cmt_datetime']?></small></h4>
  120. <div class="content" data-container="container-comment-content">
  121. <?php
  122. if( $cmt['cmt_status'] == 'Y' ) :
  123. echo display_html_content($cmt['cmt_content'],600);
  124. elseif ( $cmt['cmt_status'] == 'B' ):
  125. echo '<p class="alert alert-danger">관리자에 의해서 블라인드 된 댓글입니다.</p>';
  126. else :
  127. echo '<p class="alert alert-danger">삭제된 댓글입니다.</p>';
  128. endif;
  129. ?>
  130. </div>
  131. <div class="comment-action MT10">
  132. <button type="button" class="btn btn-default btn-xs MR5" onclick="$(this).parents('li').find('.comment-reply-form').slideToggle('fast');">대댓글</button>
  133. <button type="button" class="btn btn-default btn-xs MR5" onclick="APP.BOARD.COMMENT.modify('<?=$cmt['cmt_idx']?>')">수정</button>
  134. <a class="btn btn-danger btn-xs" onclick="return confirm('댓글을 삭제하시겠습니까?');" href="<?=$cmt['link']['delete']?>">삭제</a>
  135. </div>
  136. <div class="comment-reply-form MT10" style="display:none;">
  137. <div class="comment-write">
  138. <h4>댓글 입력</h4>
  139. <?=form_open("admin/board/comment/{$board['brd_key']}/{$view['post_idx']}", array("data-form"=>"board-comment"))?>
  140. <input type="hidden" name="cmt_idx" value="">
  141. <input type="hidden" name="cmt_parent" value="<?=$cmt['cmt_idx']?>">
  142. <input type="hidden" name="reurl" value="<?=current_full_url()?>">
  143. <input type="hidden" name="cmt_nickname" value="<?=$this->member->info('nickname')?>">
  144. <div class="comment-write-inputs">
  145. <textarea class="form-control" name="cmt_content" data-autosize required placeholder="댓글 내용 입력"></textarea>
  146. <button class="btn btn-primary W200">대댓글 등록</button>
  147. </div>
  148. <?=form_close()?>
  149. </div>
  150. </div>
  151. </li>
  152. <?php endforeach;?>
  153. <?php if( count($comments['list']) == 0 ):?>
  154. <p class="empty" style="padding:15px; text-align:center;">작성된 댓글이 없습니다.</p>
  155. <?php endif;?>
  156. </ul>
  157. <?php endif;?>
  158. </div>
  159. <style>
  160. .comment-list {margin:0; padding:0; list-style:none;}
  161. .comment-list li { position: relative; padding: 5px 15px; border-top: 1px solid #eceff3; background: #f5f8f9;color: #000;word-break: break-all;}
  162. .comment-write-inputs { display:flex;}
  163. .comment-list li.comment-depth-0 {padding-left:15px;}
  164. .comment-list li.comment-depth-1 {padding-left:50px;}
  165. .comment-list li.comment-depth-2 {padding-left:85px;}
  166. .comment-list li.comment-depth-3 {padding-left:120px;}
  167. .comment-list li.comment-depth-4 {padding-left:155px;}
  168. .comment-list li.comment-depth-5 {padding-left:190px;}
  169. </style>
  170. <script>
  171. $(function(){
  172. $('[data-button="btn-remove-posts"]').click(function(e){
  173. var arr = ['<?=$view['post_idx']?>'];
  174. if(! confirm( '현재글을 삭제하시겠습니까?' ))
  175. return;
  176. $.ajax({
  177. url : '/ajax/board/posts',
  178. type : 'DELETE',
  179. data : {
  180. post_idx :arr
  181. },
  182. success:function(){
  183. location.href = "<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>";
  184. }
  185. })
  186. });
  187. });
  188. </script>