Skip to content

Commit

Permalink
Move notifications to the bottom of the page
Browse files Browse the repository at this point in the history
refs #8247
  • Loading branch information
Al2Klimov committed May 29, 2015
1 parent 068bfc0 commit 0ba4d24
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
43 changes: 22 additions & 21 deletions application/layouts/scripts/body.phtml
Expand Up @@ -5,29 +5,20 @@ use Icinga\Web\Notification;
use Icinga\Authentication\Manager as Auth;


if (Auth::getInstance()->isAuthenticated()): ?>
<div id="header">
<ul id="notifications"><?php

$moduleName = $this->layout()->moduleName;
if ($moduleName) {
$moduleClass = ' icinga-module module-' . $moduleName;
} else {
$moduleClass = '';
}

$refresh = '';
if ($this->layout()->autorefreshInterval) {
$refresh = ' data-icinga-refresh="' . $this->layout()->autorefreshInterval . '"';
}
if (Auth::getInstance()->isAuthenticated()):
$moduleName = $this->layout()->moduleName;
if ($moduleName) {
$moduleClass = ' icinga-module module-' . $moduleName;
} else {
$moduleClass = '';
}

$notifications = Notification::getInstance();
if ($notifications->hasMessages()) {
foreach ($notifications->getMessages() as $m) {
echo '<li class="' . $m->type . '">' . $this->escape($m->message) . '</li>';
$refresh = '';
if ($this->layout()->autorefreshInterval) {
$refresh = ' data-icinga-refresh="' . $this->layout()->autorefreshInterval . '"';
}
}
?></ul>
?>
<div id="header">
<div id="logo" data-base-target="_main">
<?= $this->qlink(
'',
Expand Down Expand Up @@ -56,6 +47,16 @@ if ($notifications->hasMessages()) {
<div id="col3" class="container">
</div>
</div><!-- END of main -->
<div id="footer">
<ul id="notifications"><?php
$notifications = Notification::getInstance();
if ($notifications->hasMessages()) {
foreach ($notifications->getMessages() as $m) {
echo '<li class="' . $m->type . '">' . $this->escape($m->message) . '</li>';
}
}
?></ul>
</div>
<?php else: ?>
<?= $this->render('inline.phtml') ?>
<?php endif ?>
1 change: 1 addition & 0 deletions library/Icinga/Web/StyleSheet.php
Expand Up @@ -18,6 +18,7 @@ class StyleSheet
'css/icinga/layout-structure.less',
'css/icinga/menu.less',
'css/icinga/header-elements.less',
'css/icinga/footer-elements.less',
'css/icinga/main-content.less',
'css/icinga/tabs.less',
'css/icinga/forms.less',
Expand Down
8 changes: 8 additions & 0 deletions public/css/icinga/footer-elements.less
@@ -0,0 +1,8 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

div#footer {
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
}

0 comments on commit 0ba4d24

Please sign in to comment.