@model bitforum.Models.Views.AttachViewModel

@{
    ViewData["Title"] = "권한 관리";
}

<div class="container">
    <h3>@ViewData["Title"]</h3>
    <hr/>
    <small>사용자에게 권한이 지정된 역할을 부여합니다.</small>

    <partial name="_StatusMessage" />

    <form asp-controller="Attach" asp-action="Save" method="post" accept-charset="utf-8" autocomplete="off">
        <h5>@Model.UserName</h5>
        <hr/>
         <input type="hidden" asp-for="UserID" />
            @for (int i = 0; i < Model.Roles.Count; i++)
            {
                <div class="form-check m-1">
                    <input type="hidden" asp-for="@Model.Roles[i].DisplayValue" />
                    <input asp-for="@Model.Roles[i].IsSelected" class="form-check-input" />
                    <label class="form-check-label" asp-for="@Model.Roles[i].IsSelected">
                        @Model.Roles[i].DisplayValue
                    </label>
                </div>
            }
                <div asp-validation-summary="All" class="text-danger"></div>
        <hr/>
        <button type="submit" class="btn btn-sm btn-success">저장</button>
        <a asp-controller="User" asp-action="Index" class="btn btn-sm btn-secondary">취소</a>
    </form>
</div>