Let's not duplicate view code
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
namespace CachetHQ\Cachet\Composers;
|
namespace CachetHQ\Cachet\Composers;
|
||||||
|
|
||||||
use CachetHQ\Cachet\Facades\Setting;
|
use CachetHQ\Cachet\Facades\Setting;
|
||||||
|
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
|
|
||||||
class AppComposer
|
class AppComposer
|
||||||
@@ -30,5 +31,6 @@ class AppComposer
|
|||||||
$mailFrom = env('MAIL_NAME', false);
|
$mailFrom = env('MAIL_NAME', false);
|
||||||
|
|
||||||
$view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
|
$view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
|
||||||
|
$view->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ use CachetHQ\Cachet\Facades\Setting;
|
|||||||
use CachetHQ\Cachet\Models\Incident;
|
use CachetHQ\Cachet\Models\Incident;
|
||||||
use Exception;
|
use Exception;
|
||||||
use GrahamCampbell\Binput\Facades\Binput;
|
use GrahamCampbell\Binput\Facades\Binput;
|
||||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
@@ -90,7 +89,6 @@ class StatusPageController extends Controller
|
|||||||
return View::make('index')
|
return View::make('index')
|
||||||
->withDaysToShow($daysToShow)
|
->withDaysToShow($daysToShow)
|
||||||
->withAllIncidents($allIncidents)
|
->withAllIncidents($allIncidents)
|
||||||
->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')))
|
|
||||||
->withCanPageForward((bool) $today->gt($startDate))
|
->withCanPageForward((bool) $today->gt($startDate))
|
||||||
->withCanPageBackward(Incident::notScheduled()->where('created_at', '<', $startDate->format('Y-m-d'))->count() > 0)
|
->withCanPageBackward(Incident::notScheduled()->where('created_at', '<', $startDate->format('Y-m-d'))->count() > 0)
|
||||||
->withPreviousDate($startDate->copy()->subDays($daysToShow)->toDateString())
|
->withPreviousDate($startDate->copy()->subDays($daysToShow)->toDateString())
|
||||||
|
|||||||
@@ -1,28 +1,11 @@
|
|||||||
@extends('layout.master')
|
@extends('layout.master')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<a href="/" class="btn btn-info"><i class="ion-home"></i></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
|
|
||||||
<div class="section-messages">
|
<div class="section-messages">
|
||||||
@include('dashboard.partials.errors')
|
@include('dashboard.partials.errors')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if($bannerImage = Setting::get('app_banner'))
|
@include('partials.about-app')
|
||||||
<div class="row app-banner">
|
|
||||||
<div class="col-md-12 text-center">
|
|
||||||
<?php $bannerType = Setting::get('app_banner_type') ?>
|
|
||||||
@if($app_url = Setting::get('app_domain'))
|
|
||||||
<a href="{{ $app_url }}" class="links"><img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive"></a>
|
|
||||||
@else
|
|
||||||
<img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive">
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<h4>{{ formatted_date($incident->created_at) }}</h4>
|
<h4>{{ formatted_date($incident->created_at) }}</h4>
|
||||||
|
|
||||||
|
|||||||
@@ -5,25 +5,7 @@
|
|||||||
@include('dashboard.partials.errors')
|
@include('dashboard.partials.errors')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if($bannerImage = Setting::get('app_banner'))
|
@include('partials.about-app')
|
||||||
<div class="row app-banner">
|
|
||||||
<div class="col-md-12 text-center">
|
|
||||||
<?php $bannerType = Setting::get('app_banner_type') ?>
|
|
||||||
@if($app_url = Setting::get('app_domain'))
|
|
||||||
<a href="{{ $app_url }}"><img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive"></a>
|
|
||||||
@else
|
|
||||||
<img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive">
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if($about_app)
|
|
||||||
<div class="about-app">
|
|
||||||
<h1>{{ trans('cachet.about_this_site') }}</h1>
|
|
||||||
<p>{!! $about_app !!}</p>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="section-status">
|
<div class="section-status">
|
||||||
<div class="alert alert-{{ $systemStatus }}">{{ $systemMessage }}</div>
|
<div class="alert alert-{{ $systemStatus }}">{{ $systemMessage }}</div>
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
@if($bannerImage = Setting::get('app_banner'))
|
||||||
|
<div class="row app-banner">
|
||||||
|
<div class="col-md-12 text-center">
|
||||||
|
<?php $bannerType = Setting::get('app_banner_type') ?>
|
||||||
|
@if($app_url = Setting::get('app_domain'))
|
||||||
|
<a href="{{ $app_url }}" class="links"><img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive"></a>
|
||||||
|
@else
|
||||||
|
<img src="data:{{ $bannerType }};base64, {{ $bannerImage}}" class="banner-image img-responsive">
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($about_app)
|
||||||
|
<div class="about-app">
|
||||||
|
<h1>{{ trans('cachet.about_this_site') }}</h1>
|
||||||
|
<p>{!! $about_app !!}</p>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
Reference in New Issue
Block a user