Index.cshtml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @using bitforum.Helpers;
  2. @{
  3. ViewData["Title"] = "팝업 관리";
  4. var popups = ViewBag.Popups as List<bitforum.Models.Page.Popup>;
  5. var total = (popups?.Count ?? 0).ToString("N0");
  6. var pagination = ViewBag.Pagination as bitforum.Models.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" asp-controller="Popup" asp-action="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 (popups == null || !popups.Any())
  50. {
  51. <tr>
  52. <td colspan="9" class="text-center align-middle">No Data.</td>
  53. </tr>
  54. }
  55. else
  56. {
  57. @foreach (var row in popups)
  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. 사용 기한:
  68. @if (row.StartAt != null && row.EndAt != null)
  69. {
  70. <text>@row.StartAt.GetDateAt() ~ @row.EndAt.GetDateAt()</text>
  71. } @if (row.StartAt != null && row.EndAt is null)
  72. {
  73. <text>@row.StartAt.GetDateAt() ~</text>
  74. } @if (row.StartAt is null && row.EndAt != null)
  75. {
  76. <text>~ @row.EndAt.GetDateAt()</text>
  77. }
  78. else
  79. {
  80. <text>[무기한]</text>
  81. }
  82. </small>
  83. </td>
  84. <td>
  85. @if (@row.Link is not null) {
  86. <a href="@row.Link" target="_blank" rel="external">
  87. @row.Link
  88. </a>
  89. } else {
  90. <text>-</text>
  91. }
  92. </td>
  93. <td>@row.Views</td>
  94. <td>@(row.IsActive ? "Y" : "N")</td>
  95. <td>@row.CreatedAt.GetDateAt()</td>
  96. <td>@row.UpdatedAt.GetDateAt()</td>
  97. <td>
  98. <div class="d-grid gap-2 d-md-block">
  99. <a class="btn btn-sm btn-outline-info" asp-controller="Popup" asp-action="Edit" asp-route-id="@row.ID">수정</a>
  100. <a class="btn btn-sm btn-outline-danger btn-row-delete" asp-controller="Popup" asp-action="Delete" asp-route-id="@row.ID">삭제</a>
  101. </div>
  102. </td>
  103. </tr>
  104. }
  105. }
  106. </tbody>
  107. </table>
  108. <partial name="_Pagination" model="pagination" />
  109. </div>
  110. </div>