Initial dynamic favicon code
Syntax and logic fixes New favicons Contribution Guidelines Removed trailing spaces Style tweaks Comma Suggested code changes Changed high and medium alert icons to be exclamation marks protruding through a circle Moved favicon logic to IndexComposer Style fixes Removed whitespace
This commit is contained in:
@@ -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 |
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user