Curation.cshtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. <ul>
  23. <li>코인 순서는 숫자가 낮을수록 먼저 노출됩니다. (음수 허용)</li>
  24. <li>선별된 코인은 메인 페이지에 노출됩니다.</li>
  25. </ul>
  26. </caption>
  27. <colgroup>
  28. <col style="width: 5%;" />
  29. <col style="width: 8%;max-width: 128px;" />
  30. <col style="width: 10%;" />
  31. <col />
  32. <col />
  33. <col style="width: 10%;" />
  34. <col style="width: 10%;" />
  35. <col style="width: 10%;" />
  36. </colgroup>
  37. <thead>
  38. <tr>
  39. <th>No</th>
  40. <th>로고</th>
  41. <th>심볼</th>
  42. <th>한글명</th>
  43. <th>영문명</th>
  44. <th>사용</th>
  45. <th>선별</th>
  46. <th>순서</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. @if (Model.List == null || Model.List.Count <= 0)
  51. {
  52. <tr>
  53. <td colspan="8">No Data.</td>
  54. </tr>
  55. }
  56. else
  57. {
  58. @foreach (var row in Model.List)
  59. {
  60. var index = row.Index;
  61. <tr class="@(row.IsFeatured ? "table-warning" : "")">
  62. <td>
  63. @row.Num
  64. <input type="hidden" name="request[@index].CoinID" form="fAdminWrite" value="@row.ID" />
  65. </td>
  66. <td>
  67. @if (!string.IsNullOrEmpty(row.LogoImage))
  68. {
  69. <img src="@row.LogoImage" alt="@row.Symbol" style="width:64px;height:64px;object-fit:contain;" />
  70. }
  71. else
  72. {
  73. <text>-</text>
  74. }
  75. </td>
  76. <td>@row.Symbol</td>
  77. <td>@row.KorName</td>
  78. <td>@row.EngName</td>
  79. <td>@row.IsActive</td>
  80. <td>
  81. <div class="form-check d-flex justify-content-center">
  82. <input class="form-check-input" type="checkbox" id="request_@(index)_IsFeatured" name="request[@index].IsFeatured" checked="@row.IsFeatured" form="fAdminWrite" value="true" />
  83. </div>
  84. </td>
  85. <td>
  86. <input type="number" name="request[@index].DisplayOrder" class="form-control text-center" min="-999" max="999" form="fAdminWrite" value="@row.DisplayOrder" />
  87. </td>
  88. </tr>
  89. }
  90. }
  91. </tbody>
  92. </table>
  93. </div>
  94. </div>
  95. @section Scripts {
  96. <script>
  97. $(function() {
  98. $(document).on("click", "#btnSave", function() {
  99. if (confirm("저장 하시겠습니까?")) {
  100. let form = document.getElementById("fAdminWrite");
  101. if (form.checkValidity()) {
  102. form.submit();
  103. } else {
  104. form.reportValidity();
  105. }
  106. }
  107. return false;
  108. });
  109. });
  110. </script>
  111. }