Curation.cshtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @page
  2. @model Admin.Pages.Crypto.CurationModel
  3. @{
  4. ViewData["Title"] = "큐레이션";
  5. }
  6. <div class="container-fluid">
  7. <h3>@ViewData["Title"]</h3>
  8. <hr />
  9. <partial name="_StatusMessage" />
  10. <div class="row g-2 align-items-end mt-2">
  11. <div class="col">
  12. Total : @Model.Total
  13. </div>
  14. <div class="col text-end">
  15. <button type="submit" id="btnSave" class="btn btn-success" form="fAdminWrite">저장</button>
  16. </div>
  17. </div>
  18. <div class="table-responsive">
  19. <form id="fAdminWrite" method="post" accept-charset="utf-8" autocomplete="off"></form>
  20. <table class="table table-striped table-bordered table-hover mt-3">
  21. <caption>
  22. 메인 페이지에 노출할 코인을 선택하고 순서를 지정하세요.<br />
  23. Featured 체크된 코인만 메인 페이지에 노출됩니다.
  24. </caption>
  25. <colgroup>
  26. <col style="width: 5%;" />
  27. <col style="width: 8%;" />
  28. <col style="width: 10%;" />
  29. <col />
  30. <col style="width: 10%;" />
  31. <col style="width: 10%;" />
  32. <col style="width: 10%;" />
  33. </colgroup>
  34. <thead>
  35. <tr class="text-center">
  36. <th>No</th>
  37. <th>로고</th>
  38. <th>심볼</th>
  39. <th>한글명</th>
  40. <th>영문명</th>
  41. <th>사용</th>
  42. <th>Featured</th>
  43. <th>순서</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @if (Model.List == null || Model.List.Count <= 0)
  48. {
  49. <tr>
  50. <td colspan="8">No Data.</td>
  51. </tr>
  52. }
  53. else
  54. {
  55. @foreach (var row in Model.List)
  56. {
  57. var index = row.Index;
  58. <tr class="@(row.IsFeatured ? "table-warning" : "")">
  59. <td class="text-center">
  60. @row.Num
  61. <input type="hidden" name="request[@index].CoinID" form="fAdminWrite" value="@row.ID" />
  62. </td>
  63. <td class="text-center">
  64. @if (!string.IsNullOrEmpty(row.LogoImage))
  65. {
  66. <img src="@row.LogoImage" alt="@row.Symbol" style="width: 24px; height: 24px;" />
  67. }
  68. </td>
  69. <td class="text-center fw-bold">@row.Symbol</td>
  70. <td>@row.KorName</td>
  71. <td>@row.EngName</td>
  72. <td class="text-center">
  73. @(row.IsActive ? "Y" : "N")
  74. </td>
  75. <td class="text-center">
  76. <div class="form-check d-flex justify-content-center">
  77. <input class="form-check-input" type="checkbox" id="request_@(index)_IsFeatured" name="request[@index].IsFeatured" checked="@row.IsFeatured" form="fAdminWrite" value="true" />
  78. </div>
  79. </td>
  80. <td>
  81. <input type="number" name="request[@index].DisplayOrder" class="form-control text-center" min="-999" max="999" form="fAdminWrite" value="@row.DisplayOrder" />
  82. </td>
  83. </tr>
  84. }
  85. }
  86. </tbody>
  87. </table>
  88. </div>
  89. </div>
  90. @section Scripts {
  91. <script>
  92. $(function() {
  93. $(document).on("click", "#btnSave", function() {
  94. if (confirm("저장 하시겠습니까?")) {
  95. let form = document.getElementById("fAdminWrite");
  96. if (form.checkValidity()) {
  97. form.submit();
  98. } else {
  99. form.reportValidity();
  100. }
  101. }
  102. return false;
  103. });
  104. });
  105. </script>
  106. }