Merge master fixed conflicts

This commit is contained in:
Alexander Fuhr 2015-02-16 11:24:15 +01:00
commit 7be134a774
51 changed files with 396 additions and 260 deletions

View File

@ -7,26 +7,6 @@ use Icinga\Authentication\Manager as Auth;
if (Auth::getInstance()->isAuthenticated()): ?>
<div id="header">
<div class="skip-links">
<nav>
<h1 class="sr-only"><?= t('Accessibility Skip Links'); ?></h1>
<ul>
<li>
<a tabindex="0" href="#main"><?= t('Skip to Content'); ?></a>
</li>
<li>
<a tabindex="0" href="#search"><?= t('Skip to Search'); ?></a>
</li>
<li>
<a tabindex="0" href="#navigation"><?= t('Skip to Navigation'); ?></a>
</li>
<li>
<?= $this->layout()->autoRefreshForm ?>
</li>
</ul>
</nav>
</div>
<ul id="notifications"><?php
$moduleName = $this->layout()->moduleName;
@ -48,8 +28,9 @@ if ($notifications->hasMessages()) {
}
}
?></ul>
<div id="logo" data-base-target="_main"><a href="<?= $this->href('/dashboard') ?>"><img aria-hidden="true" src="<?= $this->href('img/logo_icinga-inv.png') ?>" class="logo" alt="<?= t('Dashboard') ?>" /></a>
</div>
<div id="logo" data-base-target="_main">
<img aria-hidden="true" src="<?= $this->href('img/logo_icinga-inv.png') ?>" class="logo" alt="<?= t('Dashboard') ?>" />
</div>
</div>
<?php if (!$this->layout()->isIframe): ?>

View File

@ -10,6 +10,14 @@ if (! $this->auth()->isAuthenticated()) {
}
?>
<div class="skip-links">
<h1 class="sr-only"><?= t('Accessibility Skip Links'); ?></h1>
<ul>
<li>
<a tabindex="0" href="#main"><?= t('Skip to Content'); ?></a>
</li>
</ul>
</div>
<div id="menu" data-last-update="<?= (time() - 14) ?>000" data-base-target="_main" class="container"
data-icinga-url="<?= $this->href('layout/menu') ?>" data-icinga-refresh="15">
<?= $this->partial(

View File

@ -31,7 +31,7 @@ if ( isset($pdf) )
}
</script>
<?= $this->img('img/logo_icinga_big_dark.png', array('align' => 'right', 'width' => '75')) ?>
<?= $this->img('img/logo_icinga_big_dark.png', null, array('align' => 'right', 'width' => '75')) ?>
<!--<div id="page-header">
<table>
<tr>

View File

