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.

140 lines
6.1 KiB

7 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"><?=$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['mem_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['post_regtime']?></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"><?=number_format($view['post_hit'])?></p></div>
  26. </div>
  27. </div>
  28. <div data-ax-tr>
  29. <div data-ax-td class="width-100">
  30. <div data-ax-td-label>게시글 링크</div>
  31. <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>
  32. </div>
  33. </div>
  34. <?php for($i=1; $i<=10; $i++):?>
  35. <?php if(element('post_ext'.$i, $view)) :?>
  36. <div data-ax-tr>
  37. <div data-ax-td class="width-100">
  38. <div data-ax-td-label>필드 <?=$i?></div>
  39. <div data-ax-td-wrap>
  40. <p class="form-control-static"><?=$view["post_ext{$i}"]?></p>
  41. </div>
  42. </div>
  43. </div>
  44. <?php endif;?>
  45. <?php endfor;?>
  46. <?php if( count($view['file']) > 0 ) :?>
  47. <div data-ax-tr>
  48. <div data-ax-td class="width-100">
  49. <div data-ax-td-label>첨부파일</div>
  50. <div data-ax-td-wrap>
  51. <ul class="list-group" style="margin-bottom:0px;">
  52. <?php foreach($view['file'] as $f) :?>
  53. <li class="list-group-item"><a href="<?=$f['link']?>"><i class="far fa-download"></i> <?=$f['att_origin']?> (<?=format_size($f['att_filesize'])?>)</a></li>
  54. <?php endforeach;?>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. <?php endif;?>
  60. <div data-ax-tr>
  61. <div data-ax-td class="width-100">
  62. <div data-ax-td-label>내용</div>
  63. <div data-ax-td-wrap>
  64. <div style="min-height:300px;line-height:1.4em">
  65. <!-- S:첨부파일중 이미지 표시 -->
  66. <?php foreach($view['file'] as $f) : if($f['att_is_image']!='Y') continue;?>
  67. <figure style="margin-bottom:10px;">
  68. <img src="<?=base_url($f['att_filename'])?>" alt="<?=$f['att_origin']?>">
  69. <figcaption class="sr-only"><?=$f['att_origin']?></figcaption>
  70. </figure>
  71. <?php endforeach;?>
  72. <!-- E:첨부파일중 이미지 표시 -->
  73. <?=display_html_content($view['post_content'])?>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="text-center MT10">
  80. <a href="<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>" class="btn btn-default">목록</a>
  81. <?php if( $board['brd_use_reply'] == 'Y' ):?>
  82. <a href="<?=base_url("admin/board/write/{$board['brd_key']}/?post_parent={$view['post_idx']}")?>" class="btn btn-default">답글</a>
  83. <?php endif;?>
  84. <a href="<?=base_url("admin/board/write/{$board['brd_key']}/{$view['post_idx']}")?>" class="btn btn-default"><i class="far fa-pencil"></i> 수정</a>
  85. <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="far fa-trash"></i> 선택 삭제</button>
  86. <?php if( $board['brd_use_assign'] == 'Y' ):?>
  87. <?php if($view['post_assign'] == 'Y') :?>
  88. <button type="button" class="btn btn-default" data-button="btn-assign" data-value="N"><i class="far fa-ban"></i> 승인 취소</button>
  89. <?php else :?>
  90. <button type="button" class="btn btn-default" data-button="btn-assign" data-value="Y"><i class="far fa-check"></i> 승인 처리</button>
  91. <?php endif;?>
  92. <?php endif;?>
  93. </div>
  94. </div>
  95. <script>
  96. $(function(){
  97. $('[data-button="btn-remove-posts"]').click(function(e){
  98. var arr = ['<?=$view['post_idx']?>'];
  99. if(! confirm( '현재글을 삭제하시겠습니까?' ))
  100. return;
  101. $.ajax({
  102. url : '/ajax/board/posts',
  103. type : 'DELETE',
  104. data : {
  105. post_idx :arr
  106. },
  107. success:function(){
  108. location.href = "<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>";
  109. }
  110. })
  111. });
  112. $('[data-button="btn-assign"]').click(function(e){
  113. var value = $(this).data('value');
  114. var message = "현재 글을 승인 처리하시겠습니까?";
  115. if( value == 'N' ) message = '현재 글을 승인 취소하시겠습니까?';
  116. if(! confirm(message)) return;
  117. $.ajax({
  118. url : '/ajax/board/assign',
  119. type:'POST',
  120. data : {
  121. post_idx : '<?=$view['post_idx']?>',
  122. post_assign : value
  123. },
  124. success:function(){
  125. location.reload();
  126. }
  127. })
  128. });
  129. });
  130. </script>