Merge branch 'feature/dope-layout-5543'

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-02 11:16:35 +02:00
commit 54bb99a96d
205 changed files with 7290 additions and 5610 deletions

View File

@ -19,6 +19,7 @@ use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Security\SecurityException;
use Icinga\Web\Controller;
use Icinga\Web\Notification;
use Icinga\Web\Url;
use Icinga\Web\Widget;
/**
@ -55,13 +56,13 @@ class ConfigController extends Controller
$tabs = $this->getTabs();
$tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('User Backends'),
'label' => $this->translate('Users'),
'url' => 'config/userbackend',
'baseTarget' => '_main'
));
$tabs->add('usergroupbackend', array(
'title' => $this->translate('Configure how users are associated with groups by Icinga Web 2'),
'label' => $this->translate('User Group Backends'),
'label' => $this->translate('User Groups'),
'url' => 'usergroupbackend/list',
'baseTarget' => '_main'
));
@ -210,13 +211,13 @@ class ConfigController extends Controller
{
$this->assertPermission('config/application/userbackend');
$form = new UserBackendConfigForm();
$form->setRedirectUrl('config/userbackend');
$form->setTitle($this->translate('Create New User Backend'));
$form->addDescription($this->translate(
'Create a new backend for authenticating your users. This backend'
. ' will be added at the end of your authentication order.'
));
$form->setIniConfig(Config::app('authentication'));
$form
->setRedirectUrl('config/userbackend')
->addDescription($this->translate(
'Create a new backend for authenticating your users. This backend'
. ' will be added at the end of your authentication order.'
))
->setIniConfig(Config::app('authentication'));
try {
$form->setResourceConfig(ResourceFactory::getResourceConfigs());
@ -246,8 +247,7 @@ class ConfigController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Backend'));
}
/**
@ -260,7 +260,6 @@ class ConfigController extends Controller
$form = new UserBackendConfigForm();
$form->setRedirectUrl('config/userbackend');
$form->setTitle(sprintf($this->translate('Edit User Backend %s'), $backendName));
$form->setIniConfig(Config::app('authentication'));
$form->setOnSuccess(function (UserBackendConfigForm $form) use ($backendName) {
try {
@ -291,8 +290,7 @@ class ConfigController extends Controller
$this->httpNotFound(sprintf($this->translate('User backend "%s" not found'), $backendName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update User Backend'));
}
/**
@ -307,7 +305,6 @@ class ConfigController extends Controller
$backendForm->setIniConfig(Config::app('authentication'));
$form = new ConfirmRemovalForm();
$form->setRedirectUrl('config/userbackend');
$form->setTitle(sprintf($this->translate('Remove User Backend %s'), $backendName));
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($backendName, $backendForm) {
try {
$backendForm->delete($backendName);
@ -325,8 +322,7 @@ class ConfigController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove User Backend'));
}
/**
@ -345,8 +341,11 @@ class ConfigController extends Controller
public function createresourceAction()
{
$this->assertPermission('config/application/resources');
$this->getTabs()->add('resources/new', array(
'label' => $this->translate('New Resource'),
'url' => Url::fromRequest()
))->activate('resources/new');
$form = new ResourceConfigForm();
$form->setTitle($this->translate('Create A New Resource'));
$form->addDescription($this->translate('Resources are entities that provide data to Icinga Web 2.'));
$form->setIniConfig(Config::app('resources'));
$form->setRedirectUrl('config/resource');
@ -362,8 +361,11 @@ class ConfigController extends Controller
public function editresourceAction()
{
$this->assertPermission('config/application/resources');
$this->getTabs()->add('resources/update', array(
'label' => $this->translate('Update Resource'),
'url' => Url::fromRequest()
))->activate('resources/update');
$form = new ResourceConfigForm();
$form->setTitle($this->translate('Edit Existing Resource'));
$form->setIniConfig(Config::app('resources'));
$form->setRedirectUrl('config/resource');
$form->handleRequest();
@ -378,6 +380,10 @@ class ConfigController extends Controller
public function removeresourceAction()
{
$this->assertPermission('config/application/resources');
$this->getTabs()->add('resources/remove', array(
'label' => $this->translate('Remove Resource'),
'url' => Url::fromRequest()
))->activate('resources/remove');
$form = new ConfirmRemovalForm(array(
'onSuccess' => function ($form) {
$configForm = new ResourceConfigForm();
@ -398,7 +404,6 @@ class ConfigController extends Controller
}
}
));
$form->setTitle($this->translate('Remove Existing Resource'));
$form->setRedirectUrl('config/resource');
$form->handleRequest();

View File

@ -156,8 +156,7 @@ class GroupController extends AuthBackendController
$form->setRepository($backend);
$form->add()->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Group'));
}
/**
@ -181,8 +180,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update User Group'));
}
/**
@ -204,8 +202,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove User Group'));
}
/**
@ -232,8 +229,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Group Member'));
}
/**
@ -342,16 +338,36 @@ class GroupController extends AuthBackendController
protected function createListTabs()
{
$tabs = $this->getTabs();
$tabs->add(
'role/list',
array(
'baseTarget' => '_main',
'label' => $this->translate('Roles'),
'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'url' => 'role/list'
)
);
$tabs->add(
'user/list',
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Usergroups'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
return $tabs;
}
}

View File

@ -125,14 +125,24 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes();
$this->view->items = $query;
$this->getTabs()->add(
$this->getTabs()
->add(
'preferences',
array(
'title' => $this->translate('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => $this->translate('Preferences'),
'url' => 'preference'
)
)
->add(
'navigation',
array(
'active' => true,
'title' => $this->translate('List and configure your own navigation items'),
'label' => $this->translate('Navigation'),
'url' => 'navigation'
)
)->activate('navigation');
);
$this->setupSortControl(
array(
'type' => $this->translate('Type'),
@ -202,7 +212,6 @@ class NavigationController extends Controller
$form->setRedirectUrl('navigation');
$form->setUser($this->Auth()->getUser());
$form->setItemTypes($this->listItemTypes());
$form->setTitle($this->translate('Create New Navigation Item'));
$form->addDescription($this->translate('Create a new navigation item, such as a menu entry or dashlet.'));
// TODO: Fetch all "safe" parameters from the url and populate them
@ -231,8 +240,7 @@ class NavigationController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New Navigation Item'));
}
/**
@ -256,7 +264,6 @@ class NavigationController extends Controller
$form->setShareConfig(Config::navigation($itemType));
$form->setUserConfig(Config::navigation($itemType, $itemOwner));
$form->setRedirectUrl($referrer === 'shared' ? 'navigation/shared' : 'navigation');
$form->setTitle(sprintf($this->translate('Edit %s %s'), $this->getItemLabel($itemType), $itemName));
$form->setOnSuccess(function (NavigationConfigForm $form) use ($itemName) {
$data = array_map(
function ($v) {
@ -293,8 +300,7 @@ class NavigationController extends Controller
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update Navigation Item'));
}
/**
@ -313,7 +319,6 @@ class NavigationController extends Controller
$form = new ConfirmRemovalForm();
$form->setRedirectUrl('navigation');
$form->setTitle(sprintf($this->translate('Remove %s %s'), $this->getItemLabel($itemType), $itemName));
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($itemName, $navigationConfigForm) {
try {
$itemConfig = $navigationConfigForm->delete($itemName);
@ -338,8 +343,7 @@ class NavigationController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove Navigation Item'));
}
/**

View File

@ -28,13 +28,16 @@ class PreferenceController extends BasePreferenceController
public static function createProvidedTabs()
{
return array(
'preferences' => new Tab(
array(
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => t('Preferences'),
'url' => Url::fromPath('preference')
)
)
'preferences' => new Tab(array(
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => t('Preferences'),
'url' => 'preference'
)),
'navigation' => new Tab(array(
'title' => t('List and configure your own navigation items'),
'label' => t('Navigation'),
'url' => 'navigation'
))
);
}

View File

@ -20,6 +20,8 @@ class RoleController extends AuthBackendController
{
/**
* List roles
*
* @TODO(el): Rename to indexAction()
*/
public function listAction()
{
@ -30,6 +32,8 @@ class RoleController extends AuthBackendController
/**
* Create a new role
*
* @TODO(el): Rename to newAction()
*/
public function addAction()
{
@ -52,24 +56,23 @@ class RoleController extends AuthBackendController
}
));
$role
->setTitle($this->translate('New Role'))
->setSubmitLabel($this->translate('Create Role'))
->setIniConfig(Config::app('roles', true))
->setRedirectUrl('role/list')
->handleRequest();
$this->view->form = $role;
$this->render('form');
$this->renderForm($role, $this->translate('New Role'));
}
/**
* Update a role
*
* @TODO(el): Rename to updateAction()
*/
public function editAction()
{
$this->assertPermission('config/authentication/roles/edit');
$name = $this->params->getRequired('role');
$role = new RoleForm();
$role->setTitle(sprintf($this->translate('Update Role %s'), $name));
$role->setSubmitLabel($this->translate('Update Role'));
try {
$role
@ -97,8 +100,7 @@ class RoleController extends AuthBackendController
})
->setRedirectUrl('role/list')
->handleRequest();
$this->view->form = $role;
$this->render('form');
$this->renderForm($role, $this->translate('Update Role'));
}
/**
@ -132,12 +134,10 @@ class RoleController extends AuthBackendController
}
));
$confirmation
->setTitle(sprintf($this->translate('Remove Role %s'), $name))
->setSubmitLabel($this->translate('Remove Role'))
->setRedirectUrl('role/list')
->handleRequest();
$this->view->form = $confirmation;
$this->render('form');
$this->renderForm($confirmation, $this->translate('Remove Role'));
}
/**
@ -158,6 +158,24 @@ class RoleController extends AuthBackendController
)
);
$tabs->add(
'user/list',
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
return $tabs;
}
}

View File

@ -162,8 +162,7 @@ class UserController extends AuthBackendController
$form->setRepository($backend);
$form->add()->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User'));
}
/**
@ -185,8 +184,7 @@ class UserController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update User'));
}
/**
@ -208,8 +206,7 @@ class UserController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove User'));
}
/**
@ -305,6 +302,18 @@ class UserController extends AuthBackendController
protected function createListTabs()
{
$tabs = $this->getTabs();
$tabs->add(
'role/list',
array(
'baseTarget' => '_main',
'label' => $this->translate('Roles'),
'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'url' => 'role/list'
)
);
$tabs->add(
'user/list',
array(
@ -314,7 +323,15 @@ class UserController extends AuthBackendController
'url' => 'user/list'
)
);
$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
return $tabs;
}
}

View File

@ -48,7 +48,6 @@ class UsergroupbackendController extends Controller
{
$form = new UserGroupBackendForm();
$form->setRedirectUrl('usergroupbackend/list');
$form->setTitle($this->translate('Create New User Group Backend'));
$form->addDescription($this->translate('Create a new backend to associate users and groups with.'));
$form->setIniConfig(Config::app('groups'));
$form->setOnSuccess(function (UserGroupBackendForm $form) {
@ -68,8 +67,7 @@ class UsergroupbackendController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Group Backend'));
}
/**
@ -81,7 +79,6 @@ class UsergroupbackendController extends Controller
$form = new UserGroupBackendForm();
$form->setRedirectUrl('usergroupbackend/list');
$form->setTitle(sprintf($this->translate('Edit User Group Backend %s'), $backendName));
$form->setIniConfig(Config::app('groups'));
$form->setOnSuccess(function (UserGroupBackendForm $form) use ($backendName) {
try {
@ -111,8 +108,7 @@ class UsergroupbackendController extends Controller
$this->httpNotFound(sprintf($this->translate('User group backend "%s" not found'), $backendName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update User Group Backend'));
}
/**
@ -126,7 +122,6 @@ class UsergroupbackendController extends Controller
$backendForm->setIniConfig(Config::app('groups'));
$form = new ConfirmRemovalForm();
$form->setRedirectUrl('usergroupbackend/list');
$form->setTitle(sprintf($this->translate('Remove User Group Backend %s'), $backendName));
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($backendName, $backendForm) {
try {
$backendForm->delete($backendName);
@ -144,8 +139,7 @@ class UsergroupbackendController extends Controller
});
$form->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove User Group Backend'));
}
/**
@ -156,12 +150,12 @@ class UsergroupbackendController extends Controller
$tabs = $this->getTabs();
$tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('User Backends'),
'label' => $this->translate('Users'),
'url' => 'config/userbackend'
));
$tabs->add('usergroupbackend', array(
'title' => $this->translate('Configure how users are associated with groups by Icinga Web 2'),
'label' => $this->translate('User Group Backends'),
'label' => $this->translate('User Groups'),
'url' => 'usergroupbackend/list'
));
return $tabs;

View File

@ -450,6 +450,18 @@
"code": 59427,
"src": "fontawesome"
},
{
"uid": "745f12abe1472d14f8f658de7e5aba66",
"css": "angle-double-left",
"code": 59514,
"src": "fontawesome"
},
{
"uid": "fdfbd1fcbd4cb229716a810801a5f207",
"css": "angle-double-right",
"code": 59515,
"src": "fontawesome"
},
{
"uid": "1c4068ed75209e21af36017df8871802",
"css": "down-big",
@ -654,12 +666,30 @@
"code": 59490,
"src": "fontawesome"
},
{
"uid": "4743b088aa95d6f3b6b990e770d3b647",
"css": "facebook-squared",
"code": 59519,
"src": "fontawesome"
},
{
"uid": "e7cb72a17f3b21e3576f35c3f0a7639b",
"css": "git",
"code": 59402,
"src": "fontawesome"
},
{
"uid": "627abcdb627cb1789e009c08e2678ef9",
"css": "twitter",
"code": 59518,
"src": "fontawesome"
},
{
"uid": "7e4164950ffa4990961958b2d6318658",
"css": "info-circled",
"code": 59517,
"src": "entypo"
},
{
"uid": "465bb89b6f204234e5787c326b4ae54c",
"css": "rewind",

View File

@ -121,4 +121,9 @@
.icon-right-small:before { content: '\e877'; } /* '' */
.icon-up-small:before { content: '\e878'; } /* '' */
.icon-pin:before { content: '\e879'; } /* '' */
.icon-circle:before { content: '\e87c'; } /* '' */
.icon-angle-double-left:before { content: '\e87a'; } /* '' */
.icon-angle-double-right:before { content: '\e87b'; } /* '' */
.icon-circle:before { content: '\e87c'; } /* '' */
.icon-info-circled:before { content: '\e87d'; } /* '' */
.icon-twitter:before { content: '\e87e'; } /* '' */
.icon-facebook-squared:before { content: '\e87f'; } /* '' */

