diff --git a/WebInterface/Controllers/ChannelsController.cs b/WebInterface/Controllers/ChannelsController.cs index 9a91891..188f40d 100644 --- a/WebInterface/Controllers/ChannelsController.cs +++ b/WebInterface/Controllers/ChannelsController.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using System.Diagnostics; +using System.Text; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using vassago.Models; @@ -44,6 +45,25 @@ public class ChannelsController : Controller ViewData["breadcrumbs"]; walker = walker.ParentChannel; } + var sb = new StringBuilder(); + sb.Append("["); + sb.Append("{text: \"channels\", nodes: ["); + var first=true; + foreach(var subChannel in channel.SubChannels) + { + if(!first) + { + sb.Append(','); + } + else + { + first = false; + } + sb.Append($"{{\"text\": \"{subChannel.DisplayName}\""); + } + sb.Append("]"); + + ViewData.Add("channelsTree", sb.ToString()); return View( new Tuple( channel, channel.EffectivePermissions.LewdnessFilterLevel, channel.EffectivePermissions.MeannessFilterLevel diff --git a/WebInterface/Views/Channels/Details.cshtml b/WebInterface/Views/Channels/Details.cshtml index 442089c..df872d3 100644 --- a/WebInterface/Views/Channels/Details.cshtml +++ b/WebInterface/Views/Channels/Details.cshtml @@ -7,7 +7,7 @@ var IfInheritedMeannessFilterLevel = Model.Item3; } - +home/ @Html.Raw(ViewData["breadcrumbs"]) @@ -78,7 +78,16 @@ - + @@ -87,7 +96,6 @@
Sub Channels@(ThisChannel.SubChannels?.Count ?? 0) + @if((ThisChannel.SubChannels?.Count ?? 0) > 0) + { + @Html.Raw("
"); + } + else + { + @Html.Raw("0") + } +
Accounts
- @section Scripts{ } \ No newline at end of file