@ -7,7 +7,7 @@
<div class="form" data-base-target="layout">
<h1><?= $this->translate('Welcome to Icinga Web 2'); ?></h1>
<?php if ($requiresSetup): ?>
<p tabindex="0" class="config-note"><?= sprintf(
<p class="config-note"><?= sprintf(
$this->translate(
'It appears that you did not configure Icinga Web 2 yet so it\'s not possible to log in without any defined '
. 'authentication method. Please define a authentication method by following the instructions in the'
@ -18,7 +18,7 @@
'</a>'
); ?></p>
<?php elseif ($requiresExternalAuth): ?>
<p tabindex="0" class="info-box"><i aria-hidden="true" class="icon-info"></i><?= $this->translate(
<p class="info-box"><?= $this->icon('icon-info'); ?><?= $this->translate(
'You\'re currently not authenticated using any of the web server\'s authentication mechanisms.'
. ' Make sure you\'ll configure such, otherwise you\'ll not be able to login.'
); ?></p>

View File

@ -1,11 +1,13 @@
<div class="controls" data-base-target="_main">
<?= $this->tabs->render($this); ?>
<?= $this->tabs->render($this); ?>
</div>
<div class="content">
<?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?>
<?php endif ?>
<?= $this->form ?>
<h1 tabindex="0" id="application-configuration">
<?= t('Generic Configuration'); ?>
</h1>
<?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?>
<?php endif ?>
<?= $this->form ?>
</div>

View File

@ -1,10 +1,16 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Create New Authentication Backend'); ?></h4>
<p>
<?= $this->translate(
'Create a new backend for authenticating your users. This backend will be added at the end of your authentication order.'
); ?>
</p>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="authentication-create">
<?= $this->translate('Create New Authentication Backend'); ?>
</h1>
<p>
<?= $this->translate(
'Create a new backend for authenticating your users. This backend will be added at the end of your authentication order.'
); ?>
</p>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -1,5 +1,11 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Edit Backend'); ?></h4>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="authentication-modify">
<?= $this->translate('Edit Backend'); ?>
</h1>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -1,5 +1,11 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Remove Backend'); ?></h4>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="authentication-remove">
<?= $this->translate('Remove Backend'); ?>
</h1>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -2,10 +2,32 @@
<?= $tabs; ?>
</div>
<div class="content" data-base-target="_next">
<h1 tabindex="0" id="authentication-reorder">
<?= t('Authentication Configuration'); ?>
</h1>
<div class="skip-links skip-links-inline">
<nav>
<ul>
<li>
<a tabindex="0" href="#authentication-reorder-form">
<?= t('Skip To Authentication Reorder Form'); ?>
</a>
</li>
</ul>
</nav>
</div>
<h2 tabindex="0" id="authentication-new-backend" class="sr-only">
<?= t('New Authentication Backend'); ?>
</h2>
<p>
<a href="<?= $this->href('/config/createAuthenticationBackend'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?><?= $this->translate('Create A New Authentication Backend'); ?>
<?= $this->icon('plus'); ?><?= $this->translate('Create A New Authentication Backend'); ?>
</a>
</p>
<?= $form; ?>
<h2 tabindex="0" id="authentication-reorder" class="sr-only">
<?= t('Reorder Authentication Backends'); ?>
</h2>
<div id="authentication-reorder-form">
<?= $form; ?>
</div>
</div>

View File

@ -10,17 +10,24 @@
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($module->enabled): ?>
<?= $this->icon('thumbs-up', $this->translate('Module is enabled')) ?>
<?php else: ?>
<?= $this->icon('thumbs-down', $this->translate('Module is disabled')) ?>
<?php endif ?>
<a href="<?= $this->url(
'config/module/',
array('name' => $module->name)
) ?>"><?= $this->escape($module->name); ?></a> (<?=
$module->enabled ? ($module->loaded ? $this->translate('enabled') : $this->translate('failed')) : $this->translate('disabled')
?>)
<?php if ($module->enabled && $module->loaded) {
$icon = $this->icon('thumbs-up');
$title = sprintf($this->translate('Module %s is enabled'), $module->name);
} elseif (! $module->enabled) {
$icon = $this->icon('thumbs-down');
$title = sprintf($this->translate('Module %s is disabled'), $module->name);
} else { // ! $module->loaded
$icon = $this->icon('thumbs-down');
$title = sprintf($this->translate('Module %s has failed to load'), $module->name);
}
echo $this->qlink(
$icon . $this->escape($module->name),
'config/module/',
array('name' => $module->name),
array('title' => $title),
false
); ?>
</td>
</tr>
<?php endforeach ?>

View File

@ -2,31 +2,61 @@
<?= $tabs; ?>
</div>
<div class="content" data-base-target="_next">
<h1 tabindex="0" id="resource-index">
<?= t('Resource Configuration'); ?>
</h1>
<div class="skip-links skip-links-inline">
<nav>
<ul>
<li>
<a tabindex="0" href="#resource-edit-table">
<?= t('Skip To Existing Resources'); ?>
</a>
</li>
</ul>
</nav>
</div>
<h2 tabindex="0" id="resource-new-resource" class="sr-only">
<?= t('Create New Resource'); ?>
</h2>
<p>
<a href="<?= $this->href('/config/createresource'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create A New Resource'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?>
</a>
</p>
<table class="action">
<h2 tabindex="0" id="resource-edit-resource" class="sr-only">
<?= t('Edit Existing Resources'); ?>
</h2>
<table class="action" id="resource-edit-table">
<thead>
<th><?= $this->translate('Resource'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
</thead>
<tbody>
<?php foreach ($this->resources as $name): ?>
<?php foreach ($this->resources as $name): ?>
<tr>
<td>
<a href="<?= $this->href('config/editresource', array('resource' => $name)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($name); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($name),
'config/editresource',
array('resource' => $name),
array('title' => sprintf($this->translate('Edit resource %s'), $name)),
false
); ?>
</td>
<td style="text-align: center">
<a href="<?= $this->href('config/removeresource', array('resource' => $name)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<td>
<center>
<?= $this->qlink(
$this->icon('cancel'),
'config/removeresource',
array('resource' => $name),
array('title' => sprintf($this->translate('Remove resource %s'), $name)),
false
); ?>
</center>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>

View File

@ -1,6 +1,12 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Create A New Resource'); ?></h4>
<p><?= $this->translate('Resources are entities that provide data to Icinga Web 2.'); ?></p>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="resource-create">
<?= $this->translate('Create A New Resource'); ?>
</h1>
<p><?= $this->translate('Resources are entities that provide data to Icinga Web 2.'); ?></p>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -1,5 +1,11 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Edit Existing Resource'); ?></h4>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="resource-edit">
<?= $this->translate('Edit Existing Resource'); ?>
</h1>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -1,5 +1,11 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<h4><?= $this->translate('Remove Existing Resource'); ?></h4>
<?= $form; ?>
<div class="content">
<h1 tabindex="0" id="resource-remove">
<?= $this->translate('Remove Existing Resource'); ?>
</h1>
<div>
<?= $form; ?>
</div>
</div>

View File

@ -1,5 +1,3 @@
<?php
?>
<div class="controls">
<?= $this->tabs ?>
</div>
@ -25,9 +23,13 @@
<?= $pane->getName(); ?>
</th>
<th>
<a href="<?= $this->href('dashboard/remove-pane', array('pane' => $pane->getName())); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'dashboard/remove-pane',
array('pane' => $pane->getName()),
array('title' => sprintf($this->translate('Remove pane %s'), $pane->getName())),
false
); ?>
</th>
</tr>
<?php $dashlets = $pane->getDashlets(); ?>
@ -50,9 +52,13 @@
<a href="<?= $this->href($dashlet->getUrl()); ?>"><?= $dashlet->getUrl(); ?></a>
</td>
<td>
<a href="<?= $this->href('dashboard/remove-dashlet', array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle())); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'dashboard/remove-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()),
array('title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())),
false
); ?>
</td>
</tr>
<?php endforeach; ?>