File diff suppressed because one or more lines are too long

View File

@ -121,4 +121,9 @@
.icon-right-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-info-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-twitter { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-facebook-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }

View File

@ -132,4 +132,9 @@
.icon-right-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-info-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-twitter { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-facebook-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'ifont';
src: url('../font/ifont.eot?82929165');
src: url('../font/ifont.eot?82929165#iefix') format('embedded-opentype'),
url('../font/ifont.woff?82929165') format('woff'),
url('../font/ifont.ttf?82929165') format('truetype'),
url('../font/ifont.svg?82929165#ifont') format('svg');
src: url('../font/ifont.eot?75407611');
src: url('../font/ifont.eot?75407611#iefix') format('embedded-opentype'),
url('../font/ifont.woff?75407611') format('woff'),
url('../font/ifont.ttf?75407611') format('truetype'),
url('../font/ifont.svg?75407611#ifont') format('svg');
font-weight: normal;
font-style: normal;
}
@ -14,7 +14,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'ifont';
src: url('../font/ifont.svg?82929165#ifont') format('svg');
src: url('../font/ifont.svg?75407611#ifont') format('svg');
}
}
*/
@ -176,4 +176,9 @@
.icon-right-small:before { content: '\e877'; } /* '' */
.icon-up-small:before { content: '\e878'; } /* '' */
.icon-pin:before { content: '\e879'; } /* '' */
.icon-circle:before { content: '\e87c'; } /* '' */
.icon-angle-double-left:before { content: '\e87a'; } /* '' */
.icon-angle-double-right:before { content: '\e87b'; } /* '' */
.icon-circle:before { content: '\e87c'; } /* '' */
.icon-info-circled:before { content: '\e87d'; } /* '' */
.icon-twitter:before { content: '\e87e'; } /* '' */
.icon-facebook-squared:before { content: '\e87f'; } /* '' */

View File

@ -229,11 +229,11 @@ body {
}
@font-face {
font-family: 'ifont';
src: url('./font/ifont.eot?83291894');
src: url('./font/ifont.eot?83291894#iefix') format('embedded-opentype'),
url('./font/ifont.woff?83291894') format('woff'),
url('./font/ifont.ttf?83291894') format('truetype'),
url('./font/ifont.svg?83291894#ifont') format('svg');
src: url('./font/ifont.eot?195161');
src: url('./font/ifont.eot?195161#iefix') format('embedded-opentype'),
url('./font/ifont.woff?195161') format('woff'),
url('./font/ifont.ttf?195161') format('truetype'),
url('./font/ifont.svg?195161#ifont') format('svg');
font-weight: normal;
font-style: normal;
}
@ -483,7 +483,14 @@ body {
<div class="row">
<div title="Code: 0xe878" class="the-icons span3"><i class="demo-icon icon-up-small">&#xe878;</i> <span class="i-name">icon-up-small</span><span class="i-code">0xe878</span></div>
<div title="Code: 0xe879" class="the-icons span3"><i class="demo-icon icon-pin">&#xe879;</i> <span class="i-name">icon-pin</span><span class="i-code">0xe879</span></div>
<div title="Code: 0xe87a" class="the-icons span3"><i class="demo-icon icon-angle-double-left">&#xe87a;</i> <span class="i-name">icon-angle-double-left</span><span class="i-code">0xe87a</span></div>
<div title="Code: 0xe87b" class="the-icons span3"><i class="demo-icon icon-angle-double-right">&#xe87b;</i> <span class="i-name">icon-angle-double-right</span><span class="i-code">0xe87b</span></div>
</div>
<div class="row">
<div title="Code: 0xe87c" class="the-icons span3"><i class="demo-icon icon-circle">&#xe87c;</i> <span class="i-name">icon-circle</span><span class="i-code">0xe87c</span></div>
<div title="Code: 0xe87d" class="the-icons span3"><i class="demo-icon icon-info-circled">&#xe87d;</i> <span class="i-name">icon-info-circled</span><span class="i-code">0xe87d</span></div>
<div title="Code: 0xe87e" class="the-icons span3"><i class="demo-icon icon-twitter">&#xe87e;</i> <span class="i-name">icon-twitter</span><span class="i-code">0xe87e</span></div>
<div title="Code: 0xe87f" class="the-icons span3"><i class="demo-icon icon-facebook-squared">&#xe87f;</i> <span class="i-name">icon-facebook-squared</span><span class="i-code">0xe87f</span></div>
</div>
</div>
<div class="container footer">Generated by <a href="http://fontello.com">fontello.com</a></div>

View File

@ -41,7 +41,6 @@ class LoginForm extends Form
array(
'required' => true,
'label' => $this->translate('Username'),
'placeholder' => $this->translate('Please enter your username...'),
'class' => false === isset($formData['username']) ? 'autofocus' : ''
)
);
@ -51,7 +50,6 @@ class LoginForm extends Form
array(
'required' => true,
'label' => $this->translate('Password'),
'placeholder' => $this->translate('...and your password'),
'class' => isset($formData['username']) ? 'autofocus' : ''
)
);

View File

