diff --git a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php index 5160d5d66f..36fd262482 100644 --- a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php @@ -94,7 +94,14 @@ abstract public function getCount(); */ public function render(NavigationItem $item = null) { - return '
' . $this->renderBadge() . parent::render($item) . '
'; + if ($item === null) { + $item = $this->getItem(); + } + $item->setCssClass('badge-nav-item'); + $this->setEscapeLabel(false); + $label = $this->view()->escape($item->getLabel()); + $item->setLabel($this->renderBadge() . $label); + return parent::render($item); } /** @@ -107,7 +114,7 @@ protected function renderBadge() if ($count = $this->getCount()) { $view = $this->view(); return sprintf( - '%s', + '%s', $view->escape($this->getTitle()), $view->escape($this->getState()), $count diff --git a/public/css/icinga/badges.less b/public/css/icinga/badges.less index a2451198a2..7e9ad6ce00 100644 --- a/public/css/icinga/badges.less +++ b/public/css/icinga/badges.less @@ -1,15 +1,17 @@ +/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ + .badge { - min-width: 25px; - font-family: tahoma, verdana, sans-serif; + background-color: @gray-light; + color: @text-color-inverted; + font-family: @font-family-wide; + font-size: @font-size-small; font-weight: @font-weight-bold; - font-size: 11px; + line-height: 1; + min-width: 3em; + padding: @vertical-padding @horizontal-padding; text-align: center; - color: @text-color-inverted; - padding-left: 5px; - padding-right: 5px; - padding-top: 2px; - padding-bottom: 2px; - background-color: @gray-light; + vertical-align: middle; + white-space: nowrap; &.state-ok { .bg-color-ok(); diff --git a/public/css/icinga/nav.less b/public/css/icinga/nav.less index 002bfe6e12..aa0b15ad75 100644 --- a/public/css/icinga/nav.less +++ b/public/css/icinga/nav.less @@ -1,7 +1,18 @@ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +li.badge-nav-item { + > a { + .clearfix(); + + .badge { + float: right; + } + } +} + li.nav-item { - a, span { + > a, + > span { // Rollover display: block; } @@ -18,6 +29,6 @@ ul.tab-nav { .clearfix(); li { - .pull-left(); + float: left; } }