diff --git a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php
index 5160d5d66..36fd26248 100644
--- a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php
+++ b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php
@@ -94,7 +94,14 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*/
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 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
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 a2451198a..7e9ad6ce0 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;
- font-weight: @font-weight-bold;
- font-size: 11px;
- text-align: center;
- color: @text-color-inverted;
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 2px;
- padding-bottom: 2px;
background-color: @gray-light;
+ color: @text-color-inverted;
+ font-family: @font-family-wide;
+ font-size: @font-size-small;
+ font-weight: @font-weight-bold;
+ line-height: 1;
+ min-width: 3em;
+ padding: @vertical-padding @horizontal-padding;
+ text-align: center;
+ 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 002bfe6e1..aa0b15ad7 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;
}
}