View File

@ -10,24 +10,50 @@
<?php for ($i = 0; $i < count($backendNames); $i++): ?>
<tr>
<td class="action">
<a href="<?= $this->href('config/editAuthenticationBackend', array('auth_backend' => $backendNames[$i])); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($backendNames[$i]); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendNames[$i]),
'config/editAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])),
false
); ?>
</td>
<td>
<a href="<?= $this->href('config/removeAuthenticationBackend', array('auth_backend' => $backendNames[$i])); ?>">
<?= $this->icon('cancel', $this->translate('Remove')); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'config/removeAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])),
false
); ?>
</td>
<td>
<?php if ($i > 0): ?>
<button type="submit" name="backend_newpos" value="<?= sprintf('%s|%s', $backendNames[$i], $i - 1); ?>">
<?= $this->icon('up-big', $this->translate('Move up in authentication order')); ?>
<button type="submit" name="backend_newpos" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i - 1
); ?>" title="<?= $this->translate(
'Move up in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move authentication backend %s upwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('up-big'); ?>
</button>
<?php endif; ?>
<?php if ($i + 1 < count($backendNames)): ?>
<button type="submit" name="backend_newpos" value="<?= sprintf('%s|%s', $backendNames[$i], $i + 1); ?>">
<?= $this->icon('down-big', $this->translate('Move down in authentication order')); ?>
<button type="submit" name="backend_newpos" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i + 1
); ?>" title="<?= $this->translate(
'Move down in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move authentication backend %s downwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('down-big'); ?>
</button>
<?php endif; ?>
</td>

View File

@ -51,13 +51,13 @@
<td><?= $this->escape($role->users) ?></td>
<td><?= $this->escape($role->groups) ?></td>
<td>
<a href="<?= $this->url('roles/remove', array('role' => $name)) ?>"
title="<?= sprintf(
$this->translate('Remove role %s'),
$name
) ?>">
<?= $this->icon('cancel') ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'roles/remove',
array('role' => $name),
array('title' => sprintf($this->translate('Remove role %s'), $name)),
false
); ?>
</td>
</tr>
<?php endforeach ?>

