mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
Merge pull request #752 from DivineOmega/dynamic_favicon
Dynamic favicon
This commit is contained in:
commit
62a71554c6
@ -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);
|
||||
}
|
||||
}
|
||||
|
BIN
public/img/favicon-high-alert.ico
Normal file
BIN
public/img/favicon-high-alert.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
public/img/favicon-high-alert.png
Normal file
BIN
public/img/favicon-high-alert.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 713 B |
BIN
public/img/favicon-medium-alert.ico
Normal file
BIN
public/img/favicon-medium-alert.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
public/img/favicon-medium-alert.png
Normal file
BIN
public/img/favicon-medium-alert.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 763 B |
@ -19,8 +19,13 @@
|
||||
<!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
|
||||
<meta http-equiv="cleartype" content="on">
|
||||
|
||||
@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">
|
||||
|
Loading…
x
Reference in New Issue
Block a user