diff --git a/Models/User.cs b/Models/User.cs index f856fad..bd0ed03 100644 --- a/Models/User.cs +++ b/Models/User.cs @@ -12,7 +12,7 @@ public class User public List Accounts { get; set; } //if I ever get lots and lots of tags, or some automatic way to register a feature's arbitrary tags, then I can move this off. - public bool Tag_CanTwitchSummon { get; set; } + //public bool Tag_CanTwitchSummon { get; set; } public string DisplayName { diff --git a/WebInterface/Controllers/UsersController.cs b/WebInterface/Controllers/UsersController.cs index 6847b78..ae37360 100644 --- a/WebInterface/Controllers/UsersController.cs +++ b/WebInterface/Controllers/UsersController.cs @@ -24,8 +24,16 @@ public class UsersController : Controller } public async Task Details(Guid id) { + var user = await _db.Users + .Include(u => u.Accounts) + .FirstAsync(u => u.Id == id); + var allTheChannels = await _db.Channels.ToListAsync(); + foreach(var acc in user.Accounts) + { + acc.SeenInChannel = allTheChannels.FirstOrDefault(c => c.Id == acc.SeenInChannel.Id); + } return _db.Users != null ? - View(await _db.Users.Include(u => u.Accounts).FirstAsync(u => u.Id == id)) : + View(user) : Problem("Entity set '_db.Users' is null."); } diff --git a/WebInterface/Views/Users/Details.cshtml b/WebInterface/Views/Users/Details.cshtml index 8e0a786..d127af4 100644 --- a/WebInterface/Views/Users/Details.cshtml +++ b/WebInterface/Views/Users/Details.cshtml @@ -1,4 +1,5 @@ @model User +@using Newtonsoft.Json @using System.Text @{ ViewData["Title"] = "User details"; @@ -6,39 +7,42 @@ - - + - -
Display Name@Model.DisplayName
Accounts
Permission Tags
- +placeholderlink @section Scripts{ }