@ -3,10 +3,10 @@
namespace Icinga\Forms\Config;
use Icinga\Web\Notification;
use Icinga\Forms\ConfigForm;
use Icinga\Forms\Config\General\LoggingConfigForm;
use Icinga\Forms\Config\General\ApplicationConfigForm;
use Icinga\Forms\Config\General\LoggingConfigForm;
use Icinga\Forms\ConfigForm;
use Icinga\Web\Notification;
/**
* Form class for application-wide and logging specific settings
@ -20,7 +20,6 @@ class GeneralConfigForm extends ConfigForm
{
$this->setName('form_config_general');
$this->setSubmitLabel($this->translate('Save Changes'));
$this->setTitle($this->translate('General Configuration'));
}
/**

View File

@ -369,7 +369,7 @@ class ResourceConfigForm extends ConfigForm
array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
)
)
);

View File

@ -82,6 +82,7 @@ class LdapBackendForm extends Form
'button',
'discovery_btn',
array(
'class' => 'control-button',
'type' => 'submit',
'value' => 'discovery_btn',
'label' => $this->translate('Discover', 'A button to discover LDAP capabilities'),
@ -90,21 +91,12 @@ class LdapBackendForm extends Form
),
'decorators' => array(
array('ViewHelper', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
array('Spinner'),
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'formnovalidate' => 'formnovalidate'
)
);
$this->addDisplayGroup(
array('resource', 'discovery_btn'),
'connection_discovery',
array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
)
)
);
if ($this->getElement('discovery_btn')->isChecked()) {
$connection = ResourceFactory::create(

View File

@ -476,7 +476,7 @@ class UserBackendConfigForm extends ConfigForm
array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
)
)
);

View File

@ -25,14 +25,14 @@ if ($this->layout()->autorefreshInterval) {
'dashboard',
null,
array(
'icon' => '../logo_icinga-inv.png',
'icon' => 'img/logo_icinga-inv.png',
'data-base-target' => '_main',
'aria-hidden' => 'true',
'tabindex' => -1
)
); ?>
<?php else: ?>
<?= $this->icon('../logo_icinga-inv.png'); ?>
<?= $this->icon('img/logo_icinga-inv.png'); ?>
<?php endif ?>
</div>
</div>
@ -60,4 +60,4 @@ if ($this->layout()->autorefreshInterval) {
}
}
?></ul>
</div>
</div>

View File

@ -1,41 +1,41 @@
<div class="controls">
<?= $tabs; ?>
<?= $tabs ?>
</div>
<div class="content about">
<div class="content content-centered">
<?= $this->img(
'img/logo_icinga_big_dark.png',
null,
array(
'width' => 400,
'class' => 'about-logo'
'width' => 320
)
); ?>
<p class="about-version">
) ?>
<dl class="name-value-list">
<?php if (isset($version['appVersion'])): ?>
<strong><?= $this->translate('Version'); ?>:</strong> <?= $this->escape($version['appVersion']); ?>
<dt><?= $this->translate('Version') ?></dt>
<dd><?= $this->escape($version['appVersion']) ?></dd>
<?php endif ?>
<?php if (isset($version['gitCommitID'])): ?>
<br>
<strong><?= $this->translate('Git commit ID'); ?>:</strong> <?= $this->escape($version['gitCommitID']); ?>
<dt><?= $this->translate('Git commit') ?></dt>
<dd><?= $this->escape($version['gitCommitID']) ?></dd>
<?php endif ?>
<?php if (isset($version['gitCommitDate'])): ?>
<br>
<strong><?= $this->translate('Git commit date'); ?>:</strong> <?= $this->escape($version['gitCommitDate']); ?>
<dt><?= $this->translate('Git commit date') ?></dt>
<dd><?= $this->escape($version['gitCommitDate']) ?></dd>
<?php endif ?>
</p>
<p class="about-license">
<strong><?= $this->translate('Copyright'); ?></strong>: &copy; 2013-<?= date('Y'); ?> <?= $this->qlink(
$this->translate('The Icinga Project'),
'https://www.icinga.org',
null,
array(
'target' => '_blank'
)
); ?>
<br>
<strong><?= $this->translate('License'); ?></strong>: GNU GPL v2+
</p>
<p class="about-social">
<dt><?= $this->translate('Copyright') ?></dt>
<dd>
<span>&copy; 2013-<?= date('Y') ?></span>
<?= $this->qlink(
$this->translate('The Icinga Project'),
'https://www.icinga.org',
null,
array(
'target' => '_blank'
)
) ?>
</dd>
</dl>
<div>
<?= $this->qlink(
null,
'https://www.twitter.com/icinga',
@ -45,7 +45,7 @@
'icon' => 'twitter',
'title' => $this->translate('Icinga on Twitter')
)
); ?> <?= $this->qlink(
) ?> <?= $this->qlink(
null,
'https://www.facebook.com/icinga',
null,
@ -54,29 +54,32 @@
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
); ?>
</p>
<div class="about-urls">
<div><?= $this->qlink(
null,
'https://dev.icinga.org/projects/icingaweb2',
null,
array(
'target' => '_blank',
'img' => 'img/bugreport.png',
'title' => $this->translate('Report a bug')
)
); ?> <?= $this->qlink(
null,
'https://www.icinga.org/services/support',
null,
array(
'target' => '_blank',
'img' => 'img/support.png',
'title' => $this->translate('Support / Mailinglists')
)
); ?></div>
<div><?= $this->qlink(
) ?>
</div>
<div>
<?= $this->qlink(
null,
'https://dev.icinga.org/projects/icingaweb2',
null,
array(
'target' => '_blank',
'img' => 'img/bugreport.png',
'title' => $this->translate('Report a bug')
)
) ?>
<?= $this->qlink(
null,
'https://www.icinga.org/services/support',
null,
array(
'target' => '_blank',
'img' => 'img/support.png',
'title' => $this->translate('Support / Mailinglists')
)
) ?>
</div>
<div>
<?= $this->qlink(
null,
'https://wiki.icinga.org',
null,
@ -85,7 +88,8 @@
'img' => 'img/wiki.png',
'title' => $this->translate('Icinga Wiki')
)
); ?> <?= $this->qlink(
) ?>
<?= $this->qlink(
null,
'https://docs.icinga.org/',
null,
@ -94,35 +98,35 @@
'img' => 'img/docs.png',
'title' => $this->translate('Icinga Documentation')
)
); ?></div>
) ?>
</div>
<h2><?= $this->translate('Loaded modules') ?></h2>
<table class="action alternating about-modules" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>
<th><?= $this->translate('Version') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($this->hasPermission('config/modules')): ?>
<?= $this->qlink(
$module->getName(),
'config/module/',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName()))
); ?>
<?php else: ?>
<?= $this->escape($module->getName()); ?>
<?php endif ?>
<td>
<?= $this->escape($module->getVersion()); ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>
<th><?= $this->translate('Version') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($this->hasPermission('config/modules')): ?>
<?= $this->qlink(
$module->getName(),
'config/module/',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName()))
) ?>
<?php else: ?>
<?= $this->escape($module->getName()) ?>
<?php endif ?>
<td>
<?= $this->escape($module->getVersion()) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>

View File

@ -5,7 +5,6 @@
</div>
</div>
<div class="form" data-base-target="layout">
<h1><?= $this->translate('Welcome to Icinga Web 2'); ?></h1>
<?php if ($requiresSetup): ?>
<p class="config-note"><?= sprintf(
$this->translate(
@ -19,6 +18,29 @@
); ?></p>
<?php endif ?>
<?= $this->form ?>
<div class="footer">Icinga Web 2 &copy; 2013-2015<br><a href="https://www.icinga.org"><?= $this->translate('The Icinga Project'); ?></a></div>
<div class="footer">
Icinga Web 2 &copy; 2013-<?= date('Y'); ?><br><br>
<?= $this->qlink($this->translate('The Icinga Project'), 'https://www.icinga.org'); ?>
<?= $this->qlink(
null,
'http://www.twitter.com/icinga',
null,
array(
'target' => '_blank',
'icon' => 'twitter',
'title' => $this->translate('Icinga on Twitter')
)
); ?>
<?= $this->qlink(
null,
'http://www.facebook.com/icinga',
null,
array(
'target' => '_blank',
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
); ?>
</div>
</div>
</div>

View File

@ -1,6 +0,0 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
</div>
<div class="content">
<?= $form; ?>
</div>

View File

@ -1,9 +1,6 @@
<div class="controls" data-base-target="_main">
<?= $this->tabs->render($this); ?>
<div class="controls">
<?= $tabs ?>
</div>
<div class="content">
<?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?>
<?php endif ?>
<?= $this->form ?>
<?= $form ?>
</div>

View File

@ -11,7 +11,7 @@
$permissions = $module->getProvidedPermissions();
$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
?>
<table class="avp">
<table class="name-value-table">
<tr>
<th><?= $this->escape($this->translate('Name')) ?></th>
<td><?= $this->escape($module->getName()) ?></td>
@ -23,7 +23,7 @@
$this->translate('disable'),
'config/moduledisable',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Disable the %s module'), $module->getName()))
array('title' => sprintf($this->translate('Disable the %s module'), $module->getName()), 'class' => 'action-link')
); ?>
<?php endif ?>
<?php if ($state === 'disabled'): ?>
@ -31,7 +31,7 @@
$this->translate('enable'),
'config/moduleenable',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Enable the %s module'), $module->getName()))
array('title' => sprintf($this->translate('Enable the %s module'), $module->getName()), 'class' => 'action-link')
); ?>
<?php endif ?>
</td>

View File

@ -1,14 +1,27 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<table class="action alternating" data-base-target="_next">
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Module') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($modules as $module): ?>
<tr>
@ -25,7 +38,7 @@
$module->name,
'config/module/',
array('name' => $module->name),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name))
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name), 'class' => 'rowaction')
); ?>
</td>
</tr>

View File

@ -1,67 +1,76 @@
<div class="controls">
<?= $tabs; ?>
<?= $tabs ?>
</div>
<div class="content" data-base-target="_next">
<a href="<?= $this->href('config/createresource'); ?>">
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?>
</a>
<table class="action alternating" id="resource-edit-table">
<div class="content">
<?= $this->qlink(
$this->translate('Create a New Resource') ,
'config/createresource',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new resource')
)
) ?>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<th><?= $this->translate('Resource'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
<tr>
<th><?= $this->translate('Resource') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->resources as $name => $value): ?>
<tr>
<?php foreach ($this->resources as $name => $value): ?>
<tr>
<td>
<?php
switch ($value->type) {
case 'db':
$icon = 'database';
break;
case 'ldap':
$icon = 'sitemap';
break;
case 'livestatus':
$icon = 'flash';
break;
case 'ssh':
$icon = 'user';
break;
case 'file':
case 'ini':
$icon = 'doc-text';
break;
default:
$icon = 'edit';
break;
}
?>
<?= $this->qlink(
$name,
'config/editresource',
array('resource' => $name),
array(
'icon' => $icon,
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
); ?>
</td>
<td>
<center>
<?php
switch ($value->type) {
case 'db':
$icon = 'database';
break;
case 'ldap':
$icon = 'sitemap';
break;
case 'livestatus':
$icon = 'flash';
break;
case 'ssh':
$icon = 'user';
break;
case 'file':
case 'ini':
$icon = 'doc-text';
break;
default:
$icon = 'edit';
break;
}
?>
<?= $this->qlink(
'',
'config/removeresource',
array('resource' => $name),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
); ?>
</center>
$name,
'config/editresource',
array('resource' => $name),
array(
'icon' => $icon,
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
) ?>
</td>
</tr>
<?php endforeach; ?>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'config/removeresource',
array('resource' => $name),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</table>
</div>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
<?= $tabs ?>
</div>
<div class="content">
<?= $form; ?>
</div>
<?= $form ?>
</div>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
<?= $tabs ?>
</div>
<div class="content">
<?= $form; ?>
</div>
<?= $form ?>
</div>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?>
<?= $tabs ?>
</div>
<div class="content">
<?= $form; ?>
</div>
<?= $form ?>
</div>

View File

@ -1,11 +1,17 @@
<div class="controls">
<?= $tabs; ?>
<?= $tabs ?>
</div>
<div class="content" data-base-target="_next">
<a href="<?= $this->href('config/createuserbackend'); ?>">
<?= $this->icon('plus'); ?><?= $this->translate('Create A New User Backend'); ?>
</a>
<div id="authentication-reorder-form">
<?= $form; ?>
</div>
<div class="content">
<?= $this->qlink(
$this->translate('Create a New User Backend') ,
'config/createuserbackend',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user backend')
)
) ?>
<?= $form ?>
</div>

View File

@ -1,4 +1,4 @@
<?php if (! $hideControls): ?>
<?php if (! $this->compact && !$hideControls): ?>
<div class="controls">
<?= $tabs->showOnlyCloseButton(); ?>
</div>

View File

@ -1,9 +1,9 @@
<form id="<?= $form->getId(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
<table class="action alternating">
<form id="<?= $form->getId() ?>" name="<?= $form->getName() ?>" enctype="<?= $form->getEncType() ?>" method="<?= $form->getMethod() ?>" action="<?= $form->getAction() ?>">
<table class="action-table listing-table" data-base-target="_next">
<thead>
<th>Backend</th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
<th style="width: 5em"><?= $this->translate('Order'); ?></th>
<th><?= $this->translate('Backend') ?></th>
<th></th>
<th></th>
</thead>
<tbody>
<?php
@ -22,55 +22,56 @@
'icon' => $type === 'external' ?
'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'class' => 'rowaction',
'title' => sprintf($this->translate('rEdit user backend %s'), $backendNames[$i])
'title' => sprintf($this->translate('Edit user backend %s'), $backendNames[$i])
)
); ?>
) ?>
</td>
<td>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'config/removeuserbackend',
array('backend' => $backendNames[$i]),
array(
'icon' => 'trash',
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user backend %s'), $backendNames[$i])
)
); ?>
) ?>
</td>
<td data-base-target="_self">
<td class="icon-col text-right" data-base-target="_self">
<?php if ($i > 0): ?>
<button type="submit" name="backend_newpos" class="link-like icon-only animated move-up" value="<?= sprintf(
<button type="submit" name="backend_newpos" class="link-button icon-only animated move-up" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i - 1
); ?>" title="<?= $this->translate(
) ?>" title="<?= $this->translate(
'Move up in authentication order'
); ?>" aria-label="<?= sprintf(
) ?>" aria-label="<?= sprintf(
$this->translate('Move user backend %s upwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('up-small'); ?>
) ?>">
<?= $this->icon('up-small') ?>
</button>
<?php endif; ?>
<?php endif ?>
<?php if ($i + 1 < count($backendNames)): ?>
<button type="submit" name="backend_newpos" class="link-like icon-only animated move-down" value="<?= sprintf(
<button type="submit" name="backend_newpos" class="link-button icon-only animated move-down" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i + 1
); ?>" title="<?= $this->translate(
) ?>" title="<?= $this->translate(
'Move down in authentication order'
); ?>" aria-label="<?= sprintf(
) ?>" aria-label="<?= sprintf(
$this->translate('Move user backend %s downwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('down-small'); ?>
) ?>">
<?= $this->icon('down-small') ?>
</button>
<?php endif; ?>
<?php endif ?>
</td>
</tr>
<?php endfor; ?>
<?php endfor ?>
</tbody>
</table>
<?= $form->getElement($form->getTokenElementName()); ?>
<?= $form->getElement($form->getUidElementName()); ?>
<?= $form->getElement($form->getTokenElementName()) ?>
<?= $form->getElement($form->getUidElementName()) ?>
</form>

View File

@ -6,9 +6,17 @@ use Icinga\Data\Reducible;
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<div>
<?= $this->backendSelection; ?>
<?= $this->filterEditor; ?>
@ -25,12 +33,29 @@ if (! isset($backend)) {
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible;
}
?>
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add a New User Group') ,
'group/add',
array('backend' => $backend->getName()),
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user group')
)
) ?>
<?php endif ?>
<?php
// @TODO(el): Remove $firstRow stuff
$firstRow = true;
foreach ($groups as $group): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action group-list alternating">
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th class="group-name"><?= $this->translate('Group'); ?></th>
@ -72,11 +97,4 @@ foreach ($groups as $group): ?>
<?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'group-add'
)); ?>
<?php endif ?>
</div>
</div>

View File

@ -1,4 +1,4 @@
<?php
<?php
use Icinga\Data\Extensible;
use Icinga\Data\Updatable;
@ -28,8 +28,8 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<h1><?= $this->escape($group->group_name); ?><span class="pull-right"><?= $editLink; ?></span></h1>
<table class="avp user-header">
<h2 class="clearfix"><?= $this->escape($group->group_name) ?><span class="pull-right"><?= $editLink ?></span></h2>
<table class="name-value-table">
<tr>
<th><?= $this->translate('Created at'); ?></th>
<td><?= $group->created_at === null ? '-' : $this->formatDateTime($group->created_at); ?></td>
@ -50,13 +50,27 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
<?php endif ?>
</div>
<div class="content members" data-base-target="_next">
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add User to Group') ,
'group/addmember',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Add user to group')
)
) ?>
<?php endif ?>
<?php
$firstRow = true;
foreach ($members as $member): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action member-list">
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th class="member-name"><?= $this->translate('Username'); ?></th>
@ -86,7 +100,7 @@ foreach ($members as $member): ?>
<?php endif ?>
</td>
<?php if (isset($removeForm)): ?>
<td class="member-remove" data-base-target="_self">
<td class="icon-col" data-base-target="_self">
<?php $removeForm->getElement('user_name')->setValue($member->user_name); echo $removeForm; ?>
</td>
<?php endif ?>
@ -98,14 +112,4 @@ foreach ($members as $member): ?>
<?php else: ?>
<p><?= $this->translate('No group member found matching the filter'); ?></p>
<?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new member'), 'group/addmember', array(
'backend' => $backend->getName(),
'group' => $group->group_name
), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'member-add'
)); ?>
<?php endif ?>
</div>
</div>

View File

@ -13,4 +13,4 @@ if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?>
/>
</form>
<?php endif; ?>
<?= $menuRenderer->setHeading(t('Navigation'))->setElementTag('nav'); ?>
<?= $menuRenderer->setCssClass('primary-nav')->setElementTag('nav')->setHeading(t('Navigation')); ?>

View File

@ -1,9 +1,17 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>

View File

@ -1,93 +1,81 @@
<?php
use Icinga\Web\Url;
// Please note that there is a reason for the strange way of writing ><.
// It was the best compromise that came to my mind to get rid of whitespaces
// between inline-block elements. Found no better hack - and table-cell seems
// to be less supported.
if ($this->pageCount <= 1) return;
?><p id="<?= $this->protectId('paginationlabel'); ?>" class="audible"><?= t('Pagination') ?></p>
<ul class="pagination" aria-labelledby="<?= $this->protectId('paginationlabel'); ?>" role="navigation"
<?php
$fromto = t('Show rows %u to %u out of %u');
$total = $this->totalItemCount;
$limit = $this->itemCountPerPage;
$title_prev = sprintf(
$fromto,
($this->current - 2) * $limit + 1,
($this->current - 1) * $limit,
$total
);
$title_next = sprintf(
$fromto,
($this->current) * $limit + 1,
($this->current + 1) * $limit,
$total
);
$li = ' ><li%1$s><span class="audible">'
. t('Page')
. ' </span><a href="%2$s" aria-label="%3$s" title="%3$s">%4$s</a></li
';
?>
<?php
if (isset($this->previous)) {
printf(
$li,
'',
Url::fromRequest()->overwriteParams(
array('page' => $this->previous)
)->getAbsoluteUrl(),
$title_prev,
'« ' . t('Prev')
);
} else {
echo ' ><li class="disabled"><span>« ' . t('Prev') . '</span></li';
}
foreach ($this->pagesInRange as $page) {
$start = ($page - 1) * $limit + 1;
$end = $page * $limit;
if ($end > $total) {
$end = $total;
}
$title = sprintf($fromto, $start, $end, $total);
$class = $page === $this->current ? ' class="active"' : '';
if ($page === '...') {
echo ' ><li class="disabled"><span>...</span></li';
} else {
printf(
$li,
$class,
Url::fromRequest()->overwriteParams(
array('page' => $page)
),
$title,
$page
);
}
}
if (isset($this->next)) {
printf(
$li,
'',
Url::fromRequest()->overwriteParams(
array('page' => $this->next)
)->getAbsoluteUrl(),
$title_next,
t('Next') . ' »'
);
} else {
echo ' ><li class="disabled"><span>' . t('Next') . ' »</span></li';
}
?>
></ul>
<div class="pagination-control" role="navigation">
<h2 id="<?= $this->protectId('pagination') ?>" class="sr-only" tabindex="-1"><?= $this->translate('Pagination') ?></h2>
<ul class="nav tab-nav">
<?php if (isset($this->previous)): ?>
<?php $label = sprintf(
$this->translate('Show rows %u to %u of %u'),
($this->current - 2) * $this->itemCountPerPage + 1,
($this->current - 1) * $this->itemCountPerPage,
$this->totalItemCount
) ?>
<li class="nav-item">
<a href="<?= Url::fromRequest()->overwriteParams(array('page' => $this->previous)) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>">
<?= $this->icon('angle-double-left') ?>
</a>
</li>
<?php else: ?>
<li class="nav-item disabled" aria-hidden="true">
<span>
<span class="sr-only"><?= $this->translate('Previous page') ?></span>
<?= $this->icon('angle-double-left') ?>
</span>
</li>
<?php endif ?>
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page === '...'): ?>
<li class="nav-item disabled">
<span>...</span>
</li>
<?php else: ?>
<?php
$end = $page * $this->itemCountPerPage;
if ($end > $this->totalItemCount) {
$end = $this->totalItemCount;
}
$label = sprintf(
$this->translate('Show rows %u to %u of %u'),
($page - 1) * $this->itemCountPerPage + 1,
$end,
$this->totalItemCount
);
?>
<li<?= $page === $this->current ? ' class="active nav-item"' : ' class="nav-item"' ?>>
<a href="<?= Url::fromRequest()->overwriteParams(array('page' => $page)) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>">
<?= $page ?>
</a>
</li>
<?php endif ?>
<?php endforeach ?>
<?php if (isset($this->next)): ?>
<?php $label = sprintf(
$this->translate('Show rows %u to %u of %u'),
$this->current * $this->itemCountPerPage + 1,
($this->current + 1) * $this->itemCountPerPage,
$this->totalItemCount
) ?>
<li class="nav-item">
<a href="<?= Url::fromRequest()->overwriteParams(array('page' => $this->next)) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>">
<?= $this->icon('angle-double-right') ?>
</a>
</li>
<?php else: ?>
<li class="disabled nav-item" aria-hidden="true">
<span>
<span class="sr-only"><?= $this->translate('Next page') ?></span>
<?= $this->icon('angle-double-right') ?>
</span>
</li>
<?php endif ?>
</ul>
</div>

View File

@ -1,6 +0,0 @@
<div class="controls">
<?= $tabs->showOnlyCloseButton(); ?>
</div>
<div class="content">
<?= $form; ?>
</div>

View File

@ -1,59 +1,86 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
<?= $this->tabs ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content" data-base-target="_next">
<a href="<?= $this->href('navigation/add'); ?>">
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?>
</a>
<div class="content">
<?= $this->qlink(
$this->translate('Create a New Navigation Item') ,
'navigation/add',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new navigation item')
)
) ?>
<?php if (count($items) === 0): ?>
<p><?= $this->translate('You did not create any navigation item yet'); ?></p>
<?php else: ?>
<table class="action alternating">
<thead>
<th><?= $this->translate('Navigation'); ?></th>
<th style="width: 10em"><?= $this->translate('Type'); ?></th>
<th style="width: 5em"><?= $this->translate('Shared'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
</thead>
<tbody>
<?php foreach ($items as $item): ?>
<tr>
<td><?= $this->qlink(
$item->name,
'navigation/edit',
array(
'name' => $item->name,
'type' => $item->type
),
array(
'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
)
); ?></td>
<td><?= $item->type && isset($types[$item->type])
? $this->escape($types[$item->type])
: $this->escape($this->translate('Unknown')); ?></td>
<td><?= $item->owner ? $this->translate('Yes') : $this->translate('No'); ?></td>
<td><?= $this->qlink(
'',
'navigation/remove',
array(
'name' => $item->name,
'type' => $item->type
),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove navigation item %s'), $item->name)
)
); ?></td>
</tr>
<?php endforeach ?>
</tbody>
<p><?= $this->translate('You did not create any navigation item yet.') ?></p>
</div>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Navigation') ?></th>
<th><?= $this->translate('Type') ?></th>
<th><?= $this->translate('Shared') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $item): ?>
<tr>
<td>
<?= $this->qlink(
$item->name,
'navigation/edit',
array(
'name' => $item->name,
'type' => $item->type
),
array(
'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
)
) ?>
</td>
<td>
<?= $item->type && isset($types[$item->type])
? $this->escape($types[$item->type])
: $this->escape($this->translate('Unknown')) ?>
</td>
<td class="icon-col">
<?= $item->owner ? $this->translate('Yes') : $this->translate('No') ?>
</td>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'navigation/remove',
array(
'name' => $item->name,
'type' => $item->type
),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove navigation item %s'), $item->name)
)
) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>
</div>
</div>

View File

@ -5,9 +5,17 @@ use Icinga\Web\Url;
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>

View File

@ -1,6 +0,0 @@
<div class="controls">
<?= $tabs->showOnlyCloseButton(); ?>
</div>
<div class="content">
<?= $form; ?>
</div>

View File

@ -2,73 +2,56 @@
<?= $tabs ?>
</div>
<div class="content">
<div>
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
<?= $this->translate('No roles found.') ?>
<?php else: ?>
<table class="avp action alternating" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>
<!-- <th>--><?//= $this->translate('Permissions') ?><!--</th>-->
<!-- <th>--><?//= $this->translate('Restrictions') ?><!--</th>-->
<th><?= $this->translate('Users') ?></th>
<th><?= $this->translate('Groups') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($roles as $name => $role): /** @var object $role */ ?>
<tr>
<td>
<?= $this->qlink(
$name,
'role/edit',
array('role' => $name),
array('title' => sprintf($this->translate('Edit role %s'), $name))
); ?>
</td>
<!-- <td>--><?//= $this->escape($role->permissions, 0, 50) ?><!--</td>-->
<!-- <td>-->
<!-- --><?php
// // TODO(el): $role->without(...) or $role->shift(...) would be nice!
// $restrictions = clone $role;
// unset($restrictions['users']);
// unset($restrictions['groups']);
// unset($restrictions['permissions']);
// ?>
<!-- --><?php //if (! empty($restrictions)): ?>
<!-- <table>-->
<!-- <tbody>-->
<!-- --><?php //foreach ($restrictions as $restrictionName => $restriction): ?>
<!-- <tr>-->
<!-- <th>--><?//= $this->escape($restrictionName) ?><!--</th>-->
<!-- <td>--><?//= $this->escape($restriction) ?><!--</td>-->
<!-- </tr>-->
<!-- --><?php //endforeach ?>
<!-- </tbody>-->
<!-- </table>-->
<!-- --><?php //endif ?>
<!-- </td>-->
<td><?= $this->escape($role->users) ?></td>
<td><?= $this->escape($role->groups) ?></td>
<td>
<?= $this->qlink(
'',
'role/remove',
array('role' => $name),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove role %s'), $name)
)
); ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>
<a data-base-target="_next" href="<?= $this->href('role/add') ?>">
<?= $this->translate('Create a New Role') ?>
</a>
</div>
<?= $this->qlink(
$this->translate('Create a New Role') ,
'role/add',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new role')
)
) ?>
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
<p><?= $this->translate('No roles found.') ?></p>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>
<th><?= $this->translate('Users') ?></th>
<th><?= $this->translate('Groups') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($roles as $name => $role): /** @var object $role */ ?>
<tr>
<td>
<?= $this->qlink(
$name,
'role/edit',
array('role' => $name),
array('title' => sprintf($this->translate('Edit role %s'), $name))
) ?>
</td>
<td><?= $this->escape($role->users) ?></td>
<td><?= $this->escape($role->groups) ?></td>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'role/remove',
array('role' => $name),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove role %s'), $name)
)
) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>

