Finished up implementing channel-based user bans.

This commit is contained in:
rainbow napkin 2024-12-01 17:18:43 -05:00
parent ef79e9941c
commit 96953979a2
19 changed files with 518 additions and 202 deletions

View file

@ -23,10 +23,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<body>
<%- include('partial/navbar', {user}); %>
<h1 class="panel-title"><%= instance %> Admin Panel</h1>
<%- include('partial/adminPanel/channelList', {chanGuide}) %>
<%- include('partial/adminPanel/userList', {user, userList, rankEnum}) %>
<%- include('partial/adminPanel/permList', {permList, rankEnum}) %>
<%- include('partial/adminPanel/userBanList') %>
<div class="admin-panel-container-div">
<%- include('partial/adminPanel/channelList', {chanGuide}) %>
<%- include('partial/adminPanel/userList', {user, userList, rankEnum}) %>
<%- include('partial/adminPanel/permList', {permList, rankEnum}) %>
<%- include('partial/adminPanel/userBanList') %>
</div>
</body>
<footer>
<%- include('partial/scripts', {user}); %>

View file

@ -24,10 +24,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<body>
<%- include('partial/navbar', {user}); %>
<h1 class="panel-title"><%- channel.name %> - Channel Settings</h1>
<%- include('partial/channelSettings/userList.ejs'); %>
<%- include('partial/channelSettings/settings.ejs'); %>
<%- include('partial/channelSettings/permList.ejs'); %>
<a href="javascript:" id="channel-delete">Delete Channel</a>
<div class="admin-panel-container-div">
<%- include('partial/channelSettings/userList.ejs'); %>
<%- include('partial/channelSettings/banList.ejs'); %>
<%- include('partial/channelSettings/settings.ejs'); %>
<%- include('partial/channelSettings/permList.ejs'); %>
</div>
<button href="javascript:" id="channel-delete">Delete Channel</button>
<footer>
<%- include('partial/scripts', {user}); %>
<script src="/js/channelSettings.js"></script>

View file

@ -27,19 +27,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<h3>Name</h3>
</td>
<td id="admin-ban-list-entry-date-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Sign-Up Date</h3>
<h3>Sign-Up<br>Date</h3>
</td>
<td id="admin-ban-list-entry-ban-date-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Ban Date</h3>
<h3>Ban<br>Date</h3>
</td>
<td id="admin-ban-list-entry-expiration-date-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Expiration Date</h3>
<h3>Expires</h3>
</td>
<td id="admin-ban-list-entry-expiration-type-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Expiration Action</h3>
<h3>Expiration<br>Action</h3>
</td>
<td id="admin-ban-list-entry-actions-type-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Actions</h3>
&nbsp;
</td>
</tr>
</table>

View file

@ -33,10 +33,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<h3>E-Mail</h3>
</td>
<td id="admin-user-list-entry-date-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Sign-Up Date</h3>
<h3>Sign-Up<br>Date</h3>
</td>
<td id="admin-user-list-entry-control-title" class="admin-list-entry admin-list-entry-title admin-list-entry-item admin-list-entry-not-first-col">
<h3>Actions</h3>
&nbsp;
</td>
</tr>
<% userList.forEach((curUser) => { %>

View file

@ -0,0 +1,34 @@
<!--Canopy - The next generation of stoner streaming software
Copyright (C) 2024 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<div class="admin-list-div">
<h3 id="channel-ban-title">Channel Bans:</h3>
<span id="new-ban-span" class="admin-list-new-span">
<input placeholder="Add Username..." id="new-ban-input" class="admin-list-new-input">
<button id="new-ban-button">Ban</button>
</span>
<table id="admin-ban-list-table" class="admin-list-table">
<tr class="admin-list-entry-title-row">
<td class="admin-list-entry-item admin-list-entry admin-list-entry-img-title"><h3>Img</h3></td>
<td id="admin-user-list-entry-id-title" class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col"><h3>ID</h3></td>
<td class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col"><h3>Name</h3></td>
<td class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col"><h3>Ban<br>Alts</h3></td>
<td id="channel-user-list-entry-ban-date-title" class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col"><h3>Ban Date</h3></td>
<td id="channel-user-list-entry-expiration-date-title" class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col"><h3>Expires</h3></td>
<td id="channel-user-list-entry-actions-title" class="admin-list-entry-item admin-list-entry admin-list-entry-not-first-col">&nbsp;</td>
</tr>
<!-- This is getting filled via AJAX since we need to refresh it when new users are added anywho. -->
</table>
</div>

View file

@ -16,8 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<div class="admin-list-div">
<h3 id="channel-rank-title">Channel Ranks:</h3>
<sup id="channel-rank-sup">Users set to default channel rank 'user' will NOT be listed below.</sup>
<span id="new-rank-span">
<input placeholder="Add Username..." id="new-rank-input">
<span id="new-rank-span" class="admin-list-new-span">
<input placeholder="Add Username..." id="new-rank-input" class="admin-list-new-input">
<select id="new-rank-select">
<%rankEnum.slice().reverse().forEach((rank)=>{ %>
<option value="<%= rank %>"><%= rank %></option>

View file

@ -0,0 +1,39 @@
<!--Canopy - The next generation of stoner streaming software
Copyright (C) 2024 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.-->
<!-- I could turn this into partials which get called by both this and userBan but that seems like a lot of work to avoid a quick copy/pase
even if I'm usually against that, sometimes you gotta break da rulez :P -->
<link rel="stylesheet" type="text/css" href="/css/popup/userBan.css">
<h3 class="popup-title">Ban NULL</h3>
<form class="ban-popup-content" action="javascript:">
<span>
<label for="ban-popup-perm">Perma-Ban:</label>
<input type="checkbox" name="ban-popup-perm" id="ban-popup-perm">
</span>
<span>
<label id="ban-popup-expiration-prefix" for="ban-popup-expiration">Ban Expires In: </label>
<input type="number" name="ban-popup-expiration" id="ban-popup-expiration" value="14">
<label fid="ban-popup-expiration-postfix" or="ban-popup-expiration"> Days</label>
</span>
<span>
<label id="ban-popup-alts-prefix" for="ban-popup-alts">Ban Alts: </label>
<input type="checkbox" name="ban-popup-alts" id="ban-popup-alts" checked>
</span>
<span id="ban-popup-button-span">
<button id="ban-popup-cancel-button">Cancel</button>
<span id="ban-popup-button-span-spacer"></span>
<button id="ban-popup-ban-button">Ban</button>
</span>
</form>