@using LyricsFinder.NET.Areas.Identity.Models;
@model List<UserRolesView>
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>User Roles</h2>

<table class="table table-bordered table-striped m-md-0">
    <thead>
        <tr>
            <th>User ID</th>
            <th>Name</th>
            <th>Date of Birth</th>
            <th>Email</th>
            <th>Email Confirmed?</th>
            <th>Roles</th>
            <th style="text-align:center">Action</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var user in Model)
        {
            <tr>
                <td width="15%">@user.Id</td>
                <td width="10%">@user.Name</td>
                <td width="10%">@user.DOB.ToShortDateString()</td>
                <td width="25%">@user.Email</td>
                <td width="5%">@user.EmailConfirmed</td>
                <td width="10%">@string.Join(", ", user.Roles.ToList())</td>
                <td width="25%">

                    <a class="btn btn-primary btn-sm" asp-controller="RoleManager" asp-action="Manage" asp-route-userId="@user.Id">Manage Roles</a>
                    <a class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete this?')" asp-controller="RoleManager" asp-action="DeleteUser" asp-route-userId="@user.Id">Delete User</a>

                </td>
            </tr>
        }
    </tbody>
</table>

<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>