0
0
MyDarling/Views/Account/List.cshtml
2023-03-06 07:41:35 +03:00

54 lines
1.7 KiB
Plaintext

@using Microsoft.AspNetCore.Identity
@model IQueryable<IdentityUser>
<!DOCTYPE html>
<html>
<head>
<title>Users</title>
<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="m-2">
<h5 class="bg-info text-white text-center p-2">User Administration</h5>
<table class="table table-sm table-bordered">
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th></th>
</tr>
@if (Model.Count() == 0)
{
<tr>
<td colspan="4" class="text-center">No User Accounts</td>
</tr>
}
else
{
foreach (IdentityUser user in Model)
{
<tr>
<td>@user.Id</td>
<td>@user.UserName</td>
<td>@user.Email</td>
<td class="text-center">
<form asp-page="List" method="post">
<input type="hidden" name="Id" value="@user.Id" />
<a class="btn btn-sm btn-warning" asp-page="Editor" asp-route-id="@user.Id"
asp-route-mode="edit">Edit</a>
<button type="submit" class="btn btn-sm btn-danger">
Delete
</button>
</form>
</td>
</tr>
}
}
</table>
<a class="btn btn-primary" asp-page="create">Create</a>
</div>
</body>
</html>