Index.cshtml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. @using bitforum.Helpers;
  2. @{
  3. ViewData["Title"] = "팝업 관리";
  4. var data = ViewBag.Data as IEnumerable<dynamic>;
  5. var total = ViewBag.Total.ToString("N0");
  6. var pagination = ViewBag.Pagination as Pagination;
  7. }
  8. <div class="container-fluid">
  9. <h3>@ViewData["Title"]</h3>
  10. <hr />
  11. <partial name="_StatusMessage" />
  12. <div class="row g-2 align-items-end">
  13. <div class="col">
  14. Total : @total
  15. </div>
  16. <div class="col text-end">
  17. <button type="button" id="btnListDelete" class="btn btn-sm btn-danger" form="fAdminList" data-action="/Page/Popup/Delete">삭제</button>
  18. <a class="btn btn-sm btn-success" href="/Page/Popup/Write">추가</a>
  19. </div>
  20. </div>
  21. <form name="f_admin_list" id="fAdminList" method="post" accept-charset="utf-8" autocomplete="off"></form>
  22. <div class="table-responsive">
  23. <table class="table table-striped table-bordered table-hover mt-3">
  24. <colgroup>
  25. <col width="2%"/>
  26. <col width="5%"/>
  27. <col width="*"/>
  28. <col width="*"/>
  29. <col width="10%"/>
  30. <col width="10%"/>
  31. <col width="9%"/>
  32. <col width="9%"/>
  33. <col width="8%"/>
  34. </colgroup>
  35. <thead>
  36. <tr>
  37. <th><input type="checkbox" id="checkedAll" class="form-check-input" value="1" form="fAdminList" /></th>
  38. <th>ID</th>
  39. <th>제목</th>
  40. <th>주소</th>
  41. <th>조회 수</th>
  42. <th>사용 여부</th>
  43. <th>등록일시</th>
  44. <th>수정일시</th>
  45. <th>비고</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. @if (data == null || !data.Any())
  50. {
  51. <tr>
  52. <td colspan="9">No Data.</td>
  53. </tr>
  54. }
  55. else
  56. {
  57. @foreach (var row in data)
  58. {
  59. <tr>
  60. <td>
  61. <input type="checkbox" name="ids[]" class="form-check-input list-check-box" value="@row.ID" form="fAdminList" />
  62. </td>
  63. <td>@row.ID</td>
  64. <td>
  65. <strong>@row.Subject</strong><br/>
  66. <small>
  67. 사용 기한:@row.Expired
  68. </small>
  69. </td>
  70. <td>
  71. @if (row.Link is not null) {
  72. <a href="@row.Link" target="_blank" rel="external">
  73. @row.Link
  74. </a>
  75. } else {
  76. <text>-</text>
  77. }
  78. </td>
  79. <td>@row.Views</td>
  80. <td>@row.IsActive</td>
  81. <td>@row.CreatedAt</td>
  82. <td>@row.UpdatedAt</td>
  83. <td>
  84. <div class="d-grid gap-2 d-block d-xxl-inline">
  85. <a class="btn btn-sm btn-outline-info" href="@row.EditURL">수정</a>
  86. <a class="btn btn-sm btn-outline-danger btn-row-delete" href="@row.DeleteURL">삭제</a>
  87. </div>
  88. </td>
  89. </tr>
  90. }
  91. }
  92. </tbody>
  93. </table>
  94. <partial name="_Pagination" model="pagination" />
  95. </div>
  96. </div>