JaBa/dashboard/views/manager/guild.ejs

363 lines
15 KiB
Text
Raw Normal View History

2021-12-10 21:39:54 +05:00
<!DOCTYPE html>
<html>
2021-12-24 20:52:27 +05:00
<%- include("../includes/head") %>
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<body class="hold-transition skin-red sidebar-mini">
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<div class="wrapper">
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<!-- The header is the topbar -->
2021-12-24 20:52:27 +05:00
<%- include("../includes/header") %>
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<!-- The sidebar includes the menu -->
2021-12-24 20:52:27 +05:00
<%- include("../includes/sidebar") %>
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<!-- Content Header (Page header) -->
<section class="content-header">
<h1> <%= translate("common:CONFIGURATION") %> <small> Dashboard v1.0 </small> </h1>
<ol class="breadcrumb">
<li><a href="/"><i class="fa fa-home"></i> <%= translate("dashboard:SELECTOR") %></a></li>
<li class="active"><%= guild.name %></li>
</ol>
</section>
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="box box-widget widget-user">
<div class="widget-user-header bg-aqua-active">
<h3 class="widget-user-username"><%= guild.name %></h3>
</div>
<div class="widget-user-image">
<img class="img-circle" src="<%= guild.iconURL %>" alt="Server icon">
</div>
<div class="box-footer">
<div class="row">
<div class="col-sm-12 border-right">
<div class="description-block">
<h5 class="description-header"><%= guild.memberCount %></h5>
<span class="description-text"><%= translate("common:MEMBERS") %></span>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.description-block -->
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.col -->
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.row -->
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.box-footer -->
</div>
<!-- BASIC CONFIGURATION -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"><%= translate("dashboard:BASIC_CONF") %></h3>
</div>
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- text input -->
<div class="form-group">
<label><%= translate("common:PREFIX") %></label>
<input type="text" name="prefix" class="form-control"
placeholder="<%= guild.prefix %>">
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- select -->
<div class="form-group">
<label><%= translate("common:LANGUAGE") %></label>
<select class="form-control" name="language">
<% bot.languages.forEach((language) => { %>
<% if(guild.language === language.name) { %>
<option selected="selected"><%= language.aliases[0] %></option>
<% } else { %>
<option><%= language.aliases[0] %></options>
<% } %>
<% }) %>
</select>
2021-12-14 23:23:55 +05:00
</div>
</div>
2021-12-16 23:42:58 +05:00
<!-- /.box-body -->
<div class="box-footer">
<button type="submit"
class="btn btn-primary"><%= translate("common:UPDATE") %></button>
</div>
</form>
</div>
<!-- /.box -->
<!-- SPECIAL CHANNELS -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"><%= translate("dashboard:CHANNELS_CONF") %></h3>
</div>
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- select -->
<div class="form-group">
2021-12-30 02:03:21 +05:00
<label><%= translate("common:SUGGESTIONS") %></label>
<select class="form-control" name="suggestions">
<% if(guild.plugins.suggestions && bot.channels.cache.has(guild.plugins.suggestions)) { %>
<option selected="selected">
2021-12-30 02:03:21 +05:00
#<%= bot.channels.cache.get(guild.plugins.suggestions).name %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.suggestions).forEach((ch) => { %>
<option>#<%= ch.name %></option>
<% }); %>
<option><%= translate("common:NO_CHANNEL") %></option>
<% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %>
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
</div>
2021-12-16 23:42:58 +05:00
<div class="form-group">
2021-12-30 02:03:21 +05:00
<label><%= translate("common:REPORTS") %></label>
<select class="form-control" name="reports">
<% if(guild.plugins.reports && bot.channels.cache.has(guild.plugins.reports)) { %>
2021-12-16 23:42:58 +05:00
<option selected="selected">
2021-12-30 02:03:21 +05:00
#<%= bot.channels.cache.get(guild.plugins.reports).name %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.reports).forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<option><%= translate("common:NO_CHANNEL") %></option>
<% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<div class="form-group">
<label><%= translate("common:MODLOGS") %></label>
<select class="form-control" name="modlogs">
<% if(guild.plugins.modlogs && bot.channels.cache.has(guild.plugins.modlogs)) { %>
<option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.modlogs).name %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.modlogs).forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<option><%= translate("common:NO_CHANNEL") %></option>
<% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL")%></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
</div>
2021-12-30 01:02:12 +05:00
<div class="form-group">
<label><%= translate("common:BIRTHDAYS") %></label>
<select class="form-control" name="birthdays">
<% if(guild.plugins.birthdays && bot.channels.cache.has(guild.plugins.birthdays)) { %>
<option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.birthdays).name %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.birthdays).forEach((ch) => { %>
2021-12-30 01:02:12 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<option><%= translate("common:NO_CHANNEL") %></option>
<% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-30 01:02:12 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
</div>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.box-body -->
<div class="box-footer">
<button type="submit"
class="btn btn-primary"><%= translate("common:UPDATE") %></button>
</div>
</form>
</div>
<!-- /.box -->
</div>
<div class="col-md-6">
<!-- WELCOME CONFIGURATION -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><%= translate("dashboard:WELCOME_CONF") %></h3>
</div>
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- text input -->
<div class="form-group">
<label><%= translate("common:MESSAGE") %></label>
<textarea rows="3" name="message" class="form-control"
required><%= (guild.plugins.welcome.message || translate("administration/welcome:DEFAULT_MESSAGE")) %></textarea>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- select -->
<div class="form-group">
<label><%= translate("common:CHANNEL") %></label>
<select class="form-control" name="channel">
<% if(guild.plugins.welcome.enabled && bot.channels.cache.has(guild.plugins.welcome.channel)) { %>
<option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.welcome.channel).name %>
</option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.id !== guild.plugins.welcome.channel && ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); } else { %>
<option selected="selected">
2022-01-03 23:20:33 +05:00
#<%= guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").first().name %>
2021-12-16 23:42:58 +05:00
</option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.id !== guild.channels.cache.first().id && ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- select -->
<div class="form-group">
<div class="checkbox">
<label>
<% if(guild.plugins.welcome.withImage || !guild.plugins.welcome.enabled) { %>
<input type="checkbox" name="withImage"
checked><%= translate("dashboard:WELCOME_IMG") %>
<% } else { %>
<input type="checkbox"
name="withImage"><%= translate("dashboard:WELCOME_IMG") %>
2021-12-14 23:23:55 +05:00
<% } %>
2021-12-16 23:42:58 +05:00
</label>
2021-12-14 23:23:55 +05:00
</div>
</div>
</div>
2021-12-16 23:42:58 +05:00
<!-- /.box-body -->
<div class="box-footer">
<% if(guild.plugins.welcome.enabled) { %>
<button type="submit" name="welcomeDisable"
class="btn btn-danger"><%= translate("dashboard:DISABLE_MESSAGES") %></button>
<button type="submit" name="welcomeUpdate"
class="btn btn-primary pull-right"><%= translate("common:UPDATE") %></button>
<% } else { %>
<button type="submit" name="welcomeEnable"
class="btn btn-success"><%= translate("dashboard:ENABLE_MESSAGES") %></button>
<% } %>
</div>
</form>
</div>
<!-- GOODBYE CONFIGURATION -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><%= translate("dashboard:GOODBYE_CONF") %></h3>
</div>
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- text input -->
<div class="form-group">
<label><%= translate("common:MESSAGE") %></label>
<textarea rows="3" name="message" class="form-control"
required><%= (guild.plugins.goodbye.message || translate("administration/goodbye:DEFAULT_MESSAGE")) %></textarea>
</div>
<!-- select -->
<div class="form-group">
<label><%= translate("common:CHANNEL") %></label>
<select class="form-control" name="channel">
<% if(guild.plugins.goodbye.enabled && bot.channels.cache.has(guild.plugins.goodbye.channel)) { %>
<option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.goodbye.channel).name %>
</option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.id !== guild.plugins.goodbye.channel && ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); } else { %>
<option selected="selected">
2022-01-03 23:20:33 +05:00
#<%= guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").first().name %>
2021-12-16 23:42:58 +05:00
</option>
2022-01-03 23:20:33 +05:00
<% guild.channels.cache.filter((ch) => ch.id !== guild.channels.cache.first().id && ch.type === "GUILD_TEXT").forEach((ch) => { %>
2021-12-16 23:42:58 +05:00
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
</div>
<!-- select -->
<div class="form-group">
<div class="checkbox">
<label>
<% if(guild.plugins.goodbye.withImage || !guild.plugins.goodbye.enabled) { %>
<input type="checkbox" name="withImage"
checked><%= translate("dashboard:GOODBYE_IMG") %>
<% } else { %>
<input type="checkbox"
name="withImage"><%= translate("dashboard:GOODBYE_IMG") %>
2021-12-14 23:23:55 +05:00
<% } %>
2021-12-16 23:42:58 +05:00
</label>
2021-12-14 23:23:55 +05:00
</div>
</div>
2021-12-16 23:42:58 +05:00
</div>
<!-- /.box-body -->
<div class="box-footer">
<% if(guild.plugins.goodbye.enabled) { %>
<button type="submit" name="goodbyeDisable"
class="btn btn-danger"><%= translate("dashboard:DISABLE_MESSAGES") %></button>
<button type="submit" name="goodbyeUpdate"
class="btn btn-primary pull-right"><%= translate("common:UPDATE") %></button>
<% } else { %>
<button type="submit" name="goodbyeEnable"
class="btn btn-success"><%= translate("dashboard:ENABLE_MESSAGES") %></button>
<% } %>
</div>
</form>
</div>
<!-- AUTOROLE CONFIGURATION -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"><%= translate("dashboard:AUTOROLE_CONF") %></h3>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- select -->
<div class="form-group">
<label><%= translate("common:ROLE") %></label>
<select class="form-control" name="role">
<% if(guild.plugins.autorole.enabled && guild.roles.cache.has(guild.plugins.autorole.role)) { %>
<option selected="selected">
@<%= guild.roles.cache.get(guild.plugins.autorole.role).name %></option>
<% guild.roles.cache.filter((r) => r.id !== guild.plugins.autorole.role && r.name !== "@everyone").forEach((r) => { %>
<option>@<%= r.name %></option>
<% }); } else { %>
<option selected="selected">
@<%= guild.roles.cache.filter((r) => r.name !== "@everyone").first().name %>
</option>
<% guild.roles.cache.filter((r) => r.id !== guild.roles.cache.filter((r) => r.name !== "@everyone").first().id && r.name !== "@everyone").forEach((r) => { %>
<option>@<%= r.name %></option>
<% }); %>
<% } %>
</select>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<% if(guild.plugins.autorole.enabled) { %>
<button type="submit" name="autoroleDisable"
class="btn btn-danger"><%= translate("dashboard:DISABLE_AUTOROLE") %></button>
<button type="submit" name="autoroleUpdate"
class="btn btn-primary pull-right"><%= translate("common:UPDATE") %></button>
<% } else { %>
<button type="submit" name="autoroleEnable"
class="btn btn-success"><%= translate("dashboard:ENABLE_AUTOROLE") %></button>
<% } %>
</div>
</form>
2021-12-14 23:23:55 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.box -->
</div>
2021-12-14 23:23:55 +05:00
<div>
2021-12-16 23:42:58 +05:00
</section>
2021-12-10 21:39:54 +05:00
2021-12-16 23:42:58 +05:00
<!-- Footer includes credits and version -->
2021-12-10 21:39:54 +05:00
</div>
2021-12-16 23:42:58 +05:00
<!-- /.content-wrapper -->
2021-12-24 20:52:27 +05:00
<%- include("../includes/footer") %>
2021-12-16 23:42:58 +05:00
</div>
<!-- ./wrapper -->
</body>
2021-12-10 21:39:54 +05:00
</html>