View File

@ -10,22 +10,9 @@
.icon-star:before {
content: "★";
}
.sr-only {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
</style>
</head>
<body>
<span tabindex="0">
<i class="icon-star" aria-hidden="true"></i>
<span class="sr-only">Top rated article</span>
</span>
<i role="img" class="icon-star" aria-label="Top rated article" title="Top rated article"></i>
</body>
</html>
</html>

View File

@ -25,7 +25,7 @@ class NoScriptApply extends Zend_Form_Decorator_Abstract
{
if ($content) {
$content .= '<noscript><button name="noscript_apply" style="margin-left: 0.5em;" type="submit" value="1">'
. Icinga::app()->getViewRenderer()->view->icon('refresh.png', null, array('aria-hidden' => 'true')) . '&nbsp;' . t('Apply')
. Icinga::app()->getViewRenderer()->view->icon('refresh.png') . '&nbsp;' . t('Apply')
. '</button></noscript>';
}

View File

@ -27,55 +27,68 @@ $this->addHelperFunction('url', function ($path = null, $params = null) {
return $url;
});
$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = array(), $escape = true) use ($view) {
if (array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) {
$properties['aria-label'] = $properties['title'];
}
$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = array()) use ($view) {
return sprintf(
'<a href="%s"%s>%s</a>',
$view->url($url, $params),
$view->propertiesToString($properties),
$view->escape($title)
$escape ? $view->escape($title) : $title
);
});
$this->addHelperFunction('img', function ($url, array $properties = array()) use ($view) {
$this->addHelperFunction('img', function ($url, $params = null, array $properties = array()) use ($view) {
if (! array_key_exists('alt', $properties)) {
$properties['alt'] = '';
}
if (array_key_exists('title', $properties)) {
if (! array_key_exists('aria-label', $properties)) {
$properties['aria-label'] = $properties['title'];
}
} elseif (! array_key_exists('aria-hidden', $properties)) {
$properties['aria-hidden'] = 'true';
}
return sprintf(
'<img src="%s"%s />',
$view->url($url),
$view->url($url, $params),
$view->propertiesToString($properties)
);
});
$this->addHelperFunction('icon', function ($img, $title = null, array $properties = array()) use ($view) {
$isClass = strpos($img, '.') === false;
$class = null;
if ($isClass) {
$class = 'icon-' . $img;
} else {
$class = 'icon';
}
if ($title !== null) {
$properties['alt'] = $title;
$properties['title'] = $title;
}
if ($class !== null) {
if (isset($props['class'])) {
$properties['class'] .= ' ' . $class;
if (strpos($img, '.') !== false) {
if (array_key_exists('class', $properties)) {
$properties['class'] .= ' icon';
} else {
$properties['class'] = $class;
$properties['class'] = 'icon';
}
}
if ($isClass) {
return sprintf('<i %s ></i>', $view->propertiesToString($properties));
} else {
return $view->img('img/icons/' . $img, $properties);
}
if ($title !== null) {
$properties['role'] = 'img';
$properties['title'] = $title;
if (! array_key_exists('aria-label', $properties)) {
$properties['aria-label'] = $title;
}
} elseif (! array_key_exists('aria-hidden', $properties)) {
$properties['aria-hidden'] = 'true';
}
if (isset($properties['class'])) {
$properties['class'] .= ' icon-' . $img;
} else {
$properties['class'] = 'icon-' . $img;
}
return sprintf('<i %s></i>', $view->propertiesToString($properties));
});
$this->addHelperFunction('propertiesToString', function ($properties) use ($view) {

View File

@ -669,7 +669,7 @@ class FilterEditor extends AbstractWidget
. '" title="'
. $title
. '">'
. '<i class="icon-filter"></i>'
. '<i aria-hidden="true" class="icon-filter"></i>'
. '</a>';
}

View File

@ -215,9 +215,9 @@ class Tab extends AbstractWidget
if ($this->icon !== null) {
if (strpos($this->icon, '.') === false) {
$caption = $view->icon($this->icon, null, array('aria-hidden' => 'true')) . $caption;
$caption = $view->icon($this->icon) . $caption;
} else {
$caption = $view->img($this->icon, array('aria-hidden' => 'true', 'class' => 'icon')) . $caption;
$caption = $view->img($this->icon, null, array('class' => 'icon')) . $caption;
}
}
if ($this->url !== null) {

View File

@ -33,7 +33,7 @@ EOT;
*/
private $dropdownTpl = <<< 'EOT'
<li class="dropdown">
<a href="#" class="dropdown-toggle"><i class="icon-down-open"></i></a>
<a href="#" class="dropdown-toggle"><i aria-hidden="true" class="icon-down-open"></i></a>
<ul class="dropdown-menu">
{TABS}
</ul>

View File

@ -42,11 +42,11 @@
<span>
<?php if ($this->trend->trend === 'up'): ?>
<?= $this->icon('up-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('up-open'); ?>
<?php elseif ($this->trend->trend === 'unchanged'): ?>
<?= $this->icon('right-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('right-open'); ?>
<?php else: ?>
<?= $this->icon('down-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('down-open'); ?>
<?php endif; ?>
</span>
</div>

View File

@ -6,7 +6,7 @@
<div class="content" data-base-target="_next">
<p>
<a href="<?= $this->href('/monitoring/config/createbackend'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create New Monitoring Backend'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Monitoring Backend'); ?>
</a>
</p>
<table class="action">
@ -18,18 +18,26 @@
<?php foreach ($this->backendsConfig as $backendName => $config): ?>
<tr>
<td>
<a href="<?= $this->href('/monitoring/config/editbackend', array('backend' => $backendName)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($backendName); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendName),
'/monitoring/config/editbackend',
array('backend' => $backendName),
array('title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)),
false
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
); ?>)</small>
</td>
<td>
<a href="<?= $this->href('/monitoring/config/removebackend', array('backend' => $backendName)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'/monitoring/config/removebackend',
array('backend' => $backendName),
array('title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)),
false
); ?>
</td>
</tr>
<?php endforeach; ?>
@ -38,7 +46,7 @@
<h1><?= $this->translate('Monitoring Instances') ?></h1>
<p>
<a href="<?= $this->href('/monitoring/config/createinstance'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create New Instance'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Instance'); ?>
</a>
</p>
<table class="action">
@ -50,18 +58,26 @@
<?php foreach ($this->instancesConfig as $instanceName => $config): ?>
<tr>
<td>
<a href="<?= $this->href('/monitoring/config/editinstance', array('instance' => $instanceName)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($instanceName); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($instanceName),
'/monitoring/config/editinstance',
array('instance' => $instanceName),
array('title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)),
false
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$config->host !== null ? $this->translate('Remote') : $this->translate('Local')
); ?>)</small>
</td>
<td>
<a href="<?= $this->href('/monitoring/config/removeinstance', array('instance' => $instanceName)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'/monitoring/config/removeinstance',
array('instance' => $instanceName),
array('title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)),
false
); ?>
</td>
</tr>
<?php endforeach; ?>

View File

@ -31,21 +31,21 @@
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule host checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule host downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
@ -71,7 +71,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled host problem',
@ -91,7 +91,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('ok'); ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled host problem',
@ -133,7 +133,7 @@
),
$inDowntimeCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'List %u host currently in downtime',
@ -158,7 +158,7 @@
),
$commentCount
) ?>">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment'); ?>
<?= sprintf(
$this->translatePlural(
'List %u host comment',

View File

@ -50,16 +50,16 @@
</td>
<td>
<?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service') ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
$comment->service, $comment->service_display_name, $comment->host, $comment->host_display_name
) ?>
<?php else: ?>
<?= $this->icon('host') ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($comment->host, $comment->host_display_name) ?>
<?php endif ?>
<br>
<?= $this->icon('comment', null, array('aria-hidden' => 'true')); ?> <?= isset($comment->author)
<?= $this->icon('comment', $this->translate('Comment')); ?> <?= isset($comment->author)
? '[' . $comment->author . '] '
: '';
?><?= $this->escape($comment->comment); ?>

View File

@ -4,9 +4,7 @@ use Icinga\Web\Url;
$selfUrl = 'monitoring/list/hosts';
$currentUrl = Url::fromRequest()->getRelativeUrl();
?>
<h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?= $this->qlink(sprintf($this->translate('%s hosts:'), $this->stats->hosts_total), $selfUrl); ?>
<span class="badges">
<?php if($this->stats->hosts_up): ?>
@ -81,4 +79,4 @@ $currentUrl = Url::fromRequest()->getRelativeUrl();
</span>
<?php endif; ?>
</span>
</h1>
</div>

View File

@ -1,10 +1,10 @@
<?php
use Icinga\Web\Url;
$selfUrl = 'monitoring/list/services';
$currentUrl = Url::fromRequest()->getRelativeUrl();
?><h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?= $this->qlink(sprintf($this->translate('%s services:'), $this->stats->services_total), $selfUrl) ?>
<span class="badges">
<?php if ($this->stats->services_ok): ?>
@ -15,9 +15,7 @@ $currentUrl = Url::fromRequest()->getRelativeUrl();
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK')))
) ?></span>
<?php endif ?>
<?php
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
$pre = 'services_' . $state;
if ($this->stats->$pre) {
@ -70,7 +68,6 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
echo "</span>\n";
}
}
?>
<?php if ($this->stats->services_pending): ?>
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 99))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
@ -81,5 +78,4 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
) ?></span>
<?php endif ?>
</span>
</h1>
</div>

