post.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. @extends('mobile.layouts.app')
  2. @section('content')
  3. <div id="accountPost" class="container">
  4. @include('mobile.account.navTabs')
  5. <h4>작성 게시글</h4>
  6. <hr/>
  7. <div class="row g-2 mb-2 align-items-center">
  8. <div class="col">
  9. <span>Total : {{ $posts->total }}</span>
  10. </div>
  11. <div class="col-auto">
  12. <button type="button" id="btnAccountPostDelete" class="btn btn-dark">선택삭제</button>
  13. </div>
  14. <div class="col-auto text-end">
  15. <select name="per_page" id="perPage" class="form-select">
  16. <option value="10" @if($params->perPage == 10) selected @endif>10개씩</option>
  17. <option value="15" @if($params->perPage == 15) selected @endif>15개씩</option>
  18. <option value="20" @if($params->perPage == 20) selected @endif>20개씩</option>
  19. <option value="30" @if($params->perPage == 30) selected @endif>30개씩</option>
  20. <option value="40" @if($params->perPage == 40) selected @endif>40개씩</option>
  21. <option value="50" @if($params->perPage == 50) selected @endif>50개씩</option>
  22. </select>
  23. </div>
  24. </div>
  25. <table class="table table-hover">
  26. <colgroup>
  27. <col style="width: 4%;"/>
  28. <col style="width: auto;"/>
  29. </colgroup>
  30. <thead>
  31. <tr>
  32. <th>
  33. <input type="checkbox" name="chk_all" id="chkAll" class="form-check-input" value="1"/>
  34. </th>
  35. <th colspan="2">게시글 내용</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @if($posts->total > 0)
  40. @foreach($posts->list as $row)
  41. <tr id="post_{{ $row->num }}">
  42. <td>
  43. <input type="checkbox" name="chk[]" class="form-check-input list-check-box" value="{{ $row->id }}"/>
  44. </td>
  45. <td>
  46. <div class="row">
  47. <div class="col col-md-10">
  48. <p>
  49. @if($row->categoryName)
  50. <label>[{{ $row->categoryName }}]</label>
  51. @endif
  52. <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" target="_self">{{ $row->subject }}</a>
  53. @if($row->is_secret)
  54. <i class="fas fa-lock"></i>
  55. @endif
  56. @if($row->comment_rows > 0)
  57. <var>[{{ $row->comment_rows }}]</var>
  58. @endif
  59. @if($row->file_rows > 0)
  60. <i class="fas fa-save"></i>
  61. @endif
  62. @if($row->link_rows > 0)
  63. <i class="fas fa-external-link-alt"></i>
  64. @endif
  65. @if($row->image_rows > 0)
  66. <i class="fas fa-image"></i>
  67. @endif
  68. </p>
  69. <ul>
  70. <li>{{ $row->user->name }}</li>
  71. <li>{{ $row->createdAt }}</li>
  72. <li>조회 {{ $row->hit }}</li>
  73. </ul>
  74. </div>
  75. @if($row->thumbnail)
  76. <div class="col-3 col-md-2 align-self-center">
  77. <div class="thumbnail">
  78. <img src="{{ $row->thumbnail }}" class="img-fluid rounded" alt="{{ $row->subject }}" onerror="this.src='{{ NO_IMAGE_NORMAL_SRC }}'"/>
  79. </div>
  80. </div>
  81. @endif
  82. </div>
  83. </td>
  84. </tr>
  85. @endforeach
  86. @else
  87. <tr>
  88. <td colspan="2" class="p-5">
  89. 작성 게시글이 없습니다.
  90. </td>
  91. </tr>
  92. @endif
  93. </tbody>
  94. </table>
  95. @if($posts->total > 0)
  96. <div class="pagination">
  97. {{ $posts->list->onEachSide($params->pageCount)->links('component.pagination') }}
  98. </div>
  99. @endif
  100. <form name="f_account_post" id="fAccountPost" method="post" action="{{ route('account.post') }}" autocomplete="off" accept-charset="UTF-8">
  101. @csrf
  102. <input type="hidden" name="per_page" value="{{ $params->perPage }}"/>
  103. </form>
  104. </div>
  105. @endsection
  106. @push('styles')
  107. <link rel="stylesheet" href="{{ asset('css/mobile/account/post.css') }}"/>
  108. @endpush
  109. @push('scripts')
  110. <script src="{{ asset('js/account/post.js') }}" defer></script>
  111. @endpush