Merge pull request #752 from DivineOmega/dynamic_favicon

Dynamic favicon
This commit is contained in:
James Brooks 2015-06-27 13:37:46 +01:00
commit 62a71554c6
6 changed files with 15 additions and 2 deletions

View File

@ -28,6 +28,7 @@ class IndexComposer
$withData = [
'systemStatus' => 'danger',
'systemMessage' => trans('cachet.service.bad'),
'favicon' => 'favicon',
];
if (Component::notStatus(1)->count() === 0) {
@ -43,6 +44,13 @@ class IndexComposer
}
}
// Determine favicon to use
if (Component::where('status', 4)->count() > 0 || Incident::where('status', 2)->count() > 0) {
$withData['favicon'] = 'favicon-high-alert';
} elseif (Component::whereIn('status', [2, 3])->count() > 0 || Incident::whereIn('status', [1, 3])->count() > 0) {
$withData['favicon'] = 'favicon-medium-alert';
}
$view->with($withData);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

View File

@ -19,8 +19,13 @@
<!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
<meta http-equiv="cleartype" content="on">
<link rel="icon" type="image/png" href="/img/favicon.ico">
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
@if (isset($favicon))
<link rel="icon" type="image/png" href="/img/{{ $favicon }}.ico">
<link rel="shortcut icon" href="/img/{{ $favicon }}.png" type="image/x-icon">
@else
<link rel="icon" type="image/png" href="/img/favicon.ico">
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
@endif
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="/img/apple-touch-icon-57x57.png">