Index.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @model List<bitforum.Models.Views.UserViewModel>
  2. @{
  3. ViewData["Title"] = "권한 관리";
  4. }
  5. <div id="directorUser" class="container">
  6. <h3>@ViewData["Title"]</h3>
  7. <hr />
  8. <partial name="_StatusMessage" />
  9. <small>관리자 가입 회원들입니다. 메뉴 접근 권한을 관리할 수 있습니다.</small>
  10. <div class="row g-2">
  11. <div class="col align-self-end">
  12. Total : @Model.Count.ToString("N0")
  13. </div>
  14. <div class="col text-end">
  15. <a class="btn btn-sm btn-primary" asp-controller="Role" asp-action="Index">역할 관리</a>
  16. </div>
  17. </div>
  18. <div class="table-responsive">
  19. <table class="table table-striped table-bordered table-hover mt-3">
  20. <thead>
  21. <tr>
  22. <th>ID</th>
  23. <th>Mail</th>
  24. <th>Name</th>
  25. <th>Role</th>
  26. <th>Actions</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. @if (Model == null || !Model.Any())
  31. {
  32. <tr>
  33. <td colspan="6">No Data.</td>
  34. </tr>
  35. }
  36. else
  37. {
  38. @foreach (var user in Model)
  39. {
  40. <tr>
  41. <td>@user.ID</td>
  42. <td>@user.Email</td>
  43. <td>@user.Name</td>
  44. <td>
  45. @if (user.Roles.Any())
  46. {
  47. @string.Join(", ", user.Roles)
  48. }
  49. else
  50. {
  51. <span>역할 없음</span>
  52. }
  53. </td>
  54. <td>
  55. <a class="btn btn-sm btn-info text-white" asp-controller="User" asp-action="Edit" asp-route-userId="@user.ID">수정</a>
  56. <a class="btn btn-sm btn-danger" asp-controller="Attach" asp-action="Index" asp-route-userId="@user.ID">권한</a>
  57. </td>
  58. </tr>
  59. }
  60. }
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>