View File

@ -20,7 +20,7 @@ foreach ($groupData as $groupName => $groupInfo): ?>
<div class="box contents">
<?php foreach ($groupInfo['contacts'] as $c): ?>
<div class="box entry">
<img aria-hidden="true" src="<?= $this->href('/static/gravatar', array('email' => $c->contact_email )) ?>" />
<?= $this->img('/static/gravatar', array('email' => $c->contact_email)); ?>
<a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $c->contact_name)

View File

@ -14,7 +14,7 @@
}
foreach ($contacts as $contact): ?>
<div class="contact">
<img aria-hidden="true" src="<?= $this->href('/static/gravatar', array('email' => $contact->contact_email )) ?>" />
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $contact->contact_name)

View File

@ -55,16 +55,16 @@ use Icinga\Module\Monitoring\Object\Service;
</td>
<td>
<?php if ($isService): ?>
<?= $this->icon('service') ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
$downtime->service, $downtime->service_display_name, $downtime->host, $downtime->host_display_name
) ?>
<?php else: ?>
<?= $this->icon('host') ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($downtime->host, $downtime->host_display_name) ?>
<?php endif ?>
<br>
<?= $this->icon('comment') ?> [<?= $this->escape($downtime->author) ?>] <?= $this->escape($downtime->comment) ?>
<?= $this->icon('comment', $this->translate('Comment')); ?> [<?= $this->escape($downtime->author) ?>] <?= $this->escape($downtime->comment) ?>
<br>
<small>
<?php if ($downtime->is_flexible): ?>