View File

@ -0,0 +1,6 @@
<div class="controls">
<?= $tabs ?>
</div>
<div class="content">
<?= $form->create()->setTitle(null) // @TODO(el): create() has to be called because the UserForm is setting the title there ?>
</div>

View File

@ -1,82 +1,94 @@
<?php
use Icinga\Data\Extensible;
use Icinga\Data\Reducible;
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<div>
<?= $this->backendSelection; ?>
<?= $this->filterEditor; ?>
</div>
<?= $this->tabs ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<div>
<?= $this->backendSelection ?>
<?= $this->filterEditor ?>
</div>
</div>
<?php endif ?>
<div class="content users">
<div class="content">
<?php if (! isset($backend)): ?>
<p><?= $this->translate('No backend found which is able to list users.') ?></p>
</div>
<?php return; endif ?>
<?php if (! $users->hasResult()): ?>
<p><?= $this->translate('No users found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<?php
if (! isset($backend)) {
echo $this->translate('No backend found which is able to list users') . '</div>';
return;
} else {
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
}
$firstRow = true;
foreach ($users as $user): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action user-list alternating">
<thead>
<tr>
<th class="user-name"><?= $this->translate('Username'); ?></th>
<?php if ($reducible): ?>
<th class="user-remove"><?= $this->translate('Remove'); ?></th>
<?php endif ?>
</tr>
</thead>
<tbody>
<?php endif ?>
<tr>
<td class="user-name"><?= $this->qlink($user->user_name, 'user/show', array(
'backend' => $backend->getName(),
'user' => $user->user_name
), array(
'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name)
)); ?></td>
<?php if ($reducible): ?>
<td class="user-remove">
<?= $this->qlink(
null,
'user/remove',
array(
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
'title' => sprintf($this->translate('Remove user %s'), $user->user_name),
'icon' => 'trash'
)
); ?>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
<?php if ($users->hasResult()): ?>
</tbody>
</table>
<?php else: ?>
<p><?= $this->translate('No users found matching the filter'); ?></p>
<?php endif ?>
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'user-add'
)); ?>
<?= $this->qlink(
$this->translate('Add a New User') ,
'user/add',
array('backend' => $backend->getName()),
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user')
)
) ?>
<?php endif ?>
</div>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Username') ?></th>
<?php if ($reducible): ?>
<th><?= $this->translate('Remove') ?></th>
<?php endif ?>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
<tr>
<td><?= $this->qlink(
$user->user_name,
'user/show',
array(
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name)
)
) ?></td>
<?php if ($reducible): ?>
<td class="icon-col"><?= $this->qlink(
null,
'user/remove',
array(
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user %s'), $user->user_name)
)
) ?></td>
<?php endif ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>

View File

@ -26,8 +26,8 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<h1><?= $this->escape($user->user_name); ?><span class="pull-right"><?= $editLink; ?></span></h1>
<table class="avp user-header">
<h2 class="clearfix"><?= $this->escape($user->user_name) ?><span class="pull-right"><?= $editLink ?></span></h2>
<table class="name-value-table">
<tr>
<th><?= $this->translate('State'); ?></th>
<td><?= $user->is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?></td>
@ -52,13 +52,26 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php endif ?>
</div>
<div class="content memberships">
<?php if ($showCreateMembershipLink): ?>
<?= $this->qlink(
$this->translate('Add User to Group') ,
'user/createmembership',
array('backend' => $backend->getName()),
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Add user to user group')
)
) ?>
<?php endif ?>
<?php
// @TODO(el): Remove that $firstRow thingy
$firstRow = true;
foreach ($memberships as $membership): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action membership-list alternating">
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th class="membership-group"><?= $this->translate('Group'); ?></th>
@ -98,19 +111,4 @@ foreach ($memberships as $membership): ?>
<?php else: ?>
<p><?= $this->translate('No memberships found matching the filter'); ?></p>
<?php endif ?>
<?php if ($showCreateMembershipLink): ?>
<?= $this->qlink(
$this->translate('Create New Membership'),
'user/createmembership',
array(
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'membership-create'
)
); ?>
<?php endif ?>
</div>
</div>

View File

