Merge branch 'feature/organize-headings-7976'

resolves #7976
This commit is contained in:
Marius Hein 2015-02-23 16:07:14 +01:00
commit ea2a17a76c
47 changed files with 363 additions and 251 deletions

View File

@ -66,6 +66,7 @@ class ConfigController extends ActionController
$allowedActions[] = 'roles'; $allowedActions[] = 'roles';
} }
$this->firstAllowedAction = array_shift($allowedActions); $this->firstAllowedAction = array_shift($allowedActions);
$this->getTabs()->setTitle($this->translate('Config Navigation'));
} }
public function devtoolsAction() public function devtoolsAction()

View File

@ -45,6 +45,7 @@ class RolesController extends ActionController
'title' => $this->translate('Roles'), 'title' => $this->translate('Roles'),
'url' => 'roles' 'url' => 'roles'
)); ));
$this->getTabs()->setTitle($this->translate('Role Configuration'));
} }
/** /**

View File

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

View File

@ -2,7 +2,7 @@
<?= $this->tabs->showOnlyCloseButton() ?> <?= $this->tabs->showOnlyCloseButton() ?>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="0" id="authentication-create"> <h1 tabindex="-1" id="authentication-create">
<?= $this->translate('Create New Authentication Backend'); ?> <?= $this->translate('Create New Authentication Backend'); ?>
</h1> </h1>
<p> <p>

View File

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

View File

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

View File

@ -2,21 +2,10 @@
<?= $tabs; ?> <?= $tabs; ?>
</div> </div>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<h1 tabindex="0" id="authentication-reorder"> <h1 tabindex="-1" id="authentication-reorder">
<?= t('Authentication Configuration'); ?> <?= $this->translate('Authentication Configuration'); ?>
</h1> </h1>
<div class="skip-links skip-links-inline"> <h2 tabindex="-1" id="authentication-new-backend" class="sr-only">
<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'); ?> <?= t('New Authentication Backend'); ?>
</h2> </h2>
<p> <p>
@ -24,7 +13,7 @@
<?= $this->icon('plus'); ?><?= $this->translate('Create A New Authentication Backend'); ?> <?= $this->icon('plus'); ?><?= $this->translate('Create A New Authentication Backend'); ?>
</a> </a>
</p> </p>
<h2 tabindex="0" id="authentication-reorder" class="sr-only"> <h2 tabindex="-1" id="authentication-reorder" class="sr-only">
<?= t('Reorder Authentication Backends'); ?> <?= t('Reorder Authentication Backends'); ?>
</h2> </h2>
<div id="authentication-reorder-form"> <div id="authentication-reorder-form">

View File

@ -1,24 +1,25 @@
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<h1><?= $this->escape($module->getTitle()) ?></h1>
</div> </div>
<div class="content"> <div class="content">
<?php if (! $module): ?> <h1 tabindex="-1">
<?= $this->translate('There is no such module installed.') ?> <?= $this->escape($module->getTitle()) ?>
<?php return; endif ?> </h1>
<?php <?php if (! $module): ?>
$dependencies = $module->getDependencies(); <?= $this->translate('There is no such module installed.') ?>
$restrictions = $module->getProvidedRestrictions(); <?php return; endif ?>
$permissions = $module->getProvidedPermissions(); <?php
$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled' $dependencies = $module->getDependencies();
$restrictions = $module->getProvidedRestrictions();
?> $permissions = $module->getProvidedPermissions();
<table class="avp"> $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
<tr> ?>
<table class="avp">
<tr>
<th><?= $this->escape($this->translate('Name')) ?></th> <th><?= $this->escape($this->translate('Name')) ?></th>
<td><?= $this->escape($module->getName()) ?></td> <td><?= $this->escape($module->getName()) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->translate('State') ?></th> <th><?= $this->translate('State') ?></th>
<td><?= $state ?><?php if ($state === 'enabled'): ?> <td><?= $state ?><?php if ($state === 'enabled'): ?>
<?= $this->qlink($this->translate('disable'), 'config/moduledisable', array( <?= $this->qlink($this->translate('disable'), 'config/moduledisable', array(
@ -31,40 +32,43 @@ $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : '
)) ?> )) ?>
<?php endif ?> <?php endif ?>
</td> </td>
<tr> <tr>
<th><?= $this->escape($this->translate('Version')) ?></th> <th><?= $this->escape($this->translate('Version')) ?></th>
<td><?= $this->escape($module->getVersion()) ?></td></tr> <td><?= $this->escape($module->getVersion()) ?></td></tr>
<tr> <tr>
<th><?= $this->escape($this->translate('Description')) ?></th> <th><?= $this->escape($this->translate('Description')) ?></th>
<td><?= nl2br($this->escape($module->getDescription())) ?></td> <td><?= nl2br($this->escape($module->getDescription())) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->escape($this->translate('Dependencies')) ?></th> <th><?= $this->escape($this->translate('Dependencies')) ?></th>
<td><?php <td>
<?php
if (empty($dependencies)): if (empty($dependencies)):
echo $this->translate('This module has no dependencies'); echo $this->translate('This module has no dependencies');
else: foreach ($dependencies as $name => $versionString): ?>
else: foreach ($dependencies as $name => $versionString): ?> <strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
<strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br /> <?php endforeach; endif ?>
<?php endforeach; endif ?></td> </td>
</tr> </tr>
<?php if (! empty($permissions)): ?> <?php if (! empty($permissions)): ?>
<tr> <tr>
<th><?= $this->escape($this->translate('Permissions')) ?></th> <th><?= $this->escape($this->translate('Permissions')) ?></th>
<td><?php foreach ($permissions as $permission): ?> <td>
<strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br /> <?php foreach ($permissions as $permission): ?>
<?php endforeach ?></td> <strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
</tr> <?php endforeach ?>
<?php endif ?> </td>
<?php if (! empty($restrictions)): ?> </tr>
<tr> <?php endif ?>
<?php if (! empty($restrictions)): ?>
<tr>
<th><?= $this->escape($this->translate('Restrictions')) ?></th> <th><?= $this->escape($this->translate('Restrictions')) ?></th>
<td><?php foreach ($restrictions as $restriction): ?> <td>
<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br /> <?php foreach ($restrictions as $restriction): ?>
<?php endforeach ?></td> <strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
</tr> <?php endforeach ?>
<?php endif ?> </td>
</table> </tr>
<?php endif ?>
</table>
</div> </div>

View File

@ -1,11 +1,11 @@
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<h1><?= $this->translate('Installed Modules') ?></h1>
<?= $this->paginationControl($modules) ?> <?= $this->paginationControl($modules) ?>
</div> </div>
<div class="content"> <div class="content">
<table class="action" data-base-target="_next"> <h1 tabindex="-1"><?= $this->translate('Installed Modules') ?></h1>
<table class="action" data-base-target="_next">
<tbody> <tbody>
<?php foreach ($modules as $module): ?> <?php foreach ($modules as $module): ?>
<tr> <tr>
@ -32,5 +32,5 @@
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -2,21 +2,10 @@
<?= $tabs; ?> <?= $tabs; ?>
</div> </div>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<h1 tabindex="0" id="resource-index"> <h1 tabindex="-1" id="resource-index">
<?= t('Resource Configuration'); ?> <?= t('Resource Configuration'); ?>
</h1> </h1>
<div class="skip-links skip-links-inline"> <h2 tabindex="-1" id="resource-new-resource" class="sr-only">
<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'); ?> <?= t('Create New Resource'); ?>
</h2> </h2>
<p> <p>
@ -24,7 +13,7 @@
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?> <?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?>
</a> </a>
</p> </p>
<h2 tabindex="0" id="resource-edit-resource" class="sr-only"> <h2 tabindex="-1" id="resource-edit-resource" class="sr-only">
<?= t('Edit Existing Resources'); ?> <?= t('Edit Existing Resources'); ?>
</h2> </h2>
<table class="action" id="resource-edit-table"> <table class="action" id="resource-edit-table">

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<div class="controls"> <div class="controls">
<?= $tabs; ?> <?= $tabs; ?>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="preferences"><?= $this->translate('Preferences'); ?></h1>
<?= $form; ?> <?= $form; ?>
</div> </div>

View File

@ -1,8 +1,10 @@
<div class="controls" data-base-target="_main"> <div class="controls" data-base-target="_main">
<?= $tabs ?> <?= $tabs ?>
<h1><?= $this->translate('Roles') ?></h1>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="roles-index">
<?= $this->translate('Roles') ?>
</h1>
<div> <div>
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?> <?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
<?= $this->translate('No roles found.') ?> <?= $this->translate('No roles found.') ?>
@ -64,6 +66,9 @@
</tbody> </tbody>
</table> </table>
<?php endif ?> <?php endif ?>
<h2 tabindex="-1" id="roles-index-new" class="sr-only">
<?= $this->translate('Create New Role'); ?>
</h2>
<a data-base-target="_next" href="<?= $this->href('roles/new') ?>"> <a data-base-target="_next" href="<?= $this->href('roles/new') ?>">
<?= $this->translate('New Role') ?> <?= $this->translate('New Role') ?>
</a> </a>

View File

@ -1,7 +1,9 @@
<div class="controls"> <div class="controls">
<?= $tabs->showOnlyCloseButton() ?> <?= $tabs->showOnlyCloseButton() ?>
<h1><?= $this->translate('New Role') ?></h1>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="roles-new">
<?= $this->translate('New Role') ?>
</h1>
<?= $form ?> <?= $form ?>
</div> </div>

View File

@ -1,7 +1,9 @@
<div class="controls"> <div class="controls">
<?= $tabs->showOnlyCloseButton() ?> <?= $tabs->showOnlyCloseButton() ?>
<h1><?= sprintf($this->translate('Remove Role %s'), $name) ?></h1>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="roles-remove">
<?= sprintf($this->translate('Remove Role %s'), $name) ?>
</h1>
<?= $form ?> <?= $form ?>
</div> </div>

View File

@ -1,7 +1,9 @@
<div class="controls"> <div class="controls">
<?= $tabs->showOnlyCloseButton() ?> <?= $tabs->showOnlyCloseButton() ?>
<h1><?= sprintf($this->translate('Update Role %s'), $name) ?></h1>
</div> </div>
<div class="content"> <div class="content">
<h1 tabindex="-1" id="roles-update">
<?= sprintf($this->translate('Update Role %s'), $name) ?>
</h1>
<?= $form ?> <?= $form ?>
</div> </div>

View File

@ -676,9 +676,9 @@ class FilterEditor extends AbstractWidget
public function render() public function render()
{ {
if (! $this->preservedUrl()->getParam('modifyFilter')) { if (! $this->preservedUrl()->getParam('modifyFilter')) {
return $this->renderSearch() . $this->shorten($this->filter, 50); $filterEditor = $this->renderSearch() . $this->shorten($this->filter, 50);
} } else {
return $this->renderSearch() $filterEditor = $this->renderSearch()
. '<form action="' . '<form action="'
. Url::fromRequest() . Url::fromRequest()
. '" class="filterEditor" method="POST">' . '" class="filterEditor" method="POST">'
@ -692,6 +692,14 @@ class FilterEditor extends AbstractWidget
. '</form>'; . '</form>';
} }
return sprintf(
'<div class="filter-editor dontprint">'
. '<h2 tabindex="-1" class="sr-only">%s</h2>%s</div>',
t('Filters'),
$filterEditor
);
}
protected function shorten($string, $length) protected function shorten($string, $length)
{ {
if (strlen($string) > $length) { if (strlen($string) > $length) {

View File

@ -133,6 +133,13 @@ class SortBox extends AbstractWidget
if ($this->request) { if ($this->request) {
$form->populate($this->request->getParams()); $form->populate($this->request->getParams());
} }
return $form;
return sprintf(
'<div class="sort-box dontprint">'
. '<h2 tabindex="-1" class="sr-only">%s</h2>%s%s</div>',
t('Sort Criteria'),
t('Sort by'),
(string) $form
);
} }
} }

View File

@ -19,6 +19,7 @@ class Tabs extends AbstractWidget implements Countable
* @var string * @var string
*/ */
private $baseTpl = <<< 'EOT' private $baseTpl = <<< 'EOT'
{HEADER}
<ul class="tabs"> <ul class="tabs">
{TABS} {TABS}
{DROPDOWN} {DROPDOWN}
@ -26,6 +27,13 @@ class Tabs extends AbstractWidget implements Countable
</ul> </ul>
EOT; EOT;
/**
* Template used for the header
*
* @type string
*/
private $headerTpl = '<h2 class="sr-only">{TITLE}</h2>';
/** /**
* Template used for the tabs dropdown * Template used for the tabs dropdown
* *
@ -87,6 +95,13 @@ EOT;
*/ */
private $closeTab = true; private $closeTab = true;
/**
* Title of the tab navigation
*
* @type string
*/
private $title;
/** /**
* Set whether the current tab is closable * Set whether the current tab is closable
*/ */
@ -309,11 +324,21 @@ EOT;
} }
$close = $this->closeTab ? $this->renderCloseTab() : ''; $close = $this->closeTab ? $this->renderCloseTab() : '';
$html = $this->baseTpl; return str_replace(
$html = str_replace('{TABS}', $tabs, $html); array(
$html = str_replace('{DROPDOWN}', $drop, $html); '{TABS}',
$html = str_replace('{CLOSE}', $close, $html); '{DROPDOWN}',
return $html; '{CLOSE}',
'{HEADER}'
),
array(
$tabs,
$drop,
$close,
$this->renderHeader()
),
$this->baseTpl
);
} }
public function __toString() public function __toString()
@ -372,4 +397,30 @@ EOT;
$tabextension->apply($this); $tabextension->apply($this);
return $this; return $this;
} }
/**
* Set the title of the tab navigation
*
* @param string $title
* @return self
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Render the title into the header template
*
* @return string
*/
public function renderHeader()
{
if (! $this->title) {
return '';
}
return str_replace('{TITLE}', $this->title, $this->headerTpl);
}
} }

