more user info
This commit is contained in:
parent
edc86af538
commit
77fc26e1ed
@ -20,7 +20,13 @@ public class UsersController : Controller
|
||||
{
|
||||
return _db.Users != null ?
|
||||
View(await _db.Users.Include(u => u.Accounts).ToListAsync()) :
|
||||
Problem("Entity set '_db.Users' is null.");
|
||||
Problem("Entity set '_db.Users' is null.");
|
||||
}
|
||||
public async Task<IActionResult> Details(Guid id)
|
||||
{
|
||||
return _db.Users != null ?
|
||||
View(await _db.Users.Include(u => u.Accounts).FirstAsync(u => u.Id == id)) :
|
||||
Problem("Entity set '_db.Users' is null.");
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
|
21
Views/Users/Details.cshtml
Normal file
21
Views/Users/Details.cshtml
Normal file
@ -0,0 +1,21 @@
|
||||
@model User
|
||||
@{
|
||||
ViewData["Title"] = "User details";
|
||||
}
|
||||
|
||||
User @Model.DisplayName<br />
|
||||
|
||||
<div class="permissions">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="accounts">
|
||||
@foreach (var acc in Model.Accounts)
|
||||
{
|
||||
<div class="account @acc.Protocol">
|
||||
<div class="protocol-icon"> </div>
|
||||
@Html.DisplayFor(acc => acc.DisplayName)
|
||||
<a asp-controller="Accounts" asp-action="Details" asp-route-id="@acc.Id">Details</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
@ -30,9 +30,7 @@
|
||||
@Html.DisplayFor(modelItem => item.Accounts.Count)x
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ html {
|
||||
|
||||
body {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.account .protocol-icon{
|
||||
display:inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background-size: 32px;
|
||||
}
|
||||
.account.discord .protocol-icon{
|
||||
background-image: url("../imgs/discord_logo1600.png");
|
||||
}
|
||||
.account.twitch .protocol-icon{
|
||||
background-image: url("../imgs/twitch.png");
|
||||
}
|
BIN
wwwroot/imgs/discord_logo1600.png
Normal file
BIN
wwwroot/imgs/discord_logo1600.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
wwwroot/imgs/twitch.png
Normal file
BIN
wwwroot/imgs/twitch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
Reference in New Issue
Block a user