@ -1,6 +0,0 @@
<div class="controls">
<?= $tabs->showOnlyCloseButton(); ?>
</div>
<div class="content">
<?= $form; ?>
</div>

View File

@ -1,51 +1,56 @@
<div class="controls">
<?= $tabs; ?>
<?= $tabs ?>
</div>
<div class="content" data-base-target="_next">
<?= $this->qlink(
$this->translate('Create A New User Group Backend'),
'usergroupbackend/create',
null,
array(
'icon' => 'plus'
)
); ?>
<?php if (count($backendNames) > 0): ?>
<table class="action usergroupbackend-list alternating">
<thead>
<div class="content">
<?= $this->qlink(
$this->translate('Create a New User Group Backend') ,
'usergroupbackend/create',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user group backend')
)
) ?>
<?php if (! count($backendNames)) { return; } ?>
<table class="action-table listing-table" data-base-target="_next">
<thead>
<tr>
<th class="backend-name"><?= $this->translate('Backend'); ?></th>
<th class="backend-remove"><?= $this->translate('Remove'); ?></th>
<tr>
</thead>
<tbody>
<th><?= $this->translate('Backend') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($backendNames as $backendName => $config):
$type = $config->get('backend');
?>
?>
<tr>
<td class="backend-name">
<?= $this->qlink(
$backendName,
'usergroupbackend/edit',
array('backend' => $backendName),
array(
'icon' => $type === 'external' ? 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'title' => sprintf($this->translate('Edit user group backend %s'), $backendName)
)
); ?>
</td>
<td class="backend-remove"><?= $this->qlink(
null,
'usergroupbackend/remove',
array('backend' => $backendName),
array(
'title' => sprintf($this->translate('Remove user group backend %s'), $backendName),
'icon' => 'trash'
)
); ?></td>
<td>
<?= $this->qlink(
$backendName,
'usergroupbackend/edit',
array('backend' => $backendName),
array(
'icon' => $type === 'external' ? 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'title' => sprintf($this->translate('Edit user group backend %s'), $backendName)
)
); ?>
</td>
<td class="icon-col text-right">
<?= $this->qlink(
null,
'usergroupbackend/remove',
array('backend' => $backendName),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user group backend %s'), $backendName)
)
) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>
</div>
<?php endforeach ?>
</tbody>
</table>
</div>

View File

@ -256,43 +256,31 @@ class Web extends EmbeddedWeb
'permission' => 'config/*',
'priority' => 800,
'children' => array(
'application' => array(
'application' => array(
'label' => t('Application'),
'url' => 'config/general',
'permission' => 'config/application/*',
'priority' => 810
),
'navigation' => array(
'authentication' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'permission' => 'config/application/*',
'priority' => 820
),
'authorization' => array(
'label' => t('Authorization'),
'permission' => 'config/authentication/*',
'priority' => 830,
'url' => 'role/list'
),
'navigation' => array(
'label' => t('Shared Navigation'),
'url' => 'navigation/shared',
'permission' => 'config/application/navigation',
'priority' => 820,
'priority' => 840,
),
'authentication' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'permission' => 'config/authentication/*',
'priority' => 830
),
'roles' => array(
'label' => t('Roles'),
'url' => 'role/list',
'permission' => 'config/authentication/roles/show',
'priority' => 840
),
'users' => array(
'label' => t('Users'),
'url' => 'user/list',
'permission' => 'config/authentication/users/show',
'priority' => 850
),
'groups' => array(
'label' => t('Usergroups'),
'url' => 'group/list',
'permission' => 'config/authentication/groups/show',
'priority' => 860
),
'modules' => array(
'modules' => array(
'label' => t('Modules'),
'url' => 'config/modules',
'permission' => 'config/modules',
@ -301,30 +289,25 @@ class Web extends EmbeddedWeb
)
),
'user' => array(
'cssClass' => 'user-nav-item',
'label' => $this->user->getUsername(),
'icon' => 'user',
'url' => 'preference',
'priority' => 900,
'children' => array(
'preferences' => array(
'label' => t('Preferences'),
'url' => 'preference',
'priority' => 910
),
'navigation' => array(
'label' => t('Navigation'),
'url' => 'navigation',
'priority' => 920
),
'logout' => array(
'label' => t('Logout'),
'url' => 'authentication/logout',
'priority' => 990,
'renderer' => array(
'NavigationItemRenderer',
'target' => '_self'
)
)
)
'renderer' => array(
'UserNavigationItemRenderer'
),
),
'logout' => array(
'cssClass' => 'user-nav-item',
'label' => t('Logout'),
'icon' => 'starttime',
'priority' => 990,
'renderer' => array(
'LogoutNavigationItemRenderer',
'target' => '_self'
),
'url' => 'authentication/logout'
)
);

View File