View File

@ -39,6 +39,8 @@ class Monitoring_AlertsummaryController extends Controller
$this->notificationData = $this->createNotificationData(); $this->notificationData = $this->createNotificationData();
$this->problemData = $this->createProblemData(); $this->problemData = $this->createProblemData();
$tabs->setTitle($this->translate('Alertsummary Navigation'));
} }
/** /**

View File

@ -717,6 +717,7 @@ class Monitoring_ListController extends Controller
private function createTabs() private function createTabs()
{ {
$tabs = $this->getTabs(); $tabs = $this->getTabs();
$tabs->setTitle($this->translate('Monitoring Navigation'));
if (in_array($this->_request->getActionName(), array( if (in_array($this->_request->getActionName(), array(
'hosts', 'hosts',
'services', 'services',

View File

@ -25,7 +25,7 @@ class Monitoring_ProcessController extends Controller
'title' => $this->translate('Monitoring Health'), 'title' => $this->translate('Monitoring Health'),
'url' =>'monitoring/process/info' 'url' =>'monitoring/process/info'
) )
); )->setTitle($this->translate('Process Information'));
} }
/** /**

View File

@ -19,7 +19,8 @@ class Monitoring_TimelineController extends Controller
$this->getTabs()->add($action, array( $this->getTabs()->add($action, array(
'title' => $title, 'title' => $title,
'url' => Url::fromRequest() 'url' => Url::fromRequest()
))->activate($action); ))->activate($action)
->setTitle($this->translate('Timeline Navigation'));
$this->view->title = $title; $this->view->title = $title;
} }

View File

@ -1,6 +1,9 @@
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint"> <div style="margin: 1em;" class="dontprint">
<h2 tabindex="-1" class="sr-only">
<?= $this->translate('Filters'); ?>
</h2>
<?= $intervalBox; ?> <?= $intervalBox; ?>
</div> </div>
<?= $this->widget('limiter') ?> <?= $this->widget('limiter') ?>
@ -8,25 +11,33 @@
</div> </div>
<div class="content alertsummary"> <div class="content alertsummary">
<!-- <h1><?= $this->translate('Alert summary'); ?></h1> --> <h1 tabindex="-1">
<?= $this->translate('Alert summary'); ?>
</h1>
<div class="hbox"> <div class="hbox">
<div class="hbox-item"> <div class="hbox-item">
<h2><?= $this->translate('Notifications and Problems'); ?></h2> <h2 tabindex="-1" id="alertsummary-notifications">
<?= $this->translate('Notifications and Problems'); ?>
</h2>
<div style="width: 400px; height: 400px;"> <div style="width: 400px; height: 400px;">
<?= $defectChart->render(); ?> <?= $defectChart->render(); ?>
</div> </div>
</div> </div>
<div class="hbox-item"> <div class="hbox-item">
<h2><?= $this->translate('Time to Reaction (Ack, Recover)'); ?></h2> <h2 tabindex="-1" id="alertsummary-reaction-time">
<?= $this->translate('Time to Reaction (Ack, Recover)'); ?>
</h2>
<div style="width: 400px; height: 400px;"> <div style="width: 400px; height: 400px;">
<?= $healingChart->render(); ?> <?= $healingChart->render(); ?>
</div> </div>
</div> </div>
</div> </div>
<h2><?= $this->translate('Trend'); ?></h2> <h2 tabindex="-1" id="alertsummary-trend">
<?= $this->translate('Trend'); ?>
</h2>
<div class="alertsummary-flex-container"> <div class="alertsummary-flex-container">
<div class="alertsummary-flex"> <div class="alertsummary-flex">
@ -53,7 +64,9 @@
</div> </div>
<?php if ($this->recentAlerts): ?> <?php if ($this->recentAlerts): ?>
<h1><?= $this->translate('Top 5 Recent Alerts'); ?></h1> <h2 tabindex="-1" id="alertsummary-top5">
<?= $this->translate('Top 5 Recent Alerts'); ?>
</h2>
<div class="alertsummary-flex-container"> <div class="alertsummary-flex-container">
<div class="alertsummary-flex"> <div class="alertsummary-flex">
@ -66,7 +79,9 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
<h1><?= $this->translate('History'); ?></h1> <h2 tabindex="-1" id="alertsummary-history">
<?= $this->translate('History'); ?>
</h2>
<div class="alertsummary-flex-container"> <div class="alertsummary-flex-container">
<div class="alertsummary-flex"> <div class="alertsummary-flex">
<?= $this->partial('list/notifications.phtml', array( <?= $this->partial('list/notifications.phtml', array(

View File

@ -3,6 +3,7 @@
<?= $this->render('partials/host/servicesummary.phtml') ?> <?= $this->render('partials/host/servicesummary.phtml') ?>
</div> </div>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<h1 tabindex="-1"><?= $this->translate('Host Detail Information') ?></h1>
<?= $this->render('show/components/output.phtml') ?> <?= $this->render('show/components/output.phtml') ?>
<?= $this->render('show/components/grapher.phtml') ?> <?= $this->render('show/components/grapher.phtml') ?>

View File

@ -1,15 +1,14 @@
<?php if (false === $this->compact): ?> <?php if (false === $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortControl ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?> <?= $this->widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?>
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<h1 tabindex="-1"><?= $this->translate('Comments') ?></h1>
<?php if (count($comments) === 0): ?> <?php if (count($comments) === 0): ?>
<?= $this->translate('No comments matching the filter'); ?> <?= $this->translate('No comments matching the filter'); ?>
</div> </div>

View File

@ -4,6 +4,9 @@
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<h1 tabindex="-1">
<?= $this->translate('Contact Groups'); ?>
</h1>
<div class="boxview" data-base-target="_next"> <div class="boxview" data-base-target="_next">
<?php <?php

View File

@ -1,12 +1,14 @@
<div class="controls"> <?php if (false === $this->compact): ?>
<div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em"> <?= $this->sortControl ?>
<?= $this->sortControl->render($this); ?> <?= $this->widget('limiter', array('url' => $this->url, 'max' => $contacts->count())); ?>
</div>
<?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?>
<div data-base-target="_next" class="content contacts"> <div data-base-target="_next" class="content contacts">
<h1 tabindex="-1"><?= $this->translate('Contacts') ?></h1>
<?php <?php
if (count($contacts) === 0) { if (count($contacts) === 0) {
echo mt('monitoring', 'No contacts matching the filter'); echo mt('monitoring', 'No contacts matching the filter');

View File

@ -4,23 +4,17 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> ?>
<?php if (false === $this->compact): ?> <?php if (false === $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortControl ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
<?php if (! $this->filterEditor): ?>
<?= $this->filterPreview ?>
<?php endif; ?>
</div>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?> <?= $this->widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?>
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
<h1 tabindex="-1"><?= $this->translate('Downtimes'); ?></h1>
<?php if (count($downtimes) === 0): ?> <?php if (count($downtimes) === 0): ?>
<?= $this->translate('No active downtimes'); ?> <?= $this->translate('No active downtimes'); ?>
</div> </div>

View File

@ -2,18 +2,21 @@
use Icinga\Data\Filter\Filter; use Icinga\Data\Filter\Filter;
use Icinga\Web\Widget\Chart\HistoryColorGrid; use Icinga\Web\Widget\Chart\HistoryColorGrid;
?> ?>
<?php if (! $compact): ?>
<? if (! $compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<div class="fake-controls"> <div class="fake-controls">
<h2 tabindex="-1" class="sr-only">
<?= $this->translate('Filters'); ?>
</h2>
<?= $form ?> <?= $form ?>
</div> </div>
</div> </div>
<? endif; ?> <div class="content" data-base-target="_next">
<h1 tabindex="-1"><?= $this->translate('Event Grid'); ?></h1>
<div class="content" data-base-target="_next"> <?php else: ?>
<div class="content" data-base-target="_next">
<?php endif; ?>
<?php <?php
$settings = array( $settings = array(

View File

@ -4,24 +4,21 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> ?>
<?php if (false === $this->compact): ?> <?php if (false === $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortControl ?>
<div style="float: right">
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
</div>
</div>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?> <?= $this->widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
<h1 tabindex="-1"><?= $this->translate('Event History') ?></h1>
<?php else: ?>
<div class="content">
<?php endif; ?>
<?php if (empty($history)): ?> <?php if (empty($history)): ?>
<?= $this->translate('No history events matching the filter') ?> <?= $this->translate('No history events matching the filter') ?>
</div> </div>

View File

@ -3,14 +3,13 @@
<?php else: ?> <?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortControl->render($this); ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?> <?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<div class="content"> <div class="content">
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
<h1 tabindex="-1"><?= $this->translate('Host Groups') ?></h1>
<?php endif ?> <?php endif ?>
<?php <?php
if (count($hostgroups) === 0) { if (count($hostgroups) === 0) {

View File

@ -9,9 +9,8 @@ if ($this->compact): ?>
<div style="margin: 1em;" class="dontprint"> <div style="margin: 1em;" class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<?= $this->render('list/components/hostssummary.phtml') ?> <?= $this->render('list/components/hostssummary.phtml') ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div> </div>
<?= $this->sortControl->render($this) ?>
<?= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?> <?= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
<?= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?> <?= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?>
@ -19,6 +18,7 @@ if ($this->compact): ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
<h1 tabindex="-1"><?= $this->translate('Hosts') ?></h1>
<?php <?php
endif; endif;
@ -31,7 +31,6 @@ if ($hosts->count() === 0) {
return; return;
} }
?> ?>
<table <table
data-base-target="_next" data-base-target="_next"
class="action multiselect" class="action multiselect"

View File

@ -4,19 +4,18 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> ?>
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="dontprint" style="margin: 1em;"> <?= $this->sortControl->render($this) ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div>
<?= $this->widget('limiter') ?> <?= $this->widget('limiter') ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<h1 tabindex="-1"><?= $this->translate('Notifications'); ?></h1>
<?php else: ?>
<div class="content">
<?php endif ?>
<?php if (count($notifications) === 0): ?> <?php if (count($notifications) === 0): ?>
<?= $this->translate('No notifications matching the filter') ?> <?= $this->translate('No notifications matching the filter') ?>
<?php return; endif ?> <?php return; endif ?>

View File

@ -6,12 +6,11 @@ use Icinga\Module\Monitoring\Object\Service;
<?php if (!$this->compact): ?> <?php if (!$this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortControl; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl; ?>
</div>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<h1 tabindex="-1"><?= $this->translate('Service Grid') ?></h1>
<table class="pivot servicestates"> <table class="pivot servicestates">
<?php <?php
$hasHeader = false; $hasHeader = false;

View File

@ -3,14 +3,13 @@
<?php else: ?> <?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortControl->render($this); ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->widget('limiter')->setMaxLimit(count($servicegroups)); ?> <?= $this->widget('limiter')->setMaxLimit(count($servicegroups)); ?>
<?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<div class="content"> <div class="content">
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
<h1 tabindex="-1"><?= $this->translate('Service Groups') ?></h1>
<?php endif ?> <?php endif ?>
<?php <?php
if (count($servicegroups) === 0) { if (count($servicegroups) === 0) {

View File

@ -10,10 +10,8 @@ if (!$this->compact): ?>
<div style="margin: 1em;" class="dontprint"> <div style="margin: 1em;" class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<?= $this->render('list/components/servicesummary.phtml') ?> <?= $this->render('list/components/servicesummary.phtml') ?>
<div style="float: right">
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
</div>
</div> </div>
<?= $this->sortControl ?>
<?php if ($this->limit === 0): ?> <?php if ($this->limit === 0): ?>
<?= $this->widget('limiter') ?> <?= $this->widget('limiter') ?>
<?php else: ?> <?php else: ?>
@ -24,6 +22,7 @@ if (!$this->compact): ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
<h1 tabindex="-1"><?= $this->translate('Services') ?></h1>
<?php else: ?> <?php else: ?>
<div class="content"> <div class="content">

View File

@ -3,7 +3,9 @@
<?php endif ?> <?php endif ?>
<?php if (($hostCount = count($objects)) > 0): ?> <?php if (($hostCount = count($objects)) > 0): ?>
<div class="hbox-item"> <div class="hbox-item">
<strong><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?></strong> <h1 tabindex="-1">
<?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?>
</h1>
</div> </div>
<div class="hbox-item"> <div class="hbox-item">
&nbsp;<?= $hostStatesPieChart; ?> &nbsp;<?= $hostStatesPieChart; ?>

View File

@ -4,7 +4,9 @@
<?php if (($serviceCount = count($objects)) > 0): ?> <?php if (($serviceCount = count($objects)) > 0): ?>
<div class="hbox"> <div class="hbox">
<div class="hbox-item" style="width: 6em;"> <div class="hbox-item" style="width: 6em;">
<strong><?= sprintf($this->translatePlural('Service (%u)', 'Services (%u)', $serviceCount), $serviceCount); ?></strong> <h1 tabindex="-1">
<?= sprintf($this->translatePlural('Service (%u)', 'Services (%u)', $serviceCount), $serviceCount); ?>
</h1>
</div> </div>
<div class="hbox-item"> <div class="hbox-item">
&nbsp;<?= $serviceStatesPieChart; ?> &nbsp;<?= $serviceStatesPieChart; ?>

View File

@ -9,15 +9,23 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
</div> </div>
<div class="content processinfo"> <div class="content processinfo">
<h1 tabindex="-1">
<?= $this->translate('Monitoring Health'); ?>
</h1>
<div class="boxview"> <div class="boxview">
<div class="box left"> <div class="box left">
<h2><?= $this->translate('Feature Commands') ?></h2> <h2 tabindex="-1" id="process-feature-command">
<?= $this->translate('Feature Commands') ?>
</h2>
<?= $this->toggleFeaturesForm ?> <?= $this->toggleFeaturesForm ?>
</div> </div>
<div class="box left"> <div class="box left">
<h2><?= $this->translate('Process Info') ?></h2> <h2 tabindex="-1" id="process-process-info">
<?= $this->translate('Process Info') ?>
</h2>
<table class="avp"> <table class="avp">
<tbody> <tbody>
<tr> <tr>
@ -68,9 +76,13 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
</div> </div>
<div class="box left"> <div class="box left">
<h2><?= $this->translate('Performance Info') ?></h2> <h2 tabindex="-1" id="process-performance-info">
<?= $this->translate('Performance Info') ?>
</h2>
<h3><?= $this->translate('Object summaries') ?></h3> <h3 tabindex="-1" id="process-object-summaries">
<?= $this->translate('Object summaries') ?>
</h3>
<table class="avp"> <table class="avp">
<thead> <thead>
<tr> <tr>
@ -118,7 +130,9 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
</tbody> </tbody>
</table> </table>
<h3><?= $this->translate('Active checks') ?></h3> <h3 tabindex="-1" id="process-active-checks">
<?= $this->translate('Active checks') ?>
</h3>
<table class="avp"> <table class="avp">
<thead> <thead>
<tr> <tr>
@ -148,7 +162,9 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
</tbody> </tbody>
</table> </table>
<h3><?= $this->translate('Passive checks') ?></h3> <h3 tabindex="-1" id="process-passive-checks">
<?= $this->translate('Passive checks') ?>
</h3>
<table class="avp"> <table class="avp">
<tbody> <tbody>
<tr> <tr>

View File

@ -4,6 +4,7 @@
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content tactical"> <div class="content tactical">
<h1 tabindex="-1"><?= $this->translate('Tactical Overview') ?></h1>
<div class="boxview" data-base-target="_next"> <div class="boxview" data-base-target="_next">
<?php if ($this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?> <?php if ($this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?>
<?= $this->render('tactical/components/problem_hosts.phtml'); ?> <?= $this->render('tactical/components/problem_hosts.phtml'); ?>

View File

@ -10,6 +10,9 @@ $firstRow = !$beingExtended;
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint"> <div style="margin: 1em;" class="dontprint">
<h2 tabindex="-1" class="sr-only">
<?= $this->translate('Filters') ?>
</h2>
<?= $intervalBox; ?> <?= $intervalBox; ?>
</div> </div>
<div style="margin: 1em;" class="timeline-legend"> <div style="margin: 1em;" class="timeline-legend">
@ -22,6 +25,7 @@ $firstRow = !$beingExtended;
</div> </div>
</div> </div>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<h1 tabindex="-1"><?= $this->translate('Timeline'); ?></h1>
<div class="timeline"> <div class="timeline">
<?php endif ?> <?php endif ?>
<?php if ($switchedContext): ?> <?php if ($switchedContext): ?>

View File

@ -198,3 +198,8 @@ hr.command-separator {
border: none; border: none;
border-bottom: 2px solid @colorPetrol; border-bottom: 2px solid @colorPetrol;
} }
.sort-box {
float: right;
margin-right: 1em;
}

View File

@ -270,7 +270,7 @@ a:focus {
/* Accessibility Skip Links */ /* Accessibility Skip Links */
.skip-links { .skip-links {
position: absolute; position: relative;
opacity: 1; opacity: 1;
ul { ul {
list-style-type: none; list-style-type: none;
@ -286,7 +286,6 @@ a:focus {
left: -999em; left: -999em;
box-sizing: content-box; box-sizing: content-box;
width: 10.4em !important; width: 10.4em !important;
top: 0em;
text-align: left !important; text-align: left !important;
padding: 0.8em; padding: 0.8em;
background-color: white; background-color: white;
@ -301,5 +300,8 @@ a:focus {
} }
} }
.skip-links-inline { .skip-links-inline {
margin-top: -3.5em; ul > li > a {
width: 14em !important;
top: -3em;
}
} }

View File

@ -337,21 +337,29 @@
handleAnchor: function(query) { handleAnchor: function(query) {
var $element = $(query); var $element = $(query);
if ($element.length > 0) { if ($element.length > 0) {
// Try to find the first header. It is more pleasant to users // TODO(mh): Some elements are missing to place the right focus
// to select the header instead a container // This is a fixed workarround until all header took place
var $header = $element.find(':header:first');
if ($header.length > 0) { var $item = $element.find(':header:first').nextUntil(':header:first').next();
$element = $header; if ($item.length > 0) {
} else { $element = $item;
var $input = $element.find(':header:first');
if ($input.length > 0) {
$element = $input
} }
/*
var focusQueries = ['h1:first', ':header:first', ':input:first'];
$.each(focusQueries, function(index,q) {
var $item = $element.find(q);
if ($item.length > 0) {
$element = $item;
return false;
} }
});
*/
// If we want to focus an element which has no tabindex // If we want to focus an element which has no tabindex
// add one that we can focus is // add one that we can focus is
if ($element.prop('tabindex') < 0) { if ($element.prop('tabindex') < 0) {
$element.prop('tabindex', 0); $element.prop('tabindex', '-1');
} }
$element.focus(); $element.focus();
} }