Display an Incident and Component count in the sidebar.
This commit is contained in:
@@ -85,6 +85,16 @@ body.dashboard {
|
|||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
&.label {
|
||||||
|
float: right;
|
||||||
|
margin: 6px 0;
|
||||||
|
&.label-info {
|
||||||
|
background-color: $cachet-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.sub-nav-item {
|
&.sub-nav-item {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
<a href="{{ route('dashboard.incidents') }}">
|
<a href="{{ route('dashboard.incidents') }}">
|
||||||
<i class="icon ion-android-alert"></i>
|
<i class="icon ion-android-alert"></i>
|
||||||
<span>{{ trans('dashboard.incidents.incidents') }}</span>
|
<span>{{ trans('dashboard.incidents.incidents') }}</span>
|
||||||
|
<span class="label label-info">{{ $incidentCount }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li {{ set_active('dashboard/templates*') }}>
|
<li {{ set_active('dashboard/templates*') }}>
|
||||||
@@ -51,6 +52,7 @@
|
|||||||
<a href="{{ route('dashboard.components') }}">
|
<a href="{{ route('dashboard.components') }}">
|
||||||
<i class="icons ion-outlet"></i>
|
<i class="icons ion-outlet"></i>
|
||||||
<span>{{ trans('dashboard.components.components') }}</span>
|
<span>{{ trans('dashboard.components.components') }}</span>
|
||||||
|
<span class="label label-info">{{ $componentCount }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li {{ set_active('dashboard/team*') }}>
|
<li {{ set_active('dashboard/team*') }}>
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"dist/css/all.css": "dist/css/all-d43ec06b.css",
|
"dist/css/all.css": "dist/css/all-fc4d5c76.css",
|
||||||
"dist/js/all.js": "dist/js/all-d4baa2f5.js"
|
"dist/js/all.js": "dist/js/all-d4baa2f5.js"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace CachetHQ\Cachet\Composers;
|
||||||
|
|
||||||
|
use CachetHQ\Cachet\Models\Incident;
|
||||||
|
use CachetHQ\Cachet\Models\Component;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class DashboardComposer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Bind data to the view.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\View\View $view
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function compose(View $view)
|
||||||
|
{
|
||||||
|
$view->with('incidentCount', Incident::notScheduled()->count());
|
||||||
|
$view->with('componentCount', Component::all()->count());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ class ViewComposerServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$this->app->view->composer('*', 'CachetHQ\Cachet\Composers\LoggedUserComposer');
|
$this->app->view->composer('*', 'CachetHQ\Cachet\Composers\LoggedUserComposer');
|
||||||
$this->app->view->composer('index', 'CachetHQ\Cachet\Composers\IndexComposer');
|
$this->app->view->composer('index', 'CachetHQ\Cachet\Composers\IndexComposer');
|
||||||
|
$this->app->view->composer('dashboard.*', 'CachetHQ\Cachet\Composers\DashboardComposer');
|
||||||
$this->app->view->composer([
|
$this->app->view->composer([
|
||||||
'setup',
|
'setup',
|
||||||
'dashboard.settings.app-setup',
|
'dashboard.settings.app-setup',
|
||||||
|
|||||||
Reference in New Issue
Block a user