diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 74c0a580..bcf932e2 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App; use View; use Utils; +use Parsedown; use App\Models\User; use App\Models\Texture; use Illuminate\Http\Request; @@ -23,7 +24,8 @@ class UserController extends Controller 'statistics' => [ 'players' => $this->calculatePercentageUsed($user->players->count(), option('score_per_player')), 'storage' => $this->calculatePercentageUsed($user->getStorageUsed(), option('score_per_storage')) - ] + ], + 'announcement' => (new Parsedown())->text(option_localized('announcement')) ]); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0fd9a521..973d7e1a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -59,7 +59,6 @@ class AppServiceProvider extends ServiceProvider { $this->app->singleton('cipher', 'App\Services\Cipher\\'.config('secure.cipher')); $this->app->singleton('users', \App\Services\Repositories\UserRepository::class); - $this->app->singleton('parsedown', \Parsedown::class); Blade::if('admin', function (User $user) { return $user->isAdmin(); diff --git a/app/helpers.php b/app/helpers.php index fa50870e..4ef5b992 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -264,14 +264,6 @@ if (! function_exists('bs_custom_copyright')) { } } -if (! function_exists('bs_announcement')) { - - function bs_announcement() - { - return app('parsedown')->text(option_localized('announcement')); - } -} - if (! function_exists('bs_nickname')) { function bs_nickname(User $user = null) diff --git a/resources/views/user/index.tpl b/resources/views/user/index.tpl index d05e3125..b31aed2f 100644 --- a/resources/views/user/index.tpl +++ b/resources/views/user/index.tpl @@ -96,7 +96,7 @@