post.blade.php 5.0 KB

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