@ -78,6 +78,23 @@ class Controller extends ModuleActionController
throw HttpNotFoundException::create(func_get_args());
}
/**
* Render the given form using a simple view script
*
* @param Form $form
* @param string $tab
*/
public function renderForm(Form $form, $tab)
{
$this->getTabs()->add(uniqid(), array(
'active' => true,
'label' => $tab,
'url' => Url::fromRequest()
));
$this->view->form = $form;
$this->render('simple-form', null, true);
}
/**
* Create a SortBox widget and apply its sort rules on the given query
*

View File

@ -221,11 +221,12 @@ class Form extends Zend_Form
* @var array
*/
public static $defaultElementDecorators = array(
array('Label', array('tag'=>'span', 'separator' => '', 'class' => 'control-label')),
array('Help', array('placement' => 'APPEND')),
array(array('labelWrap' => 'HtmlTag'), array('tag' => 'div', 'class' => 'control-label-group')),
array('ViewHelper', array('separator' => '')),
array('Errors', array('separator' => '')),
array('Help', array('placement' => 'PREPEND')),
array('Label', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
);
/**
@ -851,7 +852,7 @@ class Form extends Zend_Form
'decorators' => array(
'ViewHelper',
array('Spinner', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
)
)
);
@ -915,12 +916,16 @@ class Form extends Zend_Form
|| ($type === 'button' && isset($options['type']) && $options['type'] === 'submit'))
) {
array_splice($options['decorators'], 1, 0, array(array('Spinner', array('separator' => ''))));
} elseif ($type === 'hidden') {
$options['decorators'] = array('ViewHelper');
}
}
} else {
$options = array('decorators' => static::$defaultElementDecorators);
if ($type === 'submit') {
array_splice($options['decorators'], 1, 0, array(array('Spinner', array('separator' => ''))));
} elseif ($type === 'hidden') {
$options['decorators'] = array('ViewHelper');
}
}

View File

@ -100,7 +100,7 @@ class Autosubmit extends Zend_Form_Decorator_Abstract
: t('Upon its value has changed, this field issues an automatic update of this page.');
$content .= $this->getView()->icon('cw', $warning, array(
'aria-hidden' => $isForm ? 'false' : 'true',
'class' => 'autosubmit-warning'
'class' => 'spinner'
));
if (! $isForm && $this->getAccessible()) {
$content = '<span id="' . $this->getWarningId() . '" class="sr-only">' . $warning . '</span>' . $content;

View File

@ -35,7 +35,7 @@ class FormDescriptions extends Zend_Form_Decorator_Abstract
return $content;
}
$html = '<ul class="descriptions">';
$html = '<ul class="form-description">';
foreach ($descriptions as $description) {
if (is_array($description)) {
list($description, $properties) = $description;

View File

@ -67,7 +67,7 @@ class FormHints extends Zend_Form_Decorator_Abstract
return $content;
}
$html = '<ul class="hints">';
$html = '<ul class="form-info">';
foreach ($hints as $hint) {
if (is_array($hint)) {
list($hint, $properties) = $hint;

View File

@ -39,7 +39,7 @@ class FormNotifications extends Zend_Form_Decorator_Abstract
$html = '<ul class="form-notifications">';
foreach (array(Form::NOTIFICATION_ERROR, Form::NOTIFICATION_WARNING, Form::NOTIFICATION_INFO) as $type) {
if (isset($notifications[$type])) {
$html .= '<li><ul class="' . $this->getNotificationTypeName($type) . '">';
$html .= '<li><ul class="notification-' . $this->getNotificationTypeName($type) . '">';
foreach ($notifications[$type] as $message) {
if (is_array($message)) {
list($message, $properties) = $message;

View File

@ -94,10 +94,10 @@ class Help extends Zend_Form_Decorator_Abstract
}
$helpContent = $this->getView()->icon(
'help',
'info-circled',
$description . ($description && $requirement ? ' ' : '') . $requirement,
array(
'class' => 'help',
'class' => 'control-info',
'aria-hidden' => $this->accessible ? 'true' : 'false'
)
) . $helpContent;

View File

@ -42,7 +42,7 @@ abstract class BadgeMenuItemRenderer extends MenuItemRenderer
*/
public function render(Menu $menu)
{
return $this->renderBadge() . $this->createLink($menu);
return '<div class="clearfix">' . $this->renderBadge() . $this->createLink($menu) . '</div>';
}
/**
@ -53,10 +53,11 @@ abstract class BadgeMenuItemRenderer extends MenuItemRenderer
protected function renderBadge()
{
if ($count = $this->getCount()) {
$view = $this->getView();
return sprintf(
'<div title="%s" class="badge-container"><span class="badge badge-%s">%s</span></div>',
$this->getView()->escape($this->getTitle()),
$this->getView()->escape($this->getState()),
'<span title="%s" class="badge pull-right state-%s">%s</span>',
$view->escape($this->getTitle()),
$view->escape($this->getState()),
$count
);
}

View File

@ -36,6 +36,13 @@ class NavigationItem implements IteratorAggregate
*/
protected $active;
/**
* The CSS class used for the outer li element
*
* @var string
*/
protected $cssClass;
/**
* This item's priority
*
@ -199,6 +206,29 @@ class NavigationItem implements IteratorAggregate
return $this;
}
/**
* Get the CSS class used for the outer li element
*
* @return string
*/
public function getCssClass()
{
return $this->cssClass;
}
/**
* Set the CSS class to use for the outer li element
*
* @param string $class
*
* @return $this
*/
public function setCssClass($class)
{
$this->cssClass = (string) $class;
return $this;
}
/**
* Return this item's priority
*
@ -435,7 +465,7 @@ class NavigationItem implements IteratorAggregate
*/
public function getLabel()
{
return $this->label ?: $this->getName();
return $this->label !== null ? $this->label : $this->getName();
}
/**

View File

@ -19,7 +19,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
/**
* The tooltip text for the badge
*
* @var string
* @var string
*/
protected $title;
@ -28,7 +28,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*
* The state identifier defines the background color of the badge.
*
* @var string
* @var string
*/
protected $state;
@ -94,7 +94,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*/
public function render(NavigationItem $item = null)
{
return $this->renderBadge() . parent::render($item);
return '<div class="clearfix">' . $this->renderBadge() . parent::render($item) . '</div>';
}
/**
@ -104,11 +104,12 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*/
protected function renderBadge()
{
if (($count = $this->getCount()) > 0) {
if ($count = $this->getCount()) {
$view = $this->view();
return sprintf(
'<div title="%s" class="badge-container"><span class="badge badge-%s">%s</span></div>',
$this->view()->escape($this->getTitle()),
$this->view()->escape($this->getState()),
'<span title="%s" class="badge pull-right state-%s">%s</span>',
$view->escape($this->getTitle()),
$view->escape($this->getState()),
$count
);
}

View File

@ -0,0 +1,14 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Navigation\Renderer;
use Icinga\Web\Navigation\NavigationItem;
class LogoutNavigationItemRenderer extends NavigationItemRenderer
{
public function render(NavigationItem $item = null)
{
return parent::render($item);
}
}

View File

@ -63,7 +63,7 @@ class NavigationItemRenderer
*/
public function init()
{
}
/**
@ -196,13 +196,15 @@ class NavigationItemRenderer
$this->renderTargetAttribute(),
$label
);
} else {
} elseif ($label) {
$content = sprintf(
'<%1$s%2$s>%3$s</%1$s>',
$item::LINK_ALTERNATIVE,
$this->view()->propertiesToString($item->getAttributes()),
$label
);
} else {
$content = '';
}
return $content;

View File

@ -304,10 +304,10 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
*/
public function beginItemMarkup(NavigationItem $item)
{
$cssClass = array(static::CSS_CLASS_ITEM);
$cssClasses = array(static::CSS_CLASS_ITEM);
if ($item->hasChildren() && $item->getChildren()->getLayout() === Navigation::LAYOUT_DROPDOWN) {
$cssClass[] = static::CSS_CLASS_DROPDOWN;
$cssClasses[] = static::CSS_CLASS_DROPDOWN;
$item
->setAttribute('class', static::CSS_CLASS_DROPDOWN_TOGGLE)
->setIcon(static::DROPDOWN_TOGGLE_ICON)
@ -315,13 +315,21 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
}
if ($item->getActive()) {
$cssClass[] = static::CSS_CLASS_ACTIVE;
$cssClasses[] = static::CSS_CLASS_ACTIVE;
}
if ($item->getIcon() === null) {
// @TODO(el): Add constant
$cssClasses[] = 'no-icon';
}
if ($cssClass = $item->getCssClass()) {
$cssClasses[] = $cssClass;
}
$content = sprintf(
'<li id="%s" class="%s">',
$this->view()->escape($item->getUniqueName()),
join(' ', $cssClass)
'<li class="%s">',
join(' ', $cssClasses)
);
return $content;
}

View File

@ -151,6 +151,7 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
public function endChildren()
{
$this->content[] = $this->getInnerIterator()->endChildrenMarkup();
$this->content[] = $this->getInnerIterator()->endItemMarkup();
}
/**

View File

@ -41,6 +41,6 @@ class SummaryNavigationItemRenderer extends BadgeNavigationItemRenderer
*/
public function getTitle()
{
return !empty($this->titles) ? join(', ', $this->titles) : '';
return ! empty($this->titles) ? join(', ', $this->titles) : '';
}
}

View File

@ -0,0 +1,26 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Navigation\Renderer;
use Icinga\Web\Navigation\NavigationItem;
class UserNavigationItemRenderer extends NavigationItemRenderer
{
public function getAvatar()
{
// Temporarily disabled as of layout issues. Should be fixed once
// we have avatars
return '';
return '<img class="pull-left user-avatar"
src="/icingaweb2/static/gravatar?email=icinga%40localhost"
alt="Avatar"
aria-hidden="true">';
}
public function render(NavigationItem $item = null)
{
return '<div class="clearfix">' . $this->getAvatar() . parent::render($item) . '</div>';
}
}

View File

@ -11,16 +11,24 @@ class StyleSheet
{
protected static $lessFiles = array(
'../application/fonts/fontello-ifont/css/ifont-embedded.css',
'css/vendor/normalize.css',
'css/vendor/tipsy.css',
'css/icinga/themes/icinga.less',
'css/icinga/colors.less',
'css/icinga/badges.less',
'css/icinga/mixins.less',
'css/icinga/defaults.less',
'css/icinga/grid.less',
'css/icinga/base.less',
'css/icinga/nav.less',
'css/icinga/main.less',
'css/icinga/limiter.less',
'css/icinga/animation.less',
'css/icinga/layout-colors.less',
'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/main-content.less',
'css/icinga/tabs.less',
'css/icinga/forms.less',
'css/icinga/setup.less',
@ -28,9 +36,11 @@ class StyleSheet
'css/icinga/pagination.less',
'css/icinga/selection-toolbar.less',
'css/icinga/login.less',
'css/icinga/logo.less',
'css/icinga/controls.less',
'css/icinga/about.less'
'css/icinga/dev.less',
// 'css/icinga/logo.less',
'css/icinga/spinner.less',
'css/icinga/compat.less',
);
public static function compileForPdf()

View File

@ -211,6 +211,22 @@ class Url
return $url->setQueryString($f->toQueryString());
}
/**
* Set the new Filter of the url to be the current filter and the given filter
*
* @param Filter $and
*/
public function addFilter($and)
{
$this->setQueryString(
Filter::matchAll(
$and,
Filter::fromQueryString($this->getQueryString())
)->toQueryString()
);
return $this;
}
/**
* Overwrite the baseUrl
*

View File

@ -43,7 +43,7 @@ $this->addHelperFunction('timeAgo', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="time-ago" title="%s">%s</span>',
'<span class="text-small time-ago" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeAgo($time, $timeOnly)
);
@ -54,7 +54,7 @@ $this->addHelperFunction('timeSince', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="time-since" title="%s">%s</span>',
'<span class="text-small time-since" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeSince($time, $timeOnly)
);
@ -65,7 +65,7 @@ $this->addHelperFunction('timeUntil', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="time-until" title="%s">%s</span>',
'<span class="text-small time-until" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeUntil($time, $timeOnly)
);

View File

@ -87,7 +87,11 @@ $this->addHelperFunction('icon', function ($img, $title = null, array $propertie
$properties['class'] = 'icon';
}
return $view->img('img/icons/' . $img, $properties);
if (strpos($img, '/') === false) {
return $view->img('img/icons/' . $img, $properties);
} else {
return $view->img($img, $properties);
}
}
$ariaHidden = array_key_exists('aria-hidden', $properties) ? $properties['aria-hidden'] : null;

View File

@ -235,7 +235,7 @@ class FilterEditor extends AbstractWidget
$filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));
} else {
if ($this->searchColumns === null && $this->query instanceof FilterColumns) {
$this->searchColumns = $this->query->getSearchColumns();
$this->searchColumns = $this->query->getSearchColumns($search);
}
if (! empty($this->searchColumns)) {

View File

@ -3,98 +3,108 @@
namespace Icinga\Web\Widget;
use Icinga\Web\Navigation\Navigation;
use Icinga\Web\Navigation\NavigationItem;
use Icinga\Web\Url;
/**
* Limiter
* Limiter control
*/
class Limiter extends AbstractWidget
{
/**
* The url
* CSS class for the limiter widget
*
* @var Url
* @var string
*/
private $url;
const CSS_CLASS_LIMITER = 'limiter-control';
private $max;
/**
* Default limit
*
* @var int
*/
const DEFAULT_LIMIT = 50;
private $pages;
/**
* Selectable limits
*
* @var int[]
*/
public static $limits = array(
10 => '10',
25 => '25',
50 => '50',
100 => '100',
500 => '500'
);
private $default;
/**
* Default limit for this instance
*
* @var int|null
*/
protected $defaultLimit;
public function setUrl(Url $url)
/**
* Get the default limit
*
* @return int
*/
public function getDefaultLimit()
{
$this->url = $url;
return $this;
}
public function setCurrentPageCount($pages)
{
$this->pages = $pages;
return $this;
}
public function setMaxLimit($max)
{
$this->max = $max;
return $this;
}
public function setDefaultLimit($limit)
{
$this->default = $limit;
return $this->defaultLimit !== null ? $this->defaultLimit : static::DEFAULT_LIMIT;
}
/**
* Set the default limit
*
* @param int $defaultLimit
*
* @return $this
*/
public function setDefaultLimit($defaultLimit)
{
$this->defaultLimit = (int) $defaultLimit;
return $this;
}
/**
* {@inheritdoc}
*/
public function render()
{
if ($this->url === null) {
$this->url = Url::fromRequest();
}
$currentLimit = (int) $this->url->getParam('limit', $this->default);
$availableLimits = array(
10 => '10',
25 => '25',
50 => '50',
100 => '100',
500 => '500'
);
if ($currentLimit === 0) {
$availableLimits[0] = t('all');
}
// if ($this->pages === 1 && $currentLimit === 10) return '';
$limits = array();
$view = $this->view();
$gotCurrent = false;
foreach ($availableLimits as $limit => $caption) {
if ($gotCurrent) {
if ($this->pages === 1) {
// break;
}
}
if ($this->max !== null && ($limit === 0 || $limit > $this->max)) {
//echo "$limit > $this->max"; break;
}
if ($limit === $currentLimit) {
$gotCurrent = true;
$limits[] = $caption;
} else {
$limits[] = $view->qlink(
$caption,
$this->url->setParam('limit', $limit),
null,
array(
'title' => sprintf($view->translate('Limit each page to a maximum of %u rows'), $caption)
$url = Url::fromRequest();
$activeLimit = (int) $url->getParam('limit', $this->getDefaultLimit());
$navigation = new Navigation();
$navigation->setLayout(Navigation::LAYOUT_TABS);
foreach (static::$limits as $limit => $label) {
$navigationItem = new NavigationItem($limit);
$navigationItem
->setActive($activeLimit === $limit)
->setAttribute(
'title',
sprintf(
t('Show %u rows on this page'),
$limit
)
);
}
)
->setLabel($label)
->setUrl($url->with(array('limit' => $limit)));
$navigation->addItem($navigationItem);
}
if (empty($limits)) return '';
return '<span class="widgetLimiter">' . implode(' ', $limits) . '</span>';
if ($activeLimit === 0) {
$navigationItem = new NavigationItem(0);
$navigationItem
->setActive(true)
->setAttribute('title', t('Show all items on this page'))
->setLabel(t('all'));
$navigation->addItem($navigationItem);
}
return $navigation
->getRenderer()
->setCssClass(static::CSS_CLASS_LIMITER)
->setHeading(t('Limiter'))
->render();
}
}

View File

@ -101,7 +101,7 @@ class OutputFormat implements Tabextension
$supportedTypes[self::TYPE_JSON] = array(
'name' => 'json',
'label' => 'JSON',
'icon' => 'img/icons/json.png',
'icon' => 'doc-text',
'urlParams' => array('format' => 'json')
);
}

View File

@ -20,7 +20,7 @@ class Tabs extends AbstractWidget implements Countable
* @var string
*/
private $baseTpl = <<< 'EOT'
<ul class="tabs">
<ul class="tabs primary-nav">
{TABS}
{DROPDOWN}
{REFRESH}

View File

@ -608,6 +608,7 @@ class Wizard
'button',
static::BTN_NEXT,
array(
'class' => 'control-button',
'type' => 'submit',
'value' => $pages[1]->getName(),
'label' => t('Next'),
@ -619,6 +620,7 @@ class Wizard
'button',
static::BTN_PREV,
array(
'class' => 'control-button',
'type' => 'submit',
'value' => $pages[$index - 1]->getName(),
'label' => t('Back'),
@ -630,6 +632,7 @@ class Wizard
'button',
static::BTN_NEXT,
array(
'class' => 'control-button',
'type' => 'submit',
'value' => $pages[$index + 1]->getName(),
'label' => t('Next'),
@ -641,6 +644,7 @@ class Wizard
'button',
static::BTN_PREV,
array(
'class' => 'control-button',
'type' => 'submit',
'value' => $pages[$index - 1]->getName(),
'label' => t('Back'),
@ -652,6 +656,7 @@ class Wizard
'button',
static::BTN_NEXT,
array(
'class' => 'control-button',
'type' => 'submit',
'value' => $page->getName(),
'label' => t('Finish'),

View File

@ -58,33 +58,19 @@ tbody tr:hover {
thead {
th {
color: @icinga;
.uppercase;
.uppercase();
.bold;
}
border-bottom: 0.25rem solid @icinga;
}
code {
// Reset
background-color: inherit;
border: none;
padding: 0;
display: inline;
}
code {
color: @icinga;
.bold;
color: @icinga-blue;
font-family: @font-family-fixed;
}
pre > code {
color: #fff;
font-weight: normal;
width: 100%;
background-color: #666;
display: block;
padding: 1em;
color: inherit;
}
ul.toc {
@ -94,5 +80,5 @@ ul.toc {
.search-highlight {
color: #FBE012;
background: @icinga;
background: @icinga-blue;
}

View File

@ -86,7 +86,11 @@ class AlertsummaryController extends Controller
$this->view->notificationsUrl = 'monitoring/list/notifications';
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
if (($limit = $this->params->get('limit'))) {
$query->limit($limit);
} else {
$query->limit(25);
}
}
/**

View File

@ -101,6 +101,6 @@ class DowntimesController extends Controller
));
$delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
$delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest();
$this->view->delDowntimeForm = $delDowntimeForm;
$this->view->delAllDowntimeForm = $delDowntimeForm;
}
}

View File

@ -152,7 +152,7 @@ class HostsController extends Controller
->setQueryString(
$this->hostList
->objectsFilter()
->andFilter(FilterEqual::where('downtime_objecttype', 'host'))
->andFilter(FilterEqual::where('object_type', 'host'))
->toQueryString()
);
$this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');

View File

@ -374,7 +374,9 @@ class ListController extends Controller
'contacts' => array()
);
}
$groupData[$c->contactgroup_name]['contacts'][] = $c;
if (isset ($c->contact_name)) {
$groupData[$c->contactgroup_name]['contacts'][] = $c;
}
}
// TODO: Find a better naming
@ -436,21 +438,13 @@ class ListController extends Controller
'servicegroup_alias',
'servicegroup_name',
'services_critical_handled',
'services_critical_last_state_change_handled' => 'services_critical_handled_last_state_change',
'services_critical_last_state_change_unhandled' => 'services_critical_unhandled_last_state_change',
'services_critical_unhandled',
'services_ok',
'services_ok_last_state_change',
'services_pending',
'services_pending_last_state_change',
'services_total',
'services_unknown_handled',
'services_unknown_last_state_change_handled' => 'services_unknown_handled_last_state_change',
'services_unknown_last_state_change_unhandled' => 'services_unknown_unhandled_last_state_change',
'services_unknown_unhandled',
'services_warning_handled',
'services_warning_last_state_change_handled' => 'services_warning_handled_last_state_change',
'services_warning_last_state_change_unhandled' => 'services_warning_unhandled_last_state_change',
'services_warning_unhandled'
));
$this->applyRestriction('monitoring/filter/objects', $query);
@ -475,18 +469,12 @@ class ListController extends Controller
'hostgroup_alias',
'hostgroup_name',
'hosts_down_handled',
'hosts_down_last_state_change_handled' => 'hosts_down_handled_last_state_change',
'hosts_down_last_state_change_unhandled' => 'hosts_down_unhandled_last_state_change',
'hosts_down_unhandled',
'hosts_pending',
'hosts_pending_last_state_change',
'hosts_total',
'hosts_unreachable_handled',
'hosts_unreachable_last_state_change_handled' => 'hosts_unreachable_handled_last_state_change',
'hosts_unreachable_last_state_change_unhandled' => 'hosts_unreachable_unhandled_last_state_change',
'hosts_unreachable_unhandled',
'hosts_up',
'hosts_up_last_state_change',
'services_critical_handled',
'services_critical_unhandled',
'services_ok',

View File

@ -63,7 +63,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
if ((bool) $this->status->notifications_enabled) {
if ($this->hasPermission('monitoring/command/feature/instance')) {
$notificationDescription = sprintf(
'<a aria-label="%1$s" title="%1$s" href="%2$s" data-base-target="_next">%3$s</a>',
'<a aria-label="%1$s" class="action-link" title="%1$s" href="%2$s" data-base-target="_next">%3$s</a>',
$this->translate('Disable notifications for a specific time on a program-wide basis'),
$this->getView()->href('monitoring/health/disable-notifications'),
$this->translate('Disable temporarily')
@ -126,14 +126,15 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'autosubmit' => true,
'description' => $notificationDescription,
'decorators' => array(
'ViewHelper',
'Errors',
array('Label', array('tag'=>'span', 'separator' => '', 'class' => 'control-label')),
array(
'Description',
array('tag' => 'span', 'class' => 'description', 'escape' => false)
),
'Label',
array('HtmlTag', array('tag' => 'div'))
array(array('labelWrap' => 'HtmlTag'), array('tag' => 'div', 'class' => 'control-label-group')),
array('ViewHelper', array('separator' => '')),
array('Errors', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
),
'disabled' => $toggleDisabled
)

View File

@ -18,7 +18,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
*/
public function init()
{
$this->setAttrib('class', 'inline link-like');
$this->setAttrib('class', 'inline');
}
/**
@ -32,15 +32,17 @@ class CheckNowCommandForm extends ObjectsCommandForm
'button',
'btn_submit',
array(
'ignore' => true,
'type' => 'submit',
'value' => $this->translate('Check now'),
'label' => '<i aria-hidden="true" class="icon-reschedule"></i>'
. $this->translate('Check now'),
'decorators' => array('ViewHelper'),
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'class' => 'link-like spinner',
'title' => $this->translate('Schedule the next active check to run immediately')
'ignore' => true,
'label' => $this->getView()->icon('reschedule') . $this->translate('Check now'),
'type' => 'submit',
'title' => $this->translate('Schedule the next active check to run immediately'),
'value' => $this->translate('Check now')
)
)
));

View File

@ -65,13 +65,16 @@ class DeleteCommentCommandForm extends CommandForm
'button',
'btn_submit',
array(
'ignore' => true,
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'type' => 'submit',
'class' => 'link-like spinner',
'label' => $this->getView()->icon('trash'),
'ignore' => true,
'label' => $this->getView()->icon('cancel'),
'title' => $this->translate('Delete this comment'),
'decorators' => array('ViewHelper')
'type' => 'submit'
)
);
return $this;

View File

@ -20,6 +20,30 @@ class DeleteDowntimeCommandForm extends CommandForm
$this->setAttrib('class', 'inline');
}
/**
* {@inheritdoc}
*/
public function addSubmitButton()
{
$this->addElement(
'button',
'btn_submit',
array(
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'ignore' => true,
'label' => $this->getView()->icon('cancel'),
'title' => $this->translate('Delete this downtime'),
'type' => 'submit'
)
);
return $this;
}
/**
* {@inheritdoc}
*/
@ -31,17 +55,17 @@ class DeleteDowntimeCommandForm extends CommandForm
'hidden',
'downtime_id',
array(
'required' => true,
'validators' => array('NotEmpty'),
'decorators' => array('ViewHelper')
'decorators' => array('ViewHelper'),
'required' => true,
'validators' => array('NotEmpty')
)
),
array(
'hidden',
'downtime_is_service',
array(
'filters' => array('Boolean'),
'decorators' => array('ViewHelper')
'decorators' => array('ViewHelper'),
'filters' => array('Boolean')
)
),
array(
@ -56,27 +80,6 @@ class DeleteDowntimeCommandForm extends CommandForm
return $this;
}
/**
* {@inheritdoc}
*/
public function addSubmitButton()
{
$this->addElement(
'button',
'btn_submit',
array(
'ignore' => true,
'escape' => false,
'type' => 'submit',
'class' => 'link-like spinner',
'label' => $this->getView()->icon('trash'),
'title' => $this->translate('Delete this downtime'),
'decorators' => array('ViewHelper')
)
);
return $this;
}
/**
* {@inheritdoc}
*/

View File

@ -17,18 +17,35 @@ class RemoveAcknowledgementCommandForm extends ObjectsCommandForm
*/
public function init()
{
$this->setAttrib('class', 'inline link-like');
$this->setAttrib('class', 'inline');
}
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
* {@inheritdoc}
*/
public function getSubmitLabel()
public function addSubmitButton()
{
return mtp(
'monitoring', 'Remove problem acknowledgement', 'Remove problem acknowledgements', count($this->objects)
$this->addElement(
'button',
'btn_submit',
array(
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'ignore' => true,
'label' => $this->getView()->icon('cancel'),
'title' => $this->translatePlural(
'Remove problem acknowledgement',
'Remove problem acknowledgements',
count($this->objects)
),
'type' => 'submit'
)
);
return $this;
}
/**

View File

@ -19,9 +19,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
public function init()
{
$this->setUseFormAutosubmit();
$this->setTitle('Feature Commands');
$this->setAttrib('class', 'inline object-features');
$this->loadDefaultDecorators()->getDecorator('description')->setTag('h2');
}
/**

View File

@ -18,7 +18,7 @@ class WelcomePage extends Form
'note',
'welcome',
array(
'value' => $this->translate('Welcome to the configuration of the monitoring module for Icinga Web 2!'),
'value' => $this->translate('Welcome to the configuration of the monitoring module for Icinga Web 2!'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -30,7 +30,8 @@ class WelcomePage extends Form
'note',
'core_hint',
array(
'value' => $this->translate('This is the core module for Icinga Web 2.')
'value' => $this->translate('This is the core module for Icinga Web 2.'),
'decorators' => array('ViewHelper')
)
);
@ -38,10 +39,11 @@ class WelcomePage extends Form
'note',
'description',
array(
'value' => $this->translate(
'value' => $this->translate(
'It offers various status and reporting views with powerful filter capabilities that allow'
. ' you to keep track of the most important events in your monitoring environment.'
)
),
'decorators' => array('ViewHelper')
)
);

View File

@ -49,7 +49,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
);
}
if (! $raw) {
$output = '<pre class="pluginoutput">' . $output . '</pre>';
$output = '<pre class="plugin-output">' . $output . '</pre>';
}
$output = $this->fixLinks($output);
return $output;

View File

@ -5,7 +5,6 @@
<?= $intervalBox; ?>
</div>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
</div>
<?php endif ?>
<div class="content alertsummary">

View File

@ -9,10 +9,10 @@
</div>
<div class="content">
<h3><?= $this->translate('Comment detail information') ?></h3>
<table class="avp">
<h2><?= $this->translate('Comment detail information') ?></h2>
<table class="name-value-table">
<tbody>
<tr data-base-target='_next'>
<tr>
<?php if ($this->comment->objecttype === 'service'): ?>
<th> <?= $this->translate('Service') ?> </th>
<td>

View File

@ -6,7 +6,7 @@
</div>
<div class="content multi-commands">
<h3><?= $this->icon('reschedule') ?><?= $this->translate('Commands') ?></h3>
<h2><?= $this->translate('Commands') ?></h2>
<?= $this->qlink(
sprintf($this->translate('Remove %d comments'), $comments->count()),
$removeAllLink,

View File

@ -1,94 +1,116 @@
<div class="controls">
<?= $tabs; ?>
<h1><?= $this->translate('Monitoring Backends') ?></h1>
<?= $tabs ?>
</div>
<div class="content" data-base-target="_next">
<p>
<a href="<?= $this->href('monitoring/config/createbackend'); ?>">
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Monitoring Backend'); ?>
</a>
</p>
<table class="action alternating">
<div>
<h2><?= $this->translate('Monitoring Backends') ?></h2>
<?= $this->qlink(
$this->translate('Create a New Monitoring Backend') ,
'monitoring/config/createbackend',
null,
array(
'class' => 'button action-link',
'icon' => 'plus',
'title' => $this->translate('Create a new monitoring backend')
)
) ?>
<table class="action-table listing-table">
<thead>
<tr>
<th><?= $this->translate('Monitoring Backend') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->backendsConfig as $backendName => $config): ?>
<tr>
<td>
<?= $this->qlink(
$backendName,
'monitoring/config/editbackend',
array('backend-name' => $backendName),
array(
'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
)
) ?>
<span class="text-small">&#40;<?= sprintf(
$this->translate('Type: %s'),
$this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
) ?>&#41;
</span>
</td>
<td class="text-right">
<?= $this->qlink(
'',
'monitoring/config/removebackend',
array('backend-name' => $backendName),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)
)
) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<div>
<h2><?= $this->translate('Command Transports') ?></h2>
<?= $this->qlink(
$this->translate('Create a New Command Transport') ,
'monitoring/config/createtransport',
null,
array(
'class' => 'button action-link',
'icon' => 'plus',
'title' => $this->translate('Create a new command transport')
)
) ?>
<table class="action-table listing-table">
<thead>
<th><?= $this->translate('Monitoring Backend'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
</thead>
<tbody>
<?php foreach ($this->backendsConfig as $backendName => $config): ?>
<tr>
<td>
<?= $this->qlink(
$backendName,
'monitoring/config/editbackend',
array('backend-name' => $backendName),
array(
'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
)
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
); ?>)</small>
</td>
<td>
<?= $this->qlink(
'',
'monitoring/config/removebackend',
array('backend-name' => $backendName),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)
)
); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h1><?= $this->translate('Command Transports') ?></h1>
<p>
<a href="<?= $this->href('monitoring/config/createtransport'); ?>">
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Transport'); ?>
</a>
</p>
<table class="action alternating">
<thead>
<th><?= $this->translate('Transport'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
<tr>
<th><?= $this->translate('Transport') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->transportConfig as $transportName => $config): ?>
<tr>
<td>
<?= $this->qlink(
$transportName,
'monitoring/config/edittransport',
array('transport' => $transportName),
array(
'icon' => 'edit',
'title' => sprintf($this->translate('Edit command transport %s'), $transportName)
)
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$config->host !== null ? $this->translate('Remote') : $this->translate('Local')
); ?>)</small>
</td>
<td>
<?= $this->qlink(
'',
'monitoring/config/removetransport',
array('transport' => $transportName),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove command transport %s'), $transportName)
)
); ?>
</td>
</tr>
<?php endforeach; ?>
<tr>
<td>
<?= $this->qlink(
$transportName,
'monitoring/config/edittransport',
array('transport' => $transportName),
array(
'icon' => 'edit',
'title' => sprintf($this->translate('Edit command transport %s'), $transportName)
)
); ?>
<span class="text-small">&#40;<?= sprintf(
$this->translate('Type: %s'),
$config->host !== null ? $this->translate('Remote') : $this->translate('Local')
) ?>&#41;
</span>
</td>
<td class="text-right">
<?= $this->qlink(
'',
'monitoring/config/removetransport',
array('transport' => $transportName),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove command transport %s'), $transportName)
)
); ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</table>
</div>
</div>

View File

@ -4,7 +4,9 @@
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
<table>
<tr> <?= $this->render('partials/downtime/downtime-header.phtml') ?> </tr>
</table>
</div>
<div class="content object-command">
<?= $delDowntimeForm; ?>

View File

@ -3,119 +3,171 @@
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
<table>
<tr> <?= $this->render('partials/downtime/downtime-header.phtml'); ?> </tr>
</table>
</div>
<div class="content">
<h3><?= $this->translate('Downtime detail information') ?></h3>
<table class="avp">
<tbody>
<div class="content"><h2><?= $this->translate('Details') ?></h2>
<table class="name-value-table">
<tbody>
<tr>
<th>
<?= $this->isService ? $this->translate('Service') : $this->translate('Host') ?>
</th>
<td data-base-target="_next">
<?php if ($this->isService): ?>
<?php
$link = $this->link()->service(
$downtime->service_description,
$downtime->service_display_name,
$downtime->host_name,
$downtime->host_display_name
);
$icon = $this->icon('service', $this->translate('Service'));
?>
<?php else: ?>
<?php
$icon = $this->icon('host', $this->translate('Host'));
$link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
?>
<?php endif ?>
<?= $icon ?>
<?= $link ?>
</td>
<th>
<?= $this->isService ? $this->translate('Service') : $this->translate('Host') ?>
</th>
<td data-base-target="_next">
<?php if ($this->isService): ?>
<?php
$link = $this->link()->service(
$downtime->service_description,
$downtime->service_display_name,
$downtime->host_name,
$downtime->host_display_name
);
$icon = $this->icon('service', $this->translate('Service'));
?>
<?php else: ?>
<?php
$icon = $this->icon('host', $this->translate('Host'));
$link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
?>
<?php endif ?>
<?= $icon ?>
<?= $link ?>
</td>
</tr>
<tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
<th><?= $this->translate('Author') ?></th>
<td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td>
</tr>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th>
<td><?= $this->icon('comment', $this->translate('Comment')) ?> <?= $this->escape($this->downtime->comment) ?></td>
</tr>
<tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
<th><?= $this->translate('Entry Time') ?></th>
<td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
</tr>
<tr class="newsection">
<th><?= $this->escape(
$this->downtime->is_flexible ?
$this->translate('Flexible') : $this->translate('Fixed')
); ?></th>
<td>
<?= $this->escape(
$this->downtime->is_flexible ?
$this->translate('Flexible downtimes have a hard start and end time,'
. ' but also an additional restriction on the duration in which '
. ' the host or service may actually be down.') :
$this->translate('Fixed downtimes have a static start and end time.')
); ?>
</td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime is'
. ' supposed to start. If this is a flexible (non-fixed) downtime, '
. 'this refers to the earliest possible time that the downtime'
. ' can start'); ?>">
<th><?= $this->translate('Scheduled start') ?></th>
<td><?= $this->formatDateTime($this->downtime->scheduled_start) ?></td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime is '
. 'supposed to end. If this is a flexible (non-fixed) downtime, '
. 'this refers to the last possible time that the downtime can '
. 'start'); ?>">
<th><?= $this->translate('Scheduled end') ?></th>
<td><?= $this->formatDateTime($this->downtime->scheduled_end) ?></td>
</tr>
<?php if ($this->downtime->is_flexible): ?>
<tr title="<?= $this->translate('Indicates the number of seconds that the '
. 'scheduled downtime should last. This is usually only needed if'
. ' this is a flexible downtime, which can start at a variable '
. 'time, but lasts for the specified duration'); ?>">
<th tit><?= $this->translate('Duration') ?></th>
<td><?= $this->formatDuration($this->downtime->duration) ?></td>
<tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
<th><?= $this->translate('Author') ?></th>
<td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td>
</tr>
<tr title="<?= $this->translate('he date/time the scheduled downtime was'
. ' actually started'); ?>">
<th><?= $this->translate('Actual start time') ?></th>
<td><?= $this->formatDateTime($downtime->start) ?></td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime '
. 'actually ended'); ?>">
<th><?= $this->translate('Actual end time') ?></th>
<td><?= $this->formatDateTime($downtime->end) ?></td>
</tr>
<?php endif; ?>
<tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
<th><?= $this->translate('Entry Time') ?></th>
<td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
</tr>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th>
<td class="comment-text"><?= $this->escape($this->downtime->comment) ?></td>
</tr>
</tbody>
</table>
<tr class="newsection">
<th><?= $this->translate('In effect') ?></th>
<td>
<?= $this->escape(
$this->downtime->is_in_effect ?
$this->translate('Yes') : $this->translate('No')
);
?>
</td>
</tr>
<h2> <?= $this->translate('Duration') ?> </h2>
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
<tr class="newsection">
<th><?= $this->translate('Commands') ?></th>
<td>
<?= $delDowntimeForm ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<table class="name-value-table">
<tbody>
<tr class="newsection">
<th><?= $this->escape(
$this->downtime->is_flexible ?
$this->translate('Flexible') : $this->translate('Fixed')
); ?>
<?= $this->icon('info-circled', $this->downtime->is_flexible ?
$this->translate('Flexible downtimes have a hard start and end time,'
. ' but also an additional restriction on the duration in which '
. ' the host or service may actually be down.') :
$this->translate('Fixed downtimes have a static start and end time.')) ?>
</th>
<td>
<?php if ($downtime->is_flexible): ?>
<?php if ($downtime->is_in_effect): ?>
<?= sprintf(
$isService
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
$this->formatDate($downtime->start),
$this->formatTime($downtime->start),
$this->formatDuration($downtime->duration),
$this->formatDate($downtime->end),
$this->formatTime($downtime->end)
) ?>
<?php else: ?>
<?= sprintf(
$isService
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
$this->formatDateTime($downtime->scheduled_start),
$this->formatDateTime($downtime->scheduled_end),
$this->formatDuration($downtime->duration)
) ?>
<?php endif ?>
<?php else: ?>
<?php if ($downtime->is_in_effect): ?>
<?= sprintf(
$isService
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
$this->formatDate($downtime->start),
$this->formatTime($downtime->start),
$this->formatDate($downtime->end),
$this->formatTime($downtime->end)
) ?>
<?php else: ?>
<?= sprintf(
$isService
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
$this->formatDate($downtime->start),
$this->formatTime($downtime->start),
$this->formatDate($downtime->end),
$this->formatTime($downtime->end)
) ?>
<?php endif ?>
<?php endif ?>
</td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime is'
. ' supposed to start. If this is a flexible (non-fixed) downtime, '
. 'this refers to the earliest possible time that the downtime'
. ' can start'); ?>">
<th><?= $this->translate('Scheduled start') ?></th>
<td><?= $this->formatDateTime($this->downtime->scheduled_start) ?></td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime is '
. 'supposed to end. If this is a flexible (non-fixed) downtime, '
. 'this refers to the last possible time that the downtime can '
. 'start'); ?>">
<th><?= $this->translate('Scheduled end') ?></th>
<td><?= $this->formatDateTime($this->downtime->scheduled_end) ?></td>
</tr>
<?php if ($this->downtime->is_flexible): ?>
<tr title="<?= $this->translate('Indicates the number of seconds that the '
. 'scheduled downtime should last. This is usually only needed if'
. ' this is a flexible downtime, which can start at a variable '
. 'time, but lasts for the specified duration'); ?>">
<th tit><?= $this->translate('Duration') ?></th>
<td><?= $this->formatDuration($this->downtime->duration) ?></td>
</tr>
<tr title="<?= $this->translate('he date/time the scheduled downtime was'
. ' actually started'); ?>">
<th><?= $this->translate('Actual start time') ?></th>
<td><?= $this->formatDateTime($downtime->start) ?></td>
</tr>
<tr title="<?= $this->translate('The date/time the scheduled downtime '
. 'actually ended'); ?>">
<th><?= $this->translate('Actual end time') ?></th>
<td><?= $this->formatDateTime($downtime->end) ?></td>
</tr>
<?php endif; ?>
<tr class="newsection">
<th><?= $this->translate('In effect') ?></th>
<td>
<?= $this->escape(
$this->downtime->is_in_effect ?
$this->translate('Yes') : $this->translate('No')
);
?>
</td>
</tr>
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
<tr class="newsection">
<th><?= $this->translate('Commands') ?></th>
<td>
<?= $delDowntimeForm ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
</div>

View File

@ -8,5 +8,5 @@
</div>
<div class="content object-command">
<?= $delDowntimeForm ?>
<?= $delAllDowntimeForm ?>
</div>

View File

@ -6,7 +6,7 @@
</div>
<div class="content multi-commands">
<h3><?= $this->icon('reschedule') ?><?= $this->translate('Commands') ?></h3>
<h2> <?= $this->translate('Commands') ?> </h2>
<?= $this->qlink(
sprintf($this->translate('Remove all %d scheduled downtimes'), $downtimes->count()),
$removeAllLink,

View File

@ -8,9 +8,9 @@ if (! $this->compact): ?>
</div>
<?php endif ?>
<div class="content processinfo">
<div class="content processinfo grid">
<div class="boxview">
<div style="min-width: 30em;" class="box left">
<div class="box process col-1-2">
<h2><?= $this->translate('Process Info') ?></h2>
<table class="avp">
<tbody>
@ -75,9 +75,7 @@ if (! $this->compact): ?>
</div>
<?php endif ?>
</div>
<br>
<div style="min-width: 30em;" class="box left">
<div class="box features col-1-2">
<?= $this->toggleFeaturesForm; ?>
</div>
</div>

View File

@ -8,9 +8,9 @@ if (! $this->compact): ?>
</div>
<?php endif ?>
<div class="content processinfo">
<div class="content stats grid">
<div class="boxview">
<div class="box left">
<div class="box stats col-1-2">
<h3><?= $this->unhandledProblems ?> <?= $this->translate('Unhandled Problems:') ?>
<span class="badge badge-critical"> <?= $this->unhandledProblems ?> </span>
</h3>

View File

@ -28,11 +28,11 @@ $history->limit($limit * $page);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->render('partials/host/object-header.phtml'); ?>
<?= $this->render('partials/object/host-header.phtml'); ?>
<h1><?= $this->translate('This Host\'s Event History'); ?></h1>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<a class="load-more-hint" href="#load-more">
<a href="#load-more">
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
</a>
<?= $this->filterEditor; ?>
@ -110,14 +110,13 @@ if (! $this->compact): ?>
break;
}
?>
<tr class="state <?= $stateClass; ?>">
<td class="state">
<tr>
<td class="state-col state-<?= $stateClass; ?>">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
<?php endif ?>
<strong><?= $this->escape($title); ?></strong>
<br>
<?= date('d.m. H:i', $event->timestamp); ?>
<p><?= date('d.m. H:i', $event->timestamp); ?></p>
</td>
<td>
<?php if ($isService): ?>
@ -141,10 +140,9 @@ if (! $this->compact): ?>
<?php else: ?>
<?= $this->escape($event->host_name); ?>
<?php endif ?>
<br>
<div>
<p class="plugin-output">
<?= $this->icon($icon, $title); ?> <?= $this->createTicketLinks($msg) ?>
</div>
</p>
</td>
</tr>
<?php endforeach; ?>
@ -153,7 +151,7 @@ if (! $this->compact): ?>
<?php if (! $history->hasResult()): ?>
<?= $this->translate('No history events found matching the filter'); ?>
<?php elseif ($history->hasMore()): ?>
<div class="load-more-container"><?= $this->qlink(
<?= $this->qlink(
$this->translate('Load More'),
$url->setAnchor('page-' . ($page + 1)),
array(
@ -161,8 +159,8 @@ if (! $this->compact): ?>
),
array(
'id' => 'load-more',
'class' => 'pull-right load-more button-like'
'class' => 'pull-right action-link'
)
); ?></div>
); ?>
<?php endif ?>
</div>

View File

@ -4,14 +4,12 @@
<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/object-header.phtml') ?>
<h2 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>
<?= $this->render('partials/object/host-header.phtml') ?>
<?php
$this->baseFilter = Filter::where('host', $object->host_name);
$this->stats = $object->stats;
echo $this->render('list/components/servicesummary.phtml');
?>
</h2>
</div>
<?= $this->partial(
'list/services.phtml',
@ -22,4 +20,4 @@
'services' => $services,
'addColumns' => array()
)
); ?>
); ?>

View File

@ -1,43 +1,15 @@
<?php use Icinga\Data\Filter\Filter; ?>
<div class="controls separated">
<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/object-header.phtml') ?>
<h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?php
$this->stats = $object->stats;
$this->baseFilter = Filter::where('host', $object->host_name);
echo $this->render('list/components/servicesummary.phtml');
?>
</h3>
<?php if (! $this->compact): ?>
<?= $this->tabs ?>
<?php endif ?>
<?= $this->render('partials/object/host-header.phtml') ?>
<?php
$this->stats = $object->stats;
$this->baseFilter = Filter::where('host', $object->host_name);
echo $this->render('list/components/servicesummary.phtml');
?>
</div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>
<?= $this->render('show/components/grapher.phtml') ?>
<table class="avp newsection">
<tbody>
<tr><td colspan="2"><h2><?= $this->translate('Problem handling') ?></h2></td></tr>
<?= $this->render('show/components/acknowledgement.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>
<?= $this->render('show/components/downtime.phtml') ?>
<?= $this->render('show/components/notes.phtml') ?>
<?= $this->render('show/components/actions.phtml') ?>
<?= $this->render('show/components/flapping.phtml') ?>
<?= $this->render('show/components/hostgroups.phtml') ?>
<?= $this->render('show/components/perfdata.phtml') ?>
<tr><td colspan="2"><h2><?= $this->translate('Notifications') ?></h2></td></tr>
<?= $this->render('show/components/notifications.phtml') ?>
<?= $this->render('show/components/contacts.phtml') ?>
<tr><td colspan="2"><h2><?= $this->translate('Check execution') ?></h2></td></tr>
<?= $this->render('show/components/command.phtml') ?>
<?= $this->render('show/components/checksource.phtml') ?>
<?= $this->render('show/components/checkstatistics.phtml') ?>
<?= $this->render('show/components/checktimeperiod.phtml') ?>
<?= $this->render('show/components/customvars.phtml') ?>
<?= $this->render('show/components/flags.phtml') ?>
</tbody>
</table>
</div>
<?= $this->render('partials/object/detail-content.phtml') ?>

Some files were not shown because too many files have changed in this diff Show More