From fbd42b6fa5c34169ab48a4174bfec4251e051100 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Wed, 12 Jan 2022 20:31:47 +0500 Subject: [PATCH] =?UTF-8?q?v3.2.7=20=D0=98=D0=BD=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BE=20=D0=BF=D1=80=D0=BE=D1=84?= =?UTF-8?q?=D0=B8=D0=BB=D0=B5=20=D0=BD=D0=B0=20=D1=81=D0=B0=D0=B9=D1=82?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/General/setafk.js | 2 +- dashboard/app.js | 1 + dashboard/routes/guild-manager.js | 3 ++ dashboard/routes/settings.js | 4 +- dashboard/views/docs.ejs | 11 ++++- dashboard/views/includes/sidebar.ejs | 4 +- dashboard/views/manager/guild.ejs | 61 +++++++++++++++++++++------- dashboard/views/selector.ejs | 2 +- dashboard/views/settings.ejs | 9 ++++ helpers/autoUpdateDocs.js | 2 +- languages/ru-RU/dashboard.json | 10 ++++- package.json | 2 +- 12 files changed, 86 insertions(+), 25 deletions(-) diff --git a/commands/General/setafk.js b/commands/General/setafk.js index 69980e4e..7b074b5f 100644 --- a/commands/General/setafk.js +++ b/commands/General/setafk.js @@ -35,7 +35,7 @@ class Setafk extends Command { const m = await message.success("general/setafk:SUCCESS", { reason, - prefix: message.guild ? data.guild.prefix : "$" + prefix: message.guild ? data.guild.prefix : "" }); setTimeout(() => { diff --git a/dashboard/app.js b/dashboard/app.js index 5a82c22d..bcd44792 100644 --- a/dashboard/app.js +++ b/dashboard/app.js @@ -43,6 +43,7 @@ module.exports.load = async(client) => { if (req.user) { req.translate = req.client.translations.get(req.locale); req.printDate = (date) => req.client.printDate(date, null, req.locale); + req.convertTime = (time) => req.client.convertTime(time, "to", true, req.locale); }; next(); }) diff --git a/dashboard/routes/guild-manager.js b/dashboard/routes/guild-manager.js index 86306b0f..9c16aa58 100644 --- a/dashboard/routes/guild-manager.js +++ b/dashboard/routes/guild-manager.js @@ -16,12 +16,15 @@ router.get("/:serverID", CheckAuth, async(req, res) => { // Fetch guild informations const guildInfos = await utils.fetchGuild(guild.id, req.client, req.user.guilds); + const memberData = await req.client.findOrCreateMember({ id: req.userInfos.id, guildID: guild.id }); res.render("manager/guild", { guild: guildInfos, user: req.userInfos, + memberData: memberData, translate: req.translate, bot: req.client, + convertTime: req.convertTime, currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}` }); }); diff --git a/dashboard/routes/settings.js b/dashboard/routes/settings.js index 72eadda4..758a75c7 100644 --- a/dashboard/routes/settings.js +++ b/dashboard/routes/settings.js @@ -4,7 +4,7 @@ const express = require("express"), // Gets profile page router.get("/", CheckAuth, async function(req, res) { - res.render("settings", { + res.render("profile", { user: req.userInfos, translate: req.translate, printDate: req.printDate, @@ -25,7 +25,7 @@ router.post("/", CheckAuth, async function(req, res) { }; await user.save(); - res.redirect(303, "/settings"); + res.redirect(303, "/profile"); }); module.exports = router; diff --git a/dashboard/views/docs.ejs b/dashboard/views/docs.ejs index b3b74492..bb7194f7 100644 --- a/dashboard/views/docs.ejs +++ b/dashboard/views/docs.ejs @@ -193,13 +193,20 @@
+									-----------------------------------------------------------------------------------------
+									JaBa v3.2.7
+									-----------------------------------------------------------------------------------------
+									Добавлено
+										- Некоторая информация о вашем профиле на сайте, на страницах серверов и в настройках.
+										(Скоро там будет больше всякой информации).
+
 									-----------------------------------------------------------------------------------------
 									JaBa v3.2.6
 									-----------------------------------------------------------------------------------------
 									Исправления
 										- Команда goodbye снова работает.
 
-									Изменено
+									Изменения
 										- Команда setafk и ответ бота автоматически удаляются через 10 секунд.
 										- Новые карточки при входе и выходе пользователей
 										(Я не дизайнер, не бейте :( ).
@@ -208,7 +215,7 @@
 									-----------------------------------------------------------------------------------------
 									JaBa v3.2.5
 									-----------------------------------------------------------------------------------------
-									Изменено
+									Изменения
 										- Переписана команда loop.
 										Теперь нужен аргумент song или queue для включения соответствующего режима повтора.
 										Если не указать агрумент, то повтор отключится.
diff --git a/dashboard/views/includes/sidebar.ejs b/dashboard/views/includes/sidebar.ejs
index 78c02c39..9fad9369 100644
--- a/dashboard/views/includes/sidebar.ejs
+++ b/dashboard/views/includes/sidebar.ejs
@@ -40,11 +40,11 @@
 						
 					
 				
-				<% if(user.displayedGuilds) { %>
+				<% if (user.displayedGuilds) { %>
 				
diff --git a/dashboard/views/manager/guild.ejs b/dashboard/views/manager/guild.ejs
index ee8e9dcf..48228b77 100644
--- a/dashboard/views/manager/guild.ejs
+++ b/dashboard/views/manager/guild.ejs
@@ -29,8 +29,9 @@
 				
-
+

<%= guild.name %>

+ <%= guild.id %>
Server icon @@ -50,6 +51,38 @@
+
+ +
+ <%= translate("common:LEVEL") %> + <%= guild.members.find(u => u.id === user.id).level %> +
+ +
+
+ +
+ <%= translate("common:CREDITS") %> / <%= translate("economy/transactions:BANK") %> + <%= guild.members.find(u => u.id === user.id).money %> / <%= guild.members.find(u => u.id === user.id).bankSold %> +
+ +
+ +
+ +
+ <%= translate("dashboard:COOLDOWNS") %> + <% for (const c in memberData.cooldowns) { %> + <% if (c !== "rob") { %> + <%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] !== 0 ? convertTime(memberData.cooldowns[c]) : translate("dashboard:CAN_USE") %> + <% } else { %> + <%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] !== 0 ? convertTime(memberData.cooldowns[c]) : translate("dashboard:NO_DEFENCE") %> + <% }; %> + <% }; %> +
+ +
+
@@ -69,7 +102,7 @@ - <% if(guild.plugins.suggestions && bot.channels.cache.has(guild.plugins.suggestions)) { %> + <% if (guild.plugins.suggestions && bot.channels.cache.has(guild.plugins.suggestions)) { %> <% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.suggestions).forEach((ch) => { %> @@ -116,7 +149,7 @@
- <% if(guild.plugins.modlogs && bot.channels.cache.has(guild.plugins.modlogs)) { %> + <% if (guild.plugins.modlogs && bot.channels.cache.has(guild.plugins.modlogs)) { %> <% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.modlogs).forEach((ch) => { %> @@ -152,7 +185,7 @@
- <% if(guild.plugins.welcome.enabled && bot.channels.cache.has(guild.plugins.welcome.channel)) { %> + <% if (guild.plugins.welcome.enabled && bot.channels.cache.has(guild.plugins.welcome.channel)) { %> @@ -216,7 +249,7 @@