Pārlūkot izejas kodu

Remove Discord button if not set || translation strings on welcome || total credits no admins

1Day 3 gadi atpakaļ
vecāks
revīzija
8e052572f7

+ 1 - 1
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 () {

+ 12 - 11
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') . ". <br />";
+            $AdditionalLine .= __("Verifying your e-mail address will grant you ") . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'). " "  . __("additional") . " "  . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ". <br />";
         }
         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') . ". <br />";
+            $AdditionalLine .=  __("Verifying your e-mail will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ". <br />";
         }
         $AdditionalLine .= "<br />";
         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') . ". <br />";
+            $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') . ". <br />";
         }
         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') . ". <br />";
+            $AdditionalLine .=   __("Verifying your Discord account will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ". <br />";
         }
 
         return $AdditionalLine;
@@ -65,19 +65,20 @@ class WelcomeMessage extends Notification implements ShouldQueue
      */
     public function toArray($notifiable)
     {
+
         return [
             'title'   => __("Getting started!"),
             'content' => "
-               <p>Hello <strong>{$this->user->name}</strong>, Welcome to our dashboard!</p>
-                <h5>Verification</h5>
-                <p>You can verify your e-mail address and link/verify your Discord account.</p>
+               <p> ".__("Hello")." <strong>{$this->user->name}</strong>, ".__("Welcome to our dashboard")."!</p>
+                <h5>".__("Verification")."</h5>
+                <p>".__("You can verify your e-mail address and link/verify your Discord account.")."</p>
                 <p>
                   " . $this->AdditionalLines() . "
                 </p>
-                <h5>Information</h5>
-                <p>This dashboard can be used to create and delete servers.<br /> These servers can be used and managed on our pterodactyl panel.<br /> If you have any questions, please join our Discord server and #create-a-ticket.</p>
-                <p>We hope you can enjoy this hosting experience and if you have any suggestions please let us know!</p>
-                <p>Regards,<br />" . config('app.name', 'Laravel') . "</p>
+                <h5>".__("Information")."</h5>
+                <p>".__("This dashboard can be used to create and delete servers").".<br /> ".__("These servers can be used and managed on our pterodactyl panel").".<br /> ".__("If you have any questions, please join our Discord server and #create-a-ticket").".</p>
+                <p>".__("We hope you can enjoy this hosting experience and if you have any suggestions please let us know")."!</p>
+                <p>".__("Regards").",<br />" . config('app.name', 'Laravel') . "</p>
             ",
         ];
     }

+ 2 - 0
resources/views/layouts/main.blade.php

@@ -49,10 +49,12 @@
                     <a href="{{ route('home') }}" class="nav-link"><i
                             class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
                 </li>
+                @if(config('SETTINGS::DISCORD:INVITE_URL'))
                 <li class="nav-item d-none d-sm-inline-block">
                     <a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link" target="__blank"><i
                             class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
                 </li>
+                @endif
                 <!-- Language Selection -->
                 @if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
                     <li class="nav-item dropdown">