recently.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @extends('desktop.layouts.app')
  2. @section('content')
  3. <div id="board" class="container">
  4. <div class="row">
  5. <div class="col align-self-end">
  6. <h5 class="board-name">최신글 보기</h5>
  7. </div>
  8. <div class="col align-self-center text-end">
  9. </div>
  10. </div>
  11. <hr/>
  12. <div id="boardList">
  13. {{-- 검색 --}}
  14. <div class="search">
  15. <div class="row">
  16. <div class="col">
  17. <form name="f_board_search" id="fBoardSearch" method="get" action="{{ $listURL }}" autocomplete="off" accept-charset="UTF-8">
  18. <input type="hidden" name="page" value="{{ $params->page }}"/>
  19. <input type="hidden" name="per_page" value="{{ $params->perPage }}"/>
  20. <input type="hidden" name="sort" value="{{ $params->sort }}"/>
  21. <div class="row g-2 justify-content-center">
  22. <div class="col-auto">
  23. <select name="field" id="field" class="form-select">
  24. <option value="1" @if($params->field == '1') selected @endif>제목 + 내용</option>
  25. <option value="2" @if($params->field == '2') selected @endif>제목</option>
  26. <option value="3" @if($params->field == '3') selected @endif>글 작성자</option>
  27. <option value="4" @if($params->field == '4') selected @endif>댓글 내용</option>
  28. <option value="5" @if($params->field == '5') selected @endif>댓글 작성자</option>
  29. </select>
  30. </div>
  31. <div class="col-auto">
  32. <input type="text" name="keyword" id="keyword" class="form-control" value="{{ $params->keyword }}"/>
  33. </div>
  34. <div class="col-auto">
  35. <button type="submit" class="btn btn-dark">검색</button>
  36. </div>
  37. </div>
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="body">
  43. <table class="table">
  44. <caption>
  45. <div class="row">
  46. <div class="col-auto align-self-center">
  47. <span>전체 : {{ $recent->total }}개</span>
  48. </div>
  49. <div class="col text-end">
  50. <select name="per_page" id="perPage" class="form-select">
  51. <option value="10" @if($params->perPage == 10) selected @endif>10개씩</option>
  52. <option value="15" @if($params->perPage == 15) selected @endif>15개씩</option>
  53. <option value="20" @if($params->perPage == 20) selected @endif>20개씩</option>
  54. <option value="30" @if($params->perPage == 30) selected @endif>30개씩</option>
  55. <option value="40" @if($params->perPage == 40) selected @endif>40개씩</option>
  56. <option value="50" @if($params->perPage == 50) selected @endif>50개씩</option>
  57. </select>
  58. </div>
  59. </div>
  60. </caption>
  61. <colgroup>
  62. <col width="6%"/>
  63. <col width="*"/>
  64. <col width="14%"/>
  65. <col width="14%"/>
  66. <col width="8%"/>
  67. <col width="8%"/>
  68. </colgroup>
  69. <thead>
  70. <tr>
  71. <th>번호</th>
  72. <th>제목</th>
  73. <th>작성자</th>
  74. <th>작성일</th>
  75. <th>조회</th>
  76. <th>추천</th>
  77. </tr>
  78. </thead>
  79. <tbody>
  80. {{-- 최신 게시글 --}}
  81. @if($recent->total > 0)
  82. @foreach($recent->list as $row)
  83. <tr>
  84. <td>{{ $row->num }}</td>
  85. <td class="text-start">
  86. @if($row->categoryName)
  87. <label>
  88. <a href="{{ $listURL }}?category={{ $row->board_category_id }}" rel="search">
  89. [{{ $row->categoryName }}]
  90. </a>
  91. </label>
  92. @endif
  93. @if($row->is_secret)
  94. <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" target="_self">
  95. <i class="fas fa-lock"></i> 비밀글입니다.
  96. </a>
  97. @elseif($row->isBlame)
  98. <i class="fas fa-ban"></i> <del>{{ $row->subject }}</del>
  99. @else
  100. <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" target="_self">{{ $row->subject }}</a>
  101. @endif
  102. @if($row->comment_rows > 0)
  103. <var>[{{ $row->comment_rows }}]</var>
  104. @endif
  105. @if($row->file_rows > 0)
  106. <i class="fas fa-save"></i>
  107. @endif
  108. @if($row->link_rows > 0)
  109. <i class="fas fa-external-link-alt"></i>
  110. @endif
  111. @if($row->image_rows > 0)
  112. <i class="fas fa-image"></i>
  113. @endif
  114. @if($row->isNew)
  115. <span class="badge bg-warning text-dark">New</span>
  116. @endif
  117. @if($row->isHot)
  118. <span class="badge bg-danger">Hot</span>
  119. @endif
  120. </td>
  121. <td>{{ $row->user->name }}</td>
  122. <td>{{ $row->createdAt }}</td>
  123. <td>{{ $row->hit }}</td>
  124. <td>{{ $row->like }}</td>
  125. </tr>
  126. @endforeach
  127. @else
  128. <tr>
  129. <td colspan="6" class="p-5">
  130. 최신 글이 존재하지 않습니다.
  131. </td>
  132. </tr>
  133. @endif
  134. </tbody>
  135. @if($recent->total > 0)
  136. <tfoot>
  137. <tr>
  138. <td colspan="6">
  139. {{ $recent->list->onEachSide($params->pageCount)->links('desktop.board.component.pagination') }}
  140. </td>
  141. </tr>
  142. </tfoot>
  143. @endif
  144. </table>
  145. </div>
  146. </div>
  147. </div>
  148. @endsection
  149. @push('styles')
  150. <link rel="stylesheet" href="{{ asset('css/desktop/board/index.css') }}"/>
  151. @endpush
  152. @push('scripts')
  153. <script src="{{ asset('js/board/index.js') }}" defer></script>
  154. @endpush