View File

@ -74,7 +74,7 @@ if ($hosts->count() === 0) {
}
if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
$icons[] = $this->icon('comment', $this->translate('Comment: ') . $host->host_last_comment);
$icons[] = $this->icon('comment', $this->translate('Last Comment: ') . $host->host_last_comment);
}
?>
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">

View File

@ -42,7 +42,7 @@ use Icinga\Module\Monitoring\Object\Service;
</td>
<td style="font-size: 0.8em">
<?php if ($isService): ?>
<?= $this->icon('service') ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
$notification->service,
$notification->service_display_name,
@ -50,7 +50,7 @@ use Icinga\Module\Monitoring\Object\Service;
$notification->host_display_name
) ?>
<?php else: ?>
<?= $this->icon('host') ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($notification->host, $notification->host_display_name) ?>
<?php endif ?>
<br>

View File

@ -90,7 +90,7 @@ foreach ($services as $service):
<?php endif ?>
<?php if (isset($service->service_last_comment) && $service->service_last_comment !== null): ?>
<?= $this->icon('comment', $this->translate('Comment: ') . $service->service_last_comment) ?>
<?= $this->icon('comment', $this->translate('Last Comment: ') . $service->service_last_comment) ?>
<?php endif ?>
<?php if (!$service->service_active_checks_enabled): ?>

View File

