diff --git a/WebInterface/Controllers/ChannelsController.cs b/WebInterface/Controllers/ChannelsController.cs index 8f99e2e..fb63581 100644 --- a/WebInterface/Controllers/ChannelsController.cs +++ b/WebInterface/Controllers/ChannelsController.cs @@ -24,9 +24,17 @@ public class ChannelsController : Controller } public async Task Details(Guid id) { - return _db.Channels != null ? - View(await _db.Channels.Include(u => u.ParentChannel).FirstAsync(u => u.Id == id)) : - Problem("Entity set '_db.Channels' is null."); + if(_db.Channels == null) + return Problem("Entity set '_db.Channels' is null."); + var channel = await _db.Channels.Include(u => u.ParentChannel).FirstAsync(u => u.Id == id); + var walker = channel; + while(walker != null) + { + ViewData["breadcrumbs"] = $"{walker.DisplayName}/" + + ViewData["breadcrumbs"]; + walker = walker.ParentChannel; + } + return View(channel); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] diff --git a/WebInterface/Controllers/HomeController.cs b/WebInterface/Controllers/HomeController.cs index afdf564..b3d8646 100644 --- a/WebInterface/Controllers/HomeController.cs +++ b/WebInterface/Controllers/HomeController.cs @@ -67,7 +67,7 @@ public class HomeController : Controller } if (allAccounts.Any()) { - sb.Append("{text: \"channelless accounts\", nodes: ["); + sb.Append("{text: \"channelless accounts\", nodes: ["); first = true; foreach (var acc in allAccounts) { @@ -115,7 +115,8 @@ public class HomeController : Controller private void serializeChannel(ref StringBuilder sb, ref List allChannels, ref List allAccounts, Channel currentChannel) { allChannels.Remove(currentChannel); - sb.Append($"{{\"text\": \"{currentChannel.DisplayName}\""); + //"but adam", you say, "there's an href attribute, why make a link?" because that makes the entire bar a link, and trying to expand the node will probably click the link + sb.Append($"{{\"text\": \"{currentChannel.DisplayName}\""); var theseAccounts = allAccounts.Where(a => a.SeenInChannel?.Id == currentChannel.Id); allAccounts.RemoveAll(a => a.SeenInChannel?.Id == currentChannel.Id); var first = true; diff --git a/WebInterface/Views/Channels/Details.cshtml b/WebInterface/Views/Channels/Details.cshtml new file mode 100644 index 0000000..2bac39f --- /dev/null +++ b/WebInterface/Views/Channels/Details.cshtml @@ -0,0 +1,60 @@ +@model Channel + +@Html.Raw(ViewData["breadcrumbs"]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Display Name@Model.DisplayName
Channel type@Model.ChannelType
Lewdness Filter Level@Model.LewdnessFilterLevel
Links Allowed@Model.LinksAllowed
Lineage summary@Model.LineageSummary
max attachment bytes@Model.MaxAttachmentBytes (i hear there's "ByteSize")
max message length@Model.MaxTextChars
Meanness Filter Level@Model.MeannessFilterLevel
Messages (count)@(Model.Messages?.Count ?? 0)
Protocol@Model.Protocol
Reactions Possible@Model.ReactionsPossible
Sub Channels@Model.SubChannels
Users@Model.Users