Removed code duplication

This commit is contained in:
Graham Campbell
2015-11-21 22:45:04 +00:00
parent 236d52714d
commit 7a09667cc0
2 changed files with 1 additions and 6 deletions

View File

@@ -26,10 +26,6 @@ class AppComposer
*/
public function compose(View $view)
{
$isEnabled = (bool) Setting::get('enable_subscribers', false);
$mailAddress = env('MAIL_ADDRESS', false);
$mailFrom = env('MAIL_NAME', false);
$view->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')));
$view->withAppBanner(Setting::get('app_banner'));
$view->withAppBannerType(Setting::get('app_banner_type'));
@@ -37,6 +33,5 @@ class AppComposer
$view->withAppName(Setting::get('app_name'));
$view->withAppUrl(Config::get('app.url'));
$view->withShowSupport(Setting::get('show_support'));
$view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
}
}

View File

@@ -24,7 +24,7 @@
<li>
<a class="btn btn-link" href="{{ route('feed.atom') }}">{{ trans('cachet.atom-feed') }}</a>
</li>
@if($subscribers_enabled)
@if(subscribers_enabled())
<li>
<a class="btn btn-success btn-outline" href="{{ route('subscribe.subscribe') }}">{{ trans('cachet.subscriber.button') }}</a>
</li>