@ -9,8 +9,8 @@
<table class="objectlist">
<thead>
<tr>
<th><?= $this->icon('host', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Host'); ?></th>
<th><?= $this->icon('conf', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Service'); ?></th>
<th><?= $this->icon('host'); ?> <?= $this->translate('Host'); ?></th>
<th><?= $this->icon('conf'); ?> <?= $this->translate('Service'); ?></th>
</tr>
</thead>
<tbody>

View File

@ -1,11 +1,10 @@
<?php
use Icinga\Web\Url;
$selfUrl = Url::fromPath('monitoring/show/services', array('host' => $this->object->host_name));
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?>
<h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?php if ($object->stats->services_total > 0): ?>
<?= $this->qlink(sprintf($this->translatePlural('%d configured service:', '%d configured services:', $object->stats->services_total), $object->stats->services_total), $selfUrl) ?>
<?php else: ?>
@ -21,7 +20,6 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
) ?></span>
<?php endif ?>
<?php
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
$pre = 'services_' . $state;
if ($object->stats->$pre) {
@ -74,7 +72,6 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
echo "</span>\n";
}
}
?>
<?php if ($object->stats->services_pending): ?>
<span class="state pending<?= $currentUrl === $selfUrl->with('service_state', 99)->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
@ -85,5 +82,4 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
) ?></span>
<?php endif ?>
</span>
</h1>
</div>

View File

@ -19,21 +19,21 @@
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule service checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule service downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
@ -59,7 +59,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled service problem',
@ -79,7 +79,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('ok'); ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled service problem',
@ -119,7 +119,7 @@
$inDowntimeCount
),
$inDowntimeCount) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'List %u service currently in downtime',
@ -143,7 +143,7 @@
),
$commentCount
) ?>">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment'); ?>
<?= sprintf(
$this->translatePlural(
'List %u service comment',

View File

@ -36,7 +36,7 @@ if ($object->acknowledged): ?>
}
?>
<a href="<?= $ackLink ?>" data-base-target="_self">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?> <?= $this->translate('Acknowledge') ?>
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?>
</a>
<?php } else {
echo '&#45;';

View File

@ -40,7 +40,7 @@ if ($object->getType() === $object::TYPE_HOST) {
}
?>
<a href="<?= $reschedule ?>" data-base-target="_self">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Reschedule') ?>
</a>
<?php } // endif ?>

View File

@ -22,7 +22,7 @@ $command = array_shift($parts);
);
} ?>
<a href="<?= $processCheckResult ?>" data-base-target="_self">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reply') ?>
<?= $this->translate('Process check result') ?>
</a>
<?php endif ?>

View File

@ -16,7 +16,7 @@
}
?>
<a href="<?= $addCommentLink ?>" data-base-target="_self">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment') ?>
<?= $this->translate('Add comment') ?>
</a>
<?php } else {

View File

@ -12,7 +12,7 @@ if (! empty($object->contacts)) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Contacts'),
$this->icon('user', null, array('aria-hidden' => 'true')),
$this->icon('user'),
implode(', ', $list)
);
@ -31,7 +31,7 @@ if (! empty($object->contactgroups)) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Contactgroups'),
$this->icon('users', null, array('aria-hidden' => 'true')),
$this->icon('users'),
implode(', ', $list)
);

View File

@ -16,7 +16,7 @@
}
?>
<a href="<?= $scheduleDowntimeLink ?>" data-base-target="_self">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug') ?>
<?= $this->translate('Schedule downtime') ?>
</a>
<?php } else {

View File

@ -11,7 +11,7 @@ foreach ($object->hostgroups as $name => $alias) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Hostgroups'),
$this->icon('host', null, array('aria-hidden' => 'true')),
$this->icon('host'),
implode(', ', $list)
);

View File

@ -12,7 +12,7 @@ foreach ($object->servicegroups as $name => $alias) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Servicegroups'),
$this->icon('services', null, array('aria-hidden' => 'true')),
$this->icon('services'),
implode(', ', $list)
);

View File

