vassago/WebInterface/Views/Channels/Details.cshtml

90 lines
2.8 KiB
Plaintext
Raw Normal View History

@using System.ComponentModel
@using Newtonsoft.Json
2024-06-02 17:13:15 -04:00
@model Channel
@Html.Raw(ViewData["breadcrumbs"])
<table class="table">
<tbody>
<tr>
<th scope="row">Display Name</th>
<td>@Model.DisplayName</td>
</tr>
<tr>
<th scope="row">Channel type</th>
<td>@(Model.ChannelType != null ? Enumerations.GetDescription(Model.ChannelType) : "?")</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Lewdness Filter Level</th>
<td>
<select name="LewdnessFilterLevel" id="LewdnessFilterLevel" onchange="postmodelupdate(jsonifyChannel())">
<!option value="" @(Model.LewdnessFilterLevel == null ? "selected" : "")>inhereted</!option>
@foreach (Enumerations.LewdnessFilterLevel enumVal in Enum.GetValues(typeof(Enumerations.LewdnessFilterLevel)))
{
<!option value="@((int)enumVal)" @(Model.LewdnessFilterLevel == enumVal ? "selected" : "")>@(Enumerations.GetDescription<Enumerations.LewdnessFilterLevel>(enumVal))</!option>
}
</select>
</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Links Allowed</th>
2024-06-09 17:37:09 -04:00
<td>@(Model.LinksAllowed?.ToString() ?? "unknown")</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Lineage summary</th>
<td>@Model.LineageSummary</td>
</tr>
<tr>
<th scope="row">max attachment bytes</th>
<td>@Model.MaxAttachmentBytes (i hear there's "ByteSize")</td>
</tr>
<tr>
<th scope="row">max message length</th>
2024-06-09 17:37:09 -04:00
<td>@(Model.MaxTextChars?.ToString() ?? "inherited")</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Meanness Filter Level</th>
<td>@(Model.MeannessFilterLevel != null ? Enumerations.GetDescription<Enumerations.MeannessFilterLevel>(Model.MeannessFilterLevel.GetValueOrDefault()) : "inherited")</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Messages (count)</th>
<td>@(Model.Messages?.Count ?? 0)</td>
</tr>
<tr>
<th scope="row">Protocol</th>
<td>@Model.Protocol</td>
</tr>
<tr>
<th scope="row">Reactions Possible</th>
2024-06-09 17:37:09 -04:00
<td>@(Model.ReactionsPossible?.ToString() ?? "inherited")</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Sub Channels</th>
2024-06-09 17:37:09 -04:00
<td>@(Model.SubChannels?.Count ?? 0)</td>
2024-06-02 17:13:15 -04:00
</tr>
<tr>
<th scope="row">Users</th>
2024-06-09 17:37:09 -04:00
<td>@(Model.Users?.Count ?? 0)</td>
2024-06-02 17:13:15 -04:00
</tr>
</tbody>
</table>
@section Scripts{
<script type="text/javascript">
@{
var modelAsString = JsonConvert.SerializeObject(Model, new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
});
}
const channelOnLoad = @Html.Raw(modelAsString);
function jsonifyChannel()
{
var channelNow = channelOnLoad;
channelNow.LewdnessFilterLevel = document.querySelector("#LewdnessFilterLevel").value;
console.log(channelNow);
return channelNow;
}
</script>
}