more user info

This commit is contained in:
Adam R Grey 2023-12-01 09:49:21 -05:00
parent edc86af538
commit 77fc26e1ed
6 changed files with 41 additions and 4 deletions

View File

@ -20,7 +20,13 @@ public class UsersController : Controller
{ {
return _db.Users != null ? return _db.Users != null ?
View(await _db.Users.Include(u => u.Accounts).ToListAsync()) : 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)] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

View 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">&nbsp;</div>
@Html.DisplayFor(acc => acc.DisplayName)
<a asp-controller="Accounts" asp-action="Details" asp-route-id="@acc.Id">Details</a>
</div>
}
</div>

View File

@ -30,9 +30,7 @@
@Html.DisplayFor(modelItem => item.Accounts.Count)x @Html.DisplayFor(modelItem => item.Accounts.Count)x
</td> </td>
<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="Details" asp-route-id="@item.Id">Details</a> |
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
</td> </td>
</tr> </tr>
} }

View File

@ -20,3 +20,15 @@ html {
body { body {
margin-bottom: 60px; 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");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
wwwroot/imgs/twitch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB