Some experiments on a Codeberg moderation frontend https://codeberg-moderation.xeo.plg.splvs.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

123 lines
4.9 KiB

<!doctype html>
<html class="codeberg-design">
<head>
<link rel="icon" href="https://design.codeberg.org/logo-kit/favicon.ico" type="image/x-icon" />
<link rel="icon" href="https://design.codeberg.org/logo-kit/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="https://design.codeberg.org/logo-kit/apple-touch-icon.png" />
<link rel="stylesheet" href="https://design.codeberg.org/design-kit/codeberg.css" />
<link rel="stylesheet" href="./css/index.css" />
<script defer src="https://design.codeberg.org/design-kit/codeberg.js"></script>
<script defer type="module" src="https://design.codeberg.org/components/codeberg-components.js"></script>
<script defer src="./js/index.js"></script>
<script defer src="./js/auth.js"></script>
<script defer src="./js/render.js"></script>
<script defer src="./js/user.js"></script>
<script defer src="./js/repo.js"></script>
<link href="https://fonts.codeberg.org/dist/inter/Inter%20Web/inter.css" rel="stylesheet" />
<link href="https://fonts.codeberg.org/dist/fontawesome5/css/all.min.css" rel="stylesheet" />
</head>
<body>
<div class="page-wrapper with-navbar with-sidebar">
<nav class="navbar">
<div class="navbar-content">
<button class="btn btn-primary" type="button" onclick="halfmoon.toggleSidebar()">
<i class="fa fa-bars" aria-hidden="true"></i>
<span class="sr-only">Toggle sidebar</span> <!-- sr-only = show only on screen readers -->
</button>
</div>
<a href="/" class="navbar-brand" title="Codeberg Moderation tool thingy">
<img src="https://design.codeberg.org/logo-kit/icon_inverted.svg" alt="Codeberg">
Moderation
</a>
<!-- NAVIGATION -->
<ul class="navbar-nav">
<li class="nav-item active">
<a href="" class="nav-link">Dashboard</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Reports</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Recent Actions</a>
</li>
</ul>
<!-- SETTINGS -->
<div id="cb-auth">
<button id="cb-auth-login" class="btn">LOGIN!</button>
</div>
<a id="login-button" class="btn" href="/authorize">OAUTH Login</a>
</nav>
<!-- SIDEBAR -->
<div class="sidebar">
<div class="sidebar-menu">
<h5 class="sidebar-title">User</h5>
<a href="#cb-function" id="cb-sb-user-action" class="sidebar-link">Actions</a>
<a href="#cb-function" id="cb-sb-user-info" class="sidebar-link">Information</a>
<a href="#cb-function" id="cb-sb-user-inspect" class="sidebar-link">Inspect</a>
<div class="sidebar-divider"></div>
<h5 class="sidebar-title">Repo</h5>
<a href="#" id="cb-sb-repo-action" class="sidebar-link">Actions</a>
</div>
</div>
<!-- USER INPUT -->
<div class="content-wrapper">
<div class="container-fluid">
<div class="content">
<div id="cb-input" class="form-group">
<h2>Input</h2>
<textarea id="cb-input-list" class="form-control"></textarea><br />
<button class="btn btn-primary" onclick="resetList(input)">Reset List</button>
<div id="cb-input-rendered"></div>
<h2>Actions</h2>
<input type="text" id="cb-input-informuserreason" placeholder="Reason" class="form-control"><br />
<input type="text" id="cb-input-internalcomment" placeholder="Internal comment" class="form-control"><br />
<div class="custom-switch">
<input type="checkbox" checked id="cb-input-expandforks">
<label for="cb-input-expandforks">Expand forks</label>
</div><br />
<div class="custom-switch">
<input type="checkbox" checked id="cb-input-informuser">
<label for="cb-input-informuser">Inform users</label>
</div><br />
<div id="cb-function"></div>
<h2>Result</h2>
<button class="btn btn-primary" onclick="takeList(output)">Take List</button>
<div id="cb-output-rendered"></div>
<textarea id="cb-output-list"></textarea>
</div>
</div>
</div>
</div>
<!-- FUNCTIONS -->
<div style="display:none;">
<div id="cb-fn-user-action">
<button onclick="userDisableLogin();" class="btn">Disable</button>
<button onclick="callBackend('/users/delete', userDeleteErrors, {inputType: 'users'});" class="btn">Remove</button>
</div>
<div id="cb-fn-user-info">
<button onclick="userListRepos();" class="btn">List Repos</button>
<button onclick="callBackend('/users/list', userList)" class="btn">List Users</button>
</div>
<div id="cb-fn-user-inspect">
<button onclick="callBackend('/users/list/suspicious', userList);" class="btn">Find suspicious users</button>
</div>
<div id="cb-fn-repo-action">
<button onclick="callBackend('/repos/inform', undefined, {inputType: 'repos'});" class="btn">Inform Owners</button>
<button onclick="callBackend('/repos/quarantine', undefined, {inputType: 'repos'});" class="btn">Quarantine Repos</button>
</div>
</div>
</div>
</body>
</html>