forked from adam/discord-bot-shtik
i forget the opposite of @{}
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
This commit is contained in:
parent
8b857b82c9
commit
c0cfa90874
@ -1,5 +1,6 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Text;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using vassago.Models;
|
using vassago.Models;
|
||||||
@ -44,6 +45,25 @@ public class ChannelsController : Controller
|
|||||||
ViewData["breadcrumbs"];
|
ViewData["breadcrumbs"];
|
||||||
walker = walker.ParentChannel;
|
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\": \"<a href=\\\"{Url.ActionLink(action: "Details", controller: "Channels", values: new {id = subChannel.Id})}\\\">{subChannel.DisplayName}</a>\"");
|
||||||
|
}
|
||||||
|
sb.Append("]");
|
||||||
|
|
||||||
|
ViewData.Add("channelsTree", sb.ToString());
|
||||||
return View(
|
return View(
|
||||||
new Tuple<Channel, Enumerations.LewdnessFilterLevel, Enumerations.MeannessFilterLevel>(
|
new Tuple<Channel, Enumerations.LewdnessFilterLevel, Enumerations.MeannessFilterLevel>(
|
||||||
channel, channel.EffectivePermissions.LewdnessFilterLevel, channel.EffectivePermissions.MeannessFilterLevel
|
channel, channel.EffectivePermissions.LewdnessFilterLevel, channel.EffectivePermissions.MeannessFilterLevel
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
var IfInheritedMeannessFilterLevel = Model.Item3;
|
var IfInheritedMeannessFilterLevel = Model.Item3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<a href="/">home</a>/
|
||||||
@Html.Raw(ViewData["breadcrumbs"])
|
@Html.Raw(ViewData["breadcrumbs"])
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
@ -78,7 +78,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Sub Channels</th>
|
<th scope="row">Sub Channels</th>
|
||||||
<td>@(ThisChannel.SubChannels?.Count ?? 0)</td>
|
<td>
|
||||||
|
@if((ThisChannel.SubChannels?.Count ?? 0) > 0)
|
||||||
|
{
|
||||||
|
@Html.Raw("<div id=\"channelsTree\"></div>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@Html.Raw("0")
|
||||||
|
}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Accounts</th>
|
<th scope="row">Accounts</th>
|
||||||
@ -87,7 +96,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
@section Scripts{
|
@section Scripts{
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@{
|
@{
|
||||||
@ -109,12 +117,15 @@
|
|||||||
console.log(channelNow);
|
console.log(channelNow);
|
||||||
return channelNow;
|
return channelNow;
|
||||||
}
|
}
|
||||||
function getTree() {
|
@if((ThisChannel.SubChannels?.Count ?? 0) > 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
function channelsTree() {
|
||||||
var tree = @Html.Raw(ViewData["treeString"]);
|
var tree = @Html.Raw(ViewData["treeString"]);
|
||||||
console.log(tree);
|
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
$('#channelsTree').bstreeview({ data: channelsTree() });
|
||||||
$('#tree').bstreeview({ data: getTree() });
|
*/
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user