From 8e052572f7b7fd819fa271fda81f0c0d8b735859 Mon Sep 17 00:00:00 2001 From: 1Day Date: Mon, 30 May 2022 09:53:11 +0200 Subject: [PATCH] Remove Discord button if not set || translation strings on welcome || total credits no admins --- .../Controllers/Admin/OverViewController.php | 2 +- app/Notifications/WelcomeMessage.php | 23 ++++++++++--------- resources/views/layouts/main.blade.php | 2 ++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Admin/OverViewController.php b/app/Http/Controllers/Admin/OverViewController.php index 1fa022ec..29049b8f 100644 --- a/app/Http/Controllers/Admin/OverViewController.php +++ b/app/Http/Controllers/Admin/OverViewController.php @@ -23,7 +23,7 @@ class OverViewController extends Controller }); $creditCount = Cache::remember('credit:count', self::TTL, function () { - return User::query()->sum('credits'); + return User::query()->where("role","!=","admin")->sum('credits'); }); $paymentCount = Cache::remember('payment:count', self::TTL, function () { diff --git a/app/Notifications/WelcomeMessage.php b/app/Notifications/WelcomeMessage.php index a7854478..3841fc83 100644 --- a/app/Notifications/WelcomeMessage.php +++ b/app/Notifications/WelcomeMessage.php @@ -42,17 +42,17 @@ class WelcomeMessage extends Notification implements ShouldQueue $AdditionalLine = ""; if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) { - $AdditionalLine .= "Verifying your e-mail address will grant you " . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') . " additional " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; + $AdditionalLine .= __("Verifying your e-mail address will grant you ") . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'). " " . __("additional") . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; } if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) { - $AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
"; + $AdditionalLine .= __("Verifying your e-mail will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
"; } $AdditionalLine .= "
"; if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) { - $AdditionalLine .= "You can also verify your discord account to get another " . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; + $AdditionalLine .= __("You can also verify your discord account to get another ") . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; } if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) { - $AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
"; + $AdditionalLine .= __("Verifying your Discord account will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
"; } return $AdditionalLine; @@ -65,19 +65,20 @@ class WelcomeMessage extends Notification implements ShouldQueue */ public function toArray($notifiable) { + return [ 'title' => __("Getting started!"), 'content' => " -

Hello {$this->user->name}, Welcome to our dashboard!

-
Verification
-

You can verify your e-mail address and link/verify your Discord account.

+

".__("Hello")." {$this->user->name}, ".__("Welcome to our dashboard")."!

+
".__("Verification")."
+

".__("You can verify your e-mail address and link/verify your Discord account.")."

" . $this->AdditionalLines() . "

-
Information
-

This dashboard can be used to create and delete servers.
These servers can be used and managed on our pterodactyl panel.
If you have any questions, please join our Discord server and #create-a-ticket.

-

We hope you can enjoy this hosting experience and if you have any suggestions please let us know!

-

Regards,
" . config('app.name', 'Laravel') . "

+
".__("Information")."
+

".__("This dashboard can be used to create and delete servers").".
".__("These servers can be used and managed on our pterodactyl panel").".
".__("If you have any questions, please join our Discord server and #create-a-ticket").".

+

".__("We hope you can enjoy this hosting experience and if you have any suggestions please let us know")."!

+

".__("Regards").",
" . config('app.name', 'Laravel') . "

", ]; } diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index a0542815..742bcd02 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -49,10 +49,12 @@ {{ __('Home') }} + @if(config('SETTINGS::DISCORD:INVITE_URL')) + @endif @if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')