@ -91,19 +91,19 @@ div.contacts div.notification-periods {
margin-top: 0.5em;
}
h1.tinystatesummary .badges {
div.tinystatesummary {
.page-header();
font-size: 1em;
.badges {
display: inline-block;
margin-bottom: 4px;
margin-left: 1em;
}
h1.tinystatesummary .state > a {
}
.state > a {
color: white;
font-size: 0.8em;
padding: 2px 5px;
}
h1.tinystatesummary .state.handled a {
}
}
/* State badges */

View File

@ -41,7 +41,7 @@ class AuthenticationPage extends Form
'note',
'external_note',
array(
'value' => $this->translate(
'value' => '<i aria-hidden="true" class="icon-info"></i>' . $this->translate(
'You\'re currently not authenticated using any of the web server\'s authentication '
. 'mechanisms. Make sure you\'ll configure such, otherwise you\'ll not be able to '
. 'log into Icinga Web 2.'
@ -50,7 +50,7 @@ class AuthenticationPage extends Form
'ViewHelper',
array(
'HtmlTag',
array('tag' => 'p', 'class' => 'icon-info info-box')
array('tag' => 'p', 'class' => 'info-box')
)
)
)

View File

@ -24,7 +24,20 @@
@colorPending: #77aaff;
@colorInvalid: #999;
/* Mixins */
.page-header(@borderSize: 2px; @fontSize: 2em; @textColor: @colorTextDarkDefault) {
font-size: @fontSize;
color: @textColor;
border-bottom: @borderSize solid @colorPetrol;
a {
text-decoration: none;
color: inherit;
&:hover {
text-decoration: underline;
}
}
}
/*** Base rules ***/
* {
@ -76,9 +89,7 @@ a:hover {
/* W3C Recommendation <http://www.w3.org/TR/CSS21/sample.html> (except h4) */
h1 {
font-size: 2em;
color: @colorTextDefault;
border-bottom: 2px solid @colorPetrol;
.page-header();
}
h2 {
@ -87,19 +98,16 @@ h2 {
}
h3 {
font-size: 1.17em;
color: @colorTextDefault;
border-bottom: 1px solid @colorPetrol;
.page-header(1px, 1.17em);
}
h4 {
font-size: 1em;
color: @colorPetrol;
font-size: 1em;
color: @colorPetrol;
}
h5 {
font-size: .83em;
border-bottom: 1px solid @colorPetrol;
.page-header(1px, .83em);
}
h6 {
@ -107,17 +115,19 @@ h6 {
color: @colorPetrol;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
text-decoration: none;
color: inherit;
}
h1, h2, h3, h4, h5, h6 {
a {
text-decoration: none;
color: inherit;
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
text-decoration: underline;
&:hover {
text-decoration: underline;
}
}
}
button {
font-family: inherit;
font-family: inherit;
}
#fontsize-calc {
@ -128,6 +138,4 @@ button {
position: absolute;
top: -2em;
}
/*** END of Base rules */
/*** END of Base rules */

View File

@ -284,9 +284,9 @@ a:focus {
position: absolute;
display: block;
left: -999em;
width: 10.8em !important;
width: 10.4em !important;
top: 0em;
text-align: left !important;
top: 0.4em;
padding: 0.8em;
background-color: white;
z-index: 4;

View File

@ -335,14 +335,25 @@
},
handleAnchor: function(query) {
var element = $(query);
if (element.length > 0) {
var $element = $(query);
if ($element.length > 0) {
// Try to find the first header. It is more pleasant to users
// to select the header instead a container
var $header = $element.find(':header:first');
if ($header.length > 0) {
$element = $header;
} else {
var $input = $element.find(':header:first');
if ($input.length > 0) {
$element = $input
}
}
// If we want to focus an element which has no tabindex
// add one that we can focus is
if (element.prop('tabindex') < 0) {
element.prop('tabindex', 0);
if ($element.prop('tabindex') < 0) {
$element.prop('tabindex', 0);
}
element.focus();
$element.focus();
}
},
@ -404,7 +415,8 @@
event.preventDefault();
// This is an anchor only
if (href.substr(0, 1) === '#' && href.substr(1, 1) !== '!') {
if (href.substr(0, 1) === '#' && href.length > 1
&& href.substr(1, 1) !== '!') {
self.handleAnchor(href);
return;
}
@ -506,14 +518,6 @@
return $target;
},
/*
hrefIsHashtag: function(href) {
// WARNING: IE gives full URL :(
// Also it doesn't support negativ indexes in substr
return href.substr(href.length - 1, 1) == '#';
},
*/
unbindGlobalHandlers: function () {
$.each(self.icinga.behaviors, function (name, behavior) {
behavior.unbind($(document));