Index.cshtml 2.4 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 class="text-center">
  22. <th>User</th>
  23. <th>Role</th>
  24. <th>Actions</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. @if (Model == null || !Model.Any())
  29. {
  30. <tr>
  31. <td colspan="3" class="text-center align-middle">No Data.</td>
  32. </tr>
  33. }
  34. else
  35. {
  36. @foreach (var user in Model)
  37. {
  38. <tr class="text-center align-middle">
  39. <td>
  40. @user.Name<br />
  41. @user.Email<br />
  42. <small>(@user.ID)</small>
  43. </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>