@using LyricsFinder.NET.Areas.Identity.Models;
@model List<ManageUserRolesView>
@{
    ViewData["Title"] = "Manage";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<form method="post">

    <div class="card">
        <div class="card-header">
            <h2>Manage User Roles</h2>

            Add/Remove Roles for user: <strong><i>@ViewBag.UserName</i></strong>
        </div>

        <div class="card-body">
            @for (int i = 0; i < Model.Count; i++)
            {
                <div class="form-check m-1">
                    <input type="hidden" asp-for="@Model[i].RoleId" />
                    <input type="hidden" asp-for="@Model[i].RoleName" />
                    <input asp-for="@Model[i].Selected" class="form-check-input" />
                    <label class="form-check-label" asp-for="@Model[i].Selected">
                        @Model[i].RoleName
                    </label>
                </div>
            }
            <div asp-validation-summary="All" class="text-danger"></div>
        </div>
        <div class="card-footer">
            <input type="submit" value="Update" class="btn btn-primary"
                   style="width:auto" />

            <a asp-action="DisplayUsers" asp-route-id="@ViewBag.userId"
               class="btn btn-primary" style="width:auto">Cancel</a>
        </div>
    </div>
</form>
<br />
<br />
<div class="btn-block text-center">
    <a href='javascript:history.go(-1)' class="btn btn-outline-dark text-dark">Previous Page</a>
    <a asp-controller="SongManager" asp-action="Index" class="btn btn-secondary">Back To Main Menu</a>
</div>
