Compare commits

..

No commits in common. "c0cfa90874cf5a3d9963793b0cff0fb80040446c" and "4c06a744109cb9b1a1052ad265d1ee95cc7a1da0" have entirely different histories.

3 changed files with 9 additions and 45 deletions

View File

@ -1,6 +1,5 @@
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;
@ -45,25 +44,6 @@ 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

View File

@ -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,16 +78,7 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Sub Channels</th> <th scope="row">Sub Channels</th>
<td> <td>@(ThisChannel.SubChannels?.Count ?? 0)</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>
@ -96,6 +87,7 @@
</tbody> </tbody>
</table> </table>
@section Scripts{ @section Scripts{
<script type="text/javascript"> <script type="text/javascript">
@{ @{
@ -117,15 +109,12 @@
console.log(channelNow); console.log(channelNow);
return channelNow; return channelNow;
} }
@if((ThisChannel.SubChannels?.Count ?? 0) > 0) function getTree() {
{
/*
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>
} }

View File

@ -24,11 +24,6 @@ case "$1" in
dotnet ef database update --connection "$connnectionstr" dotnet ef database update --connection "$connnectionstr"
;; ;;
"db-fullreset")
sudo -u postgres psql -c "drop database ${servicename}_dev;"
sudo -u postgres psql -c "delete user $servicename"
$0 "initial"
;;
*) *)
echo "Unknown command '$1', try 'initial'" echo "Unknown command '$1', try 'initial'"
;; ;;