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

View File

@ -156,8 +156,7 @@ class GroupController extends AuthBackendController
$form->setRepository($backend); $form->setRepository($backend);
$form->add()->handleRequest(); $form->add()->handleRequest();
$this->view->form = $form; $this->renderForm($form, $this->translate('New User Group'));
$this->render('form');
} }
/** /**
@ -181,8 +180,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Update User Group'));
$this->render('form');
} }
/** /**
@ -204,8 +202,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Remove User Group'));
$this->render('form');
} }
/** /**
@ -232,8 +229,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('New User Group Member'));
$this->render('form');
} }
/** /**
@ -342,16 +338,36 @@ class GroupController extends AuthBackendController
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $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( $tabs->add(
'group/list', 'group/list',
array( array(
'title' => $this->translate('List groups of user group backends'), 'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Usergroups'), 'label' => $this->translate('User Groups'),
'icon' => 'users', 'icon' => 'users',
'url' => 'group/list' 'url' => 'group/list'
) )
); );
return $tabs; return $tabs;
} }
} }

View File

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

View File

@ -28,13 +28,16 @@ class PreferenceController extends BasePreferenceController
public static function createProvidedTabs() public static function createProvidedTabs()
{ {
return array( return array(
'preferences' => new Tab( 'preferences' => new Tab(array(
array( 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'), 'label' => t('Preferences'),
'label' => t('Preferences'), 'url' => 'preference'
'url' => Url::fromPath('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 * List roles
*
* @TODO(el): Rename to indexAction()
*/ */
public function listAction() public function listAction()
{ {
@ -30,6 +32,8 @@ class RoleController extends AuthBackendController
/** /**
* Create a new role * Create a new role
*
* @TODO(el): Rename to newAction()
*/ */
public function addAction() public function addAction()
{ {
@ -52,24 +56,23 @@ class RoleController extends AuthBackendController
} }
)); ));
$role $role
->setTitle($this->translate('New Role'))
->setSubmitLabel($this->translate('Create Role')) ->setSubmitLabel($this->translate('Create Role'))
->setIniConfig(Config::app('roles', true)) ->setIniConfig(Config::app('roles', true))
->setRedirectUrl('role/list') ->setRedirectUrl('role/list')
->handleRequest(); ->handleRequest();
$this->view->form = $role; $this->renderForm($role, $this->translate('New Role'));
$this->render('form');
} }
/** /**
* Update a role * Update a role
*
* @TODO(el): Rename to updateAction()
*/ */
public function editAction() public function editAction()
{ {
$this->assertPermission('config/authentication/roles/edit'); $this->assertPermission('config/authentication/roles/edit');
$name = $this->params->getRequired('role'); $name = $this->params->getRequired('role');
$role = new RoleForm(); $role = new RoleForm();
$role->setTitle(sprintf($this->translate('Update Role %s'), $name));
$role->setSubmitLabel($this->translate('Update Role')); $role->setSubmitLabel($this->translate('Update Role'));
try { try {
$role $role
@ -97,8 +100,7 @@ class RoleController extends AuthBackendController
}) })
->setRedirectUrl('role/list') ->setRedirectUrl('role/list')
->handleRequest(); ->handleRequest();
$this->view->form = $role; $this->renderForm($role, $this->translate('Update Role'));
$this->render('form');
} }
/** /**
@ -132,12 +134,10 @@ class RoleController extends AuthBackendController
} }
)); ));
$confirmation $confirmation
->setTitle(sprintf($this->translate('Remove Role %s'), $name))
->setSubmitLabel($this->translate('Remove Role')) ->setSubmitLabel($this->translate('Remove Role'))
->setRedirectUrl('role/list') ->setRedirectUrl('role/list')
->handleRequest(); ->handleRequest();
$this->view->form = $confirmation; $this->renderForm($confirmation, $this->translate('Remove Role'));
$this->render('form');
} }
/** /**
@ -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; return $tabs;
} }
} }

View File

@ -162,8 +162,7 @@ class UserController extends AuthBackendController
$form->setRepository($backend); $form->setRepository($backend);
$form->add()->handleRequest(); $form->add()->handleRequest();
$this->view->form = $form; $this->renderForm($form, $this->translate('New User'));
$this->render('form');
} }
/** /**
@ -185,8 +184,7 @@ class UserController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName)); $this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Update User'));
$this->render('form');
} }
/** /**
@ -208,8 +206,7 @@ class UserController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName)); $this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Remove User'));
$this->render('form');
} }
/** /**
@ -305,6 +302,18 @@ class UserController extends AuthBackendController
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $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( $tabs->add(
'user/list', 'user/list',
array( array(
@ -314,7 +323,15 @@ class UserController extends AuthBackendController
'url' => 'user/list' '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; return $tabs;
} }
} }

View File

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

View File

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

View File

@ -121,4 +121,9 @@
.icon-right-small:before { content: '\e877'; } /* '' */ .icon-right-small:before { content: '\e877'; } /* '' */
.icon-up-small:before { content: '\e878'; } /* '' */ .icon-up-small:before { content: '\e878'; } /* '' */
.icon-pin:before { content: '\e879'; } /* '' */ .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-right-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-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-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-right-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-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-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-face {
font-family: 'ifont'; font-family: 'ifont';
src: url('../font/ifont.eot?82929165'); src: url('../font/ifont.eot?75407611');
src: url('../font/ifont.eot?82929165#iefix') format('embedded-opentype'), src: url('../font/ifont.eot?75407611#iefix') format('embedded-opentype'),
url('../font/ifont.woff?82929165') format('woff'), url('../font/ifont.woff?75407611') format('woff'),
url('../font/ifont.ttf?82929165') format('truetype'), url('../font/ifont.ttf?75407611') format('truetype'),
url('../font/ifont.svg?82929165#ifont') format('svg'); url('../font/ifont.svg?75407611#ifont') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@ -14,7 +14,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) { @media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face { @font-face {
font-family: 'ifont'; 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-right-small:before { content: '\e877'; } /* '' */
.icon-up-small:before { content: '\e878'; } /* '' */ .icon-up-small:before { content: '\e878'; } /* '' */
.icon-pin:before { content: '\e879'; } /* '' */ .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-face {
font-family: 'ifont'; font-family: 'ifont';
src: url('./font/ifont.eot?83291894'); src: url('./font/ifont.eot?195161');
src: url('./font/ifont.eot?83291894#iefix') format('embedded-opentype'), src: url('./font/ifont.eot?195161#iefix') format('embedded-opentype'),
url('./font/ifont.woff?83291894') format('woff'), url('./font/ifont.woff?195161') format('woff'),
url('./font/ifont.ttf?83291894') format('truetype'), url('./font/ifont.ttf?195161') format('truetype'),
url('./font/ifont.svg?83291894#ifont') format('svg'); url('./font/ifont.svg?195161#ifont') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@ -483,7 +483,14 @@ body {
<div class="row"> <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: 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: 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: 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> </div>
<div class="container footer">Generated by <a href="http://fontello.com">fontello.com</a></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( array(
'required' => true, 'required' => true,
'label' => $this->translate('Username'), 'label' => $this->translate('Username'),
'placeholder' => $this->translate('Please enter your username...'),
'class' => false === isset($formData['username']) ? 'autofocus' : '' 'class' => false === isset($formData['username']) ? 'autofocus' : ''
) )
); );
@ -51,7 +50,6 @@ class LoginForm extends Form
array( array(
'required' => true, 'required' => true,
'label' => $this->translate('Password'), 'label' => $this->translate('Password'),
'placeholder' => $this->translate('...and your password'),
'class' => isset($formData['username']) ? 'autofocus' : '' 'class' => isset($formData['username']) ? 'autofocus' : ''
) )
); );

View File

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

View File

@ -369,7 +369,7 @@ class ResourceConfigForm extends ConfigForm
array( array(
'decorators' => array( 'decorators' => array(
'FormElements', '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', 'button',
'discovery_btn', 'discovery_btn',
array( array(
'class' => 'control-button',
'type' => 'submit', 'type' => 'submit',
'value' => 'discovery_btn', 'value' => 'discovery_btn',
'label' => $this->translate('Discover', 'A button to discover LDAP capabilities'), 'label' => $this->translate('Discover', 'A button to discover LDAP capabilities'),
@ -90,21 +91,12 @@ class LdapBackendForm extends Form
), ),
'decorators' => array( 'decorators' => array(
array('ViewHelper', array('separator' => '')), 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' '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()) { if ($this->getElement('discovery_btn')->isChecked()) {
$connection = ResourceFactory::create( $connection = ResourceFactory::create(

View File

@ -476,7 +476,7 @@ class UserBackendConfigForm extends ConfigForm
array( array(
'decorators' => array( 'decorators' => array(
'FormElements', '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', 'dashboard',
null, null,
array( array(
'icon' => '../logo_icinga-inv.png', 'icon' => 'img/logo_icinga-inv.png',
'data-base-target' => '_main', 'data-base-target' => '_main',
'aria-hidden' => 'true', 'aria-hidden' => 'true',
'tabindex' => -1 'tabindex' => -1
) )
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('../logo_icinga-inv.png'); ?> <?= $this->icon('img/logo_icinga-inv.png'); ?>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>
@ -60,4 +60,4 @@ if ($this->layout()->autorefreshInterval) {
} }
} }
?></ul> ?></ul>
</div> </div>

View File

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

View File

@ -5,7 +5,6 @@
</div> </div>
</div> </div>
<div class="form" data-base-target="layout"> <div class="form" data-base-target="layout">
<h1><?= $this->translate('Welcome to Icinga Web 2'); ?></h1>
<?php if ($requiresSetup): ?> <?php if ($requiresSetup): ?>
<p class="config-note"><?= sprintf( <p class="config-note"><?= sprintf(
$this->translate( $this->translate(
@ -19,6 +18,29 @@
); ?></p> ); ?></p>
<?php endif ?> <?php endif ?>
<?= $this->form ?> <?= $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>
</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"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $tabs ?>
</div> </div>
<div class="content"> <div class="content">
<?php if (isset($this->messageBox)): ?> <?= $form ?>
<?= $this->messageBox->render() ?>
<?php endif ?>
<?= $this->form ?>
</div> </div>

View File

@ -11,7 +11,7 @@
$permissions = $module->getProvidedPermissions(); $permissions = $module->getProvidedPermissions();
$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled' $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
?> ?>
<table class="avp"> <table class="name-value-table">
<tr> <tr>
<th><?= $this->escape($this->translate('Name')) ?></th> <th><?= $this->escape($this->translate('Name')) ?></th>
<td><?= $this->escape($module->getName()) ?></td> <td><?= $this->escape($module->getName()) ?></td>
@ -23,7 +23,7 @@
$this->translate('disable'), $this->translate('disable'),
'config/moduledisable', 'config/moduledisable',
array('name' => $module->getName()), 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 endif ?>
<?php if ($state === 'disabled'): ?> <?php if ($state === 'disabled'): ?>
@ -31,7 +31,7 @@
$this->translate('enable'), $this->translate('enable'),
'config/moduleenable', 'config/moduleenable',
array('name' => $module->getName()), 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 ?> <?php endif ?>
</td> </td>

View File

@ -1,14 +1,27 @@
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <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> <tbody>
<?php foreach ($modules as $module): ?> <?php foreach ($modules as $module): ?>
<tr> <tr>
@ -25,7 +38,7 @@
$module->name, $module->name,
'config/module/', 'config/module/',
array('name' => $module->name), 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> </td>
</tr> </tr>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,9 +6,17 @@ use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<div> <div>
<?= $this->backendSelection; ?> <?= $this->backendSelection; ?>
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
@ -25,12 +33,29 @@ if (! isset($backend)) {
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible; $extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible; $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; $firstRow = true;
foreach ($groups as $group): ?> foreach ($groups as $group): ?>
<?php if ($firstRow): ?> <?php if ($firstRow): ?>
<?php $firstRow = false; ?> <?php $firstRow = false; ?>
<table data-base-target="_next" class="action group-list alternating"> <table data-base-target="_next" class="action-table listing-table">
<thead> <thead>
<tr> <tr>
<th class="group-name"><?= $this->translate('Group'); ?></th> <th class="group-name"><?= $this->translate('Group'); ?></th>
@ -72,11 +97,4 @@ foreach ($groups as $group): ?>
<?php else: ?> <?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p> <p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?> <?php endif ?>
<?php if ($extensible): ?> </div>
<?= $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>

View File

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

View File

@ -13,4 +13,4 @@ if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?>
/> />
</form> </form>
<?php endif; ?> <?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): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>

View File

@ -1,93 +1,81 @@
<?php <?php
use Icinga\Web\Url; 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; 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 <div class="pagination-control" role="navigation">
<h2 id="<?= $this->protectId('pagination') ?>" class="sr-only" tabindex="-1"><?= $this->translate('Pagination') ?></h2>
if (isset($this->previous)) { <ul class="nav tab-nav">
printf( <?php if (isset($this->previous)): ?>
$li, <?php $label = sprintf(
'', $this->translate('Show rows %u to %u of %u'),
Url::fromRequest()->overwriteParams( ($this->current - 2) * $this->itemCountPerPage + 1,
array('page' => $this->previous) ($this->current - 1) * $this->itemCountPerPage,
)->getAbsoluteUrl(), $this->totalItemCount
$title_prev, ) ?>
'« ' . t('Prev') <li class="nav-item">
); <a href="<?= Url::fromRequest()->overwriteParams(array('page' => $this->previous)) ?>"
} else { title="<?= $label ?>"
echo ' ><li class="disabled"><span>« ' . t('Prev') . '</span></li'; aria-label="<?= $label ?>">
} <?= $this->icon('angle-double-left') ?>
</a>
foreach ($this->pagesInRange as $page) { </li>
$start = ($page - 1) * $limit + 1; <?php else: ?>
$end = $page * $limit; <li class="nav-item disabled" aria-hidden="true">
if ($end > $total) { <span>
$end = $total; <span class="sr-only"><?= $this->translate('Previous page') ?></span>
} <?= $this->icon('angle-double-left') ?>
$title = sprintf($fromto, $start, $end, $total); </span>
$class = $page === $this->current ? ' class="active"' : ''; </li>
<?php endif ?>
if ($page === '...') { <?php foreach ($this->pagesInRange as $page): ?>
echo ' ><li class="disabled"><span>...</span></li'; <?php if ($page === '...'): ?>
} else { <li class="nav-item disabled">
printf( <span>...</span>
$li, </li>
$class, <?php else: ?>
Url::fromRequest()->overwriteParams( <?php
array('page' => $page) $end = $page * $this->itemCountPerPage;
), if ($end > $this->totalItemCount) {
$title, $end = $this->totalItemCount;
$page }
); $label = sprintf(
} $this->translate('Show rows %u to %u of %u'),
} ($page - 1) * $this->itemCountPerPage + 1,
$end,
if (isset($this->next)) { $this->totalItemCount
printf( );
$li, ?>
'', <li<?= $page === $this->current ? ' class="active nav-item"' : ' class="nav-item"' ?>>
Url::fromRequest()->overwriteParams( <a href="<?= Url::fromRequest()->overwriteParams(array('page' => $page)) ?>"
array('page' => $this->next) title="<?= $label ?>"
)->getAbsoluteUrl(), aria-label="<?= $label ?>">
$title_next, <?= $page ?>
t('Next') . ' »' </a>
); </li>
} else { <?php endif ?>
echo ' ><li class="disabled"><span>' . t('Next') . ' »</span></li'; <?php endforeach ?>
} <?php if (isset($this->next)): ?>
<?php $label = sprintf(
?> $this->translate('Show rows %u to %u of %u'),
></ul> $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): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
<?= $this->filterEditor; ?> </div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content">
<a href="<?= $this->href('navigation/add'); ?>"> <?= $this->qlink(
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?> $this->translate('Create a New Navigation Item') ,
</a> '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): ?> <?php if (count($items) === 0): ?>
<p><?= $this->translate('You did not create any navigation item yet'); ?></p> <p><?= $this->translate('You did not create any navigation item yet.') ?></p>
<?php else: ?> </div>
<table class="action alternating"> <?php return; endif ?>
<thead> <table class="action-table listing-table" data-base-target="_next">
<th><?= $this->translate('Navigation'); ?></th> <thead>
<th style="width: 10em"><?= $this->translate('Type'); ?></th> <tr>
<th style="width: 5em"><?= $this->translate('Shared'); ?></th> <th><?= $this->translate('Navigation') ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th> <th><?= $this->translate('Type') ?></th>
</thead> <th><?= $this->translate('Shared') ?></th>
<tbody> <th></th>
<?php foreach ($items as $item): ?> </tr>
<tr> </thead>
<td><?= $this->qlink( <tbody>
$item->name, <?php foreach ($items as $item): ?>
'navigation/edit', <tr>
array( <td>
'name' => $item->name, <?= $this->qlink(
'type' => $item->type $item->name,
), 'navigation/edit',
array( array(
'title' => sprintf($this->translate('Edit navigation item %s'), $item->name) 'name' => $item->name,
) 'type' => $item->type
); ?></td> ),
<td><?= $item->type && isset($types[$item->type]) array(
? $this->escape($types[$item->type]) 'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
: $this->escape($this->translate('Unknown')); ?></td> )
<td><?= $item->owner ? $this->translate('Yes') : $this->translate('No'); ?></td> ) ?>
<td><?= $this->qlink( </td>
'', <td>
'navigation/remove', <?= $item->type && isset($types[$item->type])
array( ? $this->escape($types[$item->type])
'name' => $item->name, : $this->escape($this->translate('Unknown')) ?>
'type' => $item->type </td>
), <td class="icon-col">
array( <?= $item->owner ? $this->translate('Yes') : $this->translate('No') ?>
'icon' => 'trash', </td>
'title' => sprintf($this->translate('Remove navigation item %s'), $item->name) <td class="icon-col text-right">
) <?= $this->qlink(
); ?></td> '',
</tr> 'navigation/remove',
<?php endforeach ?> array(
</tbody> '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> </table>
<?php endif ?> </div>
</div>

View File

@ -5,9 +5,17 @@ use Icinga\Web\Url;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?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 ?> <?= $tabs ?>
</div> </div>
<div class="content"> <div class="content">
<div> <?= $this->qlink(
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?> $this->translate('Create a New Role') ,
<?= $this->translate('No roles found.') ?> 'role/add',
<?php else: ?> null,
<table class="avp action alternating" data-base-target="_next"> array(
<thead> 'class' => 'button-link',
<tr> 'data-base-target' => '_next',
<th><?= $this->translate('Name') ?></th> 'icon' => 'plus',
<!-- <th>--><?//= $this->translate('Permissions') ?><!--</th>--> 'title' => $this->translate('Create a new role')
<!-- <th>--><?//= $this->translate('Restrictions') ?><!--</th>--> )
<th><?= $this->translate('Users') ?></th> ) ?>
<th><?= $this->translate('Groups') ?></th> <?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
</tr> <p><?= $this->translate('No roles found.') ?></p>
</thead> <?php return; endif ?>
<tbody> <table class="action-table listing-table" data-base-target="_next">
<?php foreach ($roles as $name => $role): /** @var object $role */ ?> <thead>
<tr> <tr>
<td> <th><?= $this->translate('Name') ?></th>
<?= $this->qlink( <th><?= $this->translate('Users') ?></th>
$name, <th><?= $this->translate('Groups') ?></th>
'role/edit', <th></th>
array('role' => $name), </tr>
array('title' => sprintf($this->translate('Edit role %s'), $name)) </thead>
); ?> <tbody>
</td> <?php foreach ($roles as $name => $role): /** @var object $role */ ?>
<!-- <td>--><?//= $this->escape($role->permissions, 0, 50) ?><!--</td>--> <tr>
<!-- <td>--> <td>
<!-- --><?php <?= $this->qlink(
// // TODO(el): $role->without(...) or $role->shift(...) would be nice! $name,
// $restrictions = clone $role; 'role/edit',
// unset($restrictions['users']); array('role' => $name),
// unset($restrictions['groups']); array('title' => sprintf($this->translate('Edit role %s'), $name))
// unset($restrictions['permissions']); ) ?>
// ?> </td>
<!-- --><?php //if (! empty($restrictions)): ?> <td><?= $this->escape($role->users) ?></td>
<!-- <table>--> <td><?= $this->escape($role->groups) ?></td>
<!-- <tbody>--> <td class="icon-col text-right">
<!-- --><?php //foreach ($restrictions as $restrictionName => $restriction): ?> <?= $this->qlink(
<!-- <tr>--> '',
<!-- <th>--><?//= $this->escape($restrictionName) ?><!--</th>--> 'role/remove',
<!-- <td>--><?//= $this->escape($restriction) ?><!--</td>--> array('role' => $name),
<!-- </tr>--> array(
<!-- --><?php //endforeach ?> 'class' => 'action-link',
<!-- </tbody>--> 'icon' => 'cancel',
<!-- </table>--> 'title' => sprintf($this->translate('Remove role %s'), $name)
<!-- --><?php //endif ?> )
<!-- </td>--> ) ?>
<td><?= $this->escape($role->users) ?></td> </td>
<td><?= $this->escape($role->groups) ?></td> </tr>
<td> <?php endforeach ?>
<?= $this->qlink( </tbody>
'', </table>
'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>
</div> </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 <?php
use Icinga\Data\Extensible; use Icinga\Data\Extensible;
use Icinga\Data\Reducible; use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs ?>
<?= $this->sortBox; ?> <div class="grid dont-print">
<?= $this->limiter; ?> <div class="col-1-3 text-left">
<?= $this->paginator; ?> <?= $this->limiter ?>
<div> </div>
<?= $this->backendSelection; ?> <div class="col-1-3">
<?= $this->filterEditor; ?> <?= $this->paginator ?>
</div> </div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<div>
<?= $this->backendSelection ?>
<?= $this->filterEditor ?>
</div>
</div> </div>
<?php endif ?> <?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 <?php
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
if (! isset($backend)) { $reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
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 ?>
<?php if ($extensible): ?> <?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array( <?= $this->qlink(
'icon' => 'plus', $this->translate('Add a New User') ,
'data-base-target' => '_next', 'user/add',
'class' => '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 ?> <?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): ?> <?php if (! $this->compact): ?>
<?= $tabs; ?> <?= $tabs; ?>
<?php endif ?> <?php endif ?>
<h1><?= $this->escape($user->user_name); ?><span class="pull-right"><?= $editLink; ?></span></h1> <h2 class="clearfix"><?= $this->escape($user->user_name) ?><span class="pull-right"><?= $editLink ?></span></h2>
<table class="avp user-header"> <table class="name-value-table">
<tr> <tr>
<th><?= $this->translate('State'); ?></th> <th><?= $this->translate('State'); ?></th>
<td><?= $user->is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?></td> <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 ?> <?php endif ?>
</div> </div>
<div class="content memberships"> <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 <?php
// @TODO(el): Remove that $firstRow thingy
$firstRow = true; $firstRow = true;
foreach ($memberships as $membership): ?> foreach ($memberships as $membership): ?>
<?php if ($firstRow): ?> <?php if ($firstRow): ?>
<?php $firstRow = false; ?> <?php $firstRow = false; ?>
<table data-base-target="_next" class="action membership-list alternating"> <table data-base-target="_next" class="action-table listing-table">
<thead> <thead>
<tr> <tr>
<th class="membership-group"><?= $this->translate('Group'); ?></th> <th class="membership-group"><?= $this->translate('Group'); ?></th>
@ -98,19 +111,4 @@ foreach ($memberships as $membership): ?>
<?php else: ?> <?php else: ?>
<p><?= $this->translate('No memberships found matching the filter'); ?></p> <p><?= $this->translate('No memberships found matching the filter'); ?></p>
<?php endif ?> <?php endif ?>
<?php if ($showCreateMembershipLink): ?> </div>
<?= $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>

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

View File

@ -256,43 +256,31 @@ class Web extends EmbeddedWeb
'permission' => 'config/*', 'permission' => 'config/*',
'priority' => 800, 'priority' => 800,
'children' => array( 'children' => array(
'application' => array( 'application' => array(
'label' => t('Application'), 'label' => t('Application'),
'url' => 'config/general', 'url' => 'config/general',
'permission' => 'config/application/*', 'permission' => 'config/application/*',
'priority' => 810 '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'), 'label' => t('Shared Navigation'),
'url' => 'navigation/shared', 'url' => 'navigation/shared',
'permission' => 'config/application/navigation', 'permission' => 'config/application/navigation',
'priority' => 820, 'priority' => 840,
), ),
'authentication' => array( 'modules' => 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(
'label' => t('Modules'), 'label' => t('Modules'),
'url' => 'config/modules', 'url' => 'config/modules',
'permission' => 'config/modules', 'permission' => 'config/modules',
@ -301,30 +289,25 @@ class Web extends EmbeddedWeb
) )
), ),
'user' => array( 'user' => array(
'cssClass' => 'user-nav-item',
'label' => $this->user->getUsername(), 'label' => $this->user->getUsername(),
'icon' => 'user', 'icon' => 'user',
'url' => 'preference',
'priority' => 900, 'priority' => 900,
'children' => array( 'renderer' => array(
'preferences' => array( 'UserNavigationItemRenderer'
'label' => t('Preferences'), ),
'url' => 'preference', ),
'priority' => 910 'logout' => array(
), 'cssClass' => 'user-nav-item',
'navigation' => array( 'label' => t('Logout'),
'label' => t('Navigation'), 'icon' => 'starttime',
'url' => 'navigation', 'priority' => 990,
'priority' => 920 'renderer' => array(
), 'LogoutNavigationItemRenderer',
'logout' => array( 'target' => '_self'
'label' => t('Logout'), ),
'url' => 'authentication/logout', 'url' => 'authentication/logout'
'priority' => 990,
'renderer' => array(
'NavigationItemRenderer',
'target' => '_self'
)
)
)
) )
); );

View File

@ -78,6 +78,23 @@ class Controller extends ModuleActionController
throw HttpNotFoundException::create(func_get_args()); 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 * 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 * @var array
*/ */
public static $defaultElementDecorators = 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('ViewHelper', array('separator' => '')),
array('Errors', array('separator' => '')), array('Errors', array('separator' => '')),
array('Help', array('placement' => 'PREPEND')), array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
array('Label', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
); );
/** /**
@ -851,7 +852,7 @@ class Form extends Zend_Form
'decorators' => array( 'decorators' => array(
'ViewHelper', 'ViewHelper',
array('Spinner', array('separator' => '')), 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')) || ($type === 'button' && isset($options['type']) && $options['type'] === 'submit'))
) { ) {
array_splice($options['decorators'], 1, 0, array(array('Spinner', array('separator' => '')))); array_splice($options['decorators'], 1, 0, array(array('Spinner', array('separator' => ''))));
} elseif ($type === 'hidden') {
$options['decorators'] = array('ViewHelper');
} }
} }
} else { } else {
$options = array('decorators' => static::$defaultElementDecorators); $options = array('decorators' => static::$defaultElementDecorators);
if ($type === 'submit') { if ($type === 'submit') {
array_splice($options['decorators'], 1, 0, array(array('Spinner', array('separator' => '')))); 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.'); : t('Upon its value has changed, this field issues an automatic update of this page.');
$content .= $this->getView()->icon('cw', $warning, array( $content .= $this->getView()->icon('cw', $warning, array(
'aria-hidden' => $isForm ? 'false' : 'true', 'aria-hidden' => $isForm ? 'false' : 'true',
'class' => 'autosubmit-warning' 'class' => 'spinner'
)); ));
if (! $isForm && $this->getAccessible()) { if (! $isForm && $this->getAccessible()) {
$content = '<span id="' . $this->getWarningId() . '" class="sr-only">' . $warning . '</span>' . $content; $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; return $content;
} }
$html = '<ul class="descriptions">'; $html = '<ul class="form-description">';
foreach ($descriptions as $description) { foreach ($descriptions as $description) {
if (is_array($description)) { if (is_array($description)) {
list($description, $properties) = $description; list($description, $properties) = $description;

View File

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

View File

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

View File

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

View File

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

View File

@ -36,6 +36,13 @@ class NavigationItem implements IteratorAggregate
*/ */
protected $active; protected $active;
/**
* The CSS class used for the outer li element
*
* @var string
*/
protected $cssClass;
/** /**
* This item's priority * This item's priority
* *
@ -199,6 +206,29 @@ class NavigationItem implements IteratorAggregate
return $this; 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 * Return this item's priority
* *
@ -435,7 +465,7 @@ class NavigationItem implements IteratorAggregate
*/ */
public function getLabel() 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 * The tooltip text for the badge
* *
* @var string * @var string
*/ */
protected $title; protected $title;
@ -28,7 +28,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
* *
* The state identifier defines the background color of the badge. * The state identifier defines the background color of the badge.
* *
* @var string * @var string
*/ */
protected $state; protected $state;
@ -94,7 +94,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*/ */
public function render(NavigationItem $item = null) 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() protected function renderBadge()
{ {
if (($count = $this->getCount()) > 0) { if ($count = $this->getCount()) {
$view = $this->view();
return sprintf( return sprintf(
'<div title="%s" class="badge-container"><span class="badge badge-%s">%s</span></div>', '<span title="%s" class="badge pull-right state-%s">%s</span>',
$this->view()->escape($this->getTitle()), $view->escape($this->getTitle()),
$this->view()->escape($this->getState()), $view->escape($this->getState()),
$count $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() public function init()
{ {
} }
/** /**
@ -196,13 +196,15 @@ class NavigationItemRenderer
$this->renderTargetAttribute(), $this->renderTargetAttribute(),
$label $label
); );
} else { } elseif ($label) {
$content = sprintf( $content = sprintf(
'<%1$s%2$s>%3$s</%1$s>', '<%1$s%2$s>%3$s</%1$s>',
$item::LINK_ALTERNATIVE, $item::LINK_ALTERNATIVE,
$this->view()->propertiesToString($item->getAttributes()), $this->view()->propertiesToString($item->getAttributes()),
$label $label
); );
} else {
$content = '';
} }
return $content; return $content;

View File

@ -304,10 +304,10 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
*/ */
public function beginItemMarkup(NavigationItem $item) 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) { if ($item->hasChildren() && $item->getChildren()->getLayout() === Navigation::LAYOUT_DROPDOWN) {
$cssClass[] = static::CSS_CLASS_DROPDOWN; $cssClasses[] = static::CSS_CLASS_DROPDOWN;
$item $item
->setAttribute('class', static::CSS_CLASS_DROPDOWN_TOGGLE) ->setAttribute('class', static::CSS_CLASS_DROPDOWN_TOGGLE)
->setIcon(static::DROPDOWN_TOGGLE_ICON) ->setIcon(static::DROPDOWN_TOGGLE_ICON)
@ -315,13 +315,21 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
} }
if ($item->getActive()) { 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( $content = sprintf(
'<li id="%s" class="%s">', '<li class="%s">',
$this->view()->escape($item->getUniqueName()), join(' ', $cssClasses)
join(' ', $cssClass)
); );
return $content; return $content;
} }

View File

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

View File

@ -41,6 +41,6 @@ class SummaryNavigationItemRenderer extends BadgeNavigationItemRenderer
*/ */
public function getTitle() 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( protected static $lessFiles = array(
'../application/fonts/fontello-ifont/css/ifont-embedded.css', '../application/fonts/fontello-ifont/css/ifont-embedded.css',
'css/vendor/normalize.css',
'css/vendor/tipsy.css', 'css/vendor/tipsy.css',
'css/icinga/themes/icinga.less',
'css/icinga/colors.less',
'css/icinga/badges.less',
'css/icinga/mixins.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/animation.less',
'css/icinga/layout-colors.less', 'css/icinga/layout-colors.less',
'css/icinga/layout-structure.less', 'css/icinga/layout-structure.less',
'css/icinga/menu.less', 'css/icinga/menu.less',
'css/icinga/header-elements.less', 'css/icinga/header-elements.less',
'css/icinga/footer-elements.less', 'css/icinga/footer-elements.less',
'css/icinga/main-content.less', // 'css/icinga/main-content.less',
'css/icinga/tabs.less', 'css/icinga/tabs.less',
'css/icinga/forms.less', 'css/icinga/forms.less',
'css/icinga/setup.less', 'css/icinga/setup.less',
@ -28,9 +36,11 @@ class StyleSheet
'css/icinga/pagination.less', 'css/icinga/pagination.less',
'css/icinga/selection-toolbar.less', 'css/icinga/selection-toolbar.less',
'css/icinga/login.less', 'css/icinga/login.less',
'css/icinga/logo.less',
'css/icinga/controls.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() public static function compileForPdf()

View File

@ -211,6 +211,22 @@ class Url
return $url->setQueryString($f->toQueryString()); 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 * Overwrite the baseUrl
* *

View File

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

View File

@ -87,7 +87,11 @@ $this->addHelperFunction('icon', function ($img, $title = null, array $propertie
$properties['class'] = 'icon'; $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; $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)); $filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));
} else { } else {
if ($this->searchColumns === null && $this->query instanceof FilterColumns) { if ($this->searchColumns === null && $this->query instanceof FilterColumns) {
$this->searchColumns = $this->query->getSearchColumns(); $this->searchColumns = $this->query->getSearchColumns($search);
} }
if (! empty($this->searchColumns)) { if (! empty($this->searchColumns)) {

View File

@ -3,98 +3,108 @@
namespace Icinga\Web\Widget; namespace Icinga\Web\Widget;
use Icinga\Web\Navigation\Navigation;
use Icinga\Web\Navigation\NavigationItem;
use Icinga\Web\Url; use Icinga\Web\Url;
/** /**
* Limiter * Limiter control
*/ */
class Limiter extends AbstractWidget 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->defaultLimit !== null ? $this->defaultLimit : static::DEFAULT_LIMIT;
return $this; }
}
/**
public function setCurrentPageCount($pages) * Set the default limit
{ *
$this->pages = $pages; * @param int $defaultLimit
return $this; *
} * @return $this
*/
public function setMaxLimit($max) public function setDefaultLimit($defaultLimit)
{ {
$this->max = $max; $this->defaultLimit = (int) $defaultLimit;
return $this;
}
public function setDefaultLimit($limit)
{
$this->default = $limit;
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function render() public function render()
{ {
if ($this->url === null) { $url = Url::fromRequest();
$this->url = Url::fromRequest(); $activeLimit = (int) $url->getParam('limit', $this->getDefaultLimit());
} $navigation = new Navigation();
$navigation->setLayout(Navigation::LAYOUT_TABS);
$currentLimit = (int) $this->url->getParam('limit', $this->default); foreach (static::$limits as $limit => $label) {
$availableLimits = array( $navigationItem = new NavigationItem($limit);
10 => '10', $navigationItem
25 => '25', ->setActive($activeLimit === $limit)
50 => '50', ->setAttribute(
100 => '100', 'title',
500 => '500' sprintf(
); t('Show %u rows on this page'),
if ($currentLimit === 0) { $limit
$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)
) )
); )
} ->setLabel($label)
->setUrl($url->with(array('limit' => $limit)));
$navigation->addItem($navigationItem);
} }
if ($activeLimit === 0) {
if (empty($limits)) return ''; $navigationItem = new NavigationItem(0);
return '<span class="widgetLimiter">' . implode(' ', $limits) . '</span>'; $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( $supportedTypes[self::TYPE_JSON] = array(
'name' => 'json', 'name' => 'json',
'label' => 'JSON', 'label' => 'JSON',
'icon' => 'img/icons/json.png', 'icon' => 'doc-text',
'urlParams' => array('format' => 'json') 'urlParams' => array('format' => 'json')
); );
} }

View File

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

View File

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

View File

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

View File

@ -86,7 +86,11 @@ class AlertsummaryController extends Controller
$this->view->notificationsUrl = 'monitoring/list/notifications'; $this->view->notificationsUrl = 'monitoring/list/notifications';
$this->setupLimitControl(); $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->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
$delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest(); $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( ->setQueryString(
$this->hostList $this->hostList
->objectsFilter() ->objectsFilter()
->andFilter(FilterEqual::where('downtime_objecttype', 'host')) ->andFilter(FilterEqual::where('object_type', 'host'))
->toQueryString() ->toQueryString()
); );
$this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments'); $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');

View File

@ -374,7 +374,9 @@ class ListController extends Controller
'contacts' => array() 'contacts' => array()
); );
} }
$groupData[$c->contactgroup_name]['contacts'][] = $c; if (isset ($c->contact_name)) {
$groupData[$c->contactgroup_name]['contacts'][] = $c;
}
} }
// TODO: Find a better naming // TODO: Find a better naming
@ -436,21 +438,13 @@ class ListController extends Controller
'servicegroup_alias', 'servicegroup_alias',
'servicegroup_name', 'servicegroup_name',
'services_critical_handled', '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_critical_unhandled',
'services_ok', 'services_ok',
'services_ok_last_state_change',
'services_pending', 'services_pending',
'services_pending_last_state_change',
'services_total', 'services_total',
'services_unknown_handled', '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_unknown_unhandled',
'services_warning_handled', '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' 'services_warning_unhandled'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $query);
@ -475,18 +469,12 @@ class ListController extends Controller
'hostgroup_alias', 'hostgroup_alias',
'hostgroup_name', 'hostgroup_name',
'hosts_down_handled', '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_down_unhandled',
'hosts_pending', 'hosts_pending',
'hosts_pending_last_state_change',
'hosts_total', 'hosts_total',
'hosts_unreachable_handled', '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_unreachable_unhandled',
'hosts_up', 'hosts_up',
'hosts_up_last_state_change',
'services_critical_handled', 'services_critical_handled',
'services_critical_unhandled', 'services_critical_unhandled',
'services_ok', 'services_ok',

View File

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

View File

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

View File

@ -20,6 +20,30 @@ class DeleteDowntimeCommandForm extends CommandForm
$this->setAttrib('class', 'inline'); $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} * {@inheritdoc}
*/ */
@ -31,17 +55,17 @@ class DeleteDowntimeCommandForm extends CommandForm
'hidden', 'hidden',
'downtime_id', 'downtime_id',
array( array(
'required' => true, 'decorators' => array('ViewHelper'),
'validators' => array('NotEmpty'), 'required' => true,
'decorators' => array('ViewHelper') 'validators' => array('NotEmpty')
) )
), ),
array( array(
'hidden', 'hidden',
'downtime_is_service', 'downtime_is_service',
array( array(
'filters' => array('Boolean'), 'decorators' => array('ViewHelper'),
'decorators' => array('ViewHelper') 'filters' => array('Boolean')
) )
), ),
array( array(
@ -56,27 +80,6 @@ class DeleteDowntimeCommandForm extends CommandForm
return $this; 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} * {@inheritdoc}
*/ */

View File

@ -17,18 +17,35 @@ class RemoveAcknowledgementCommandForm extends ObjectsCommandForm
*/ */
public function init() public function init()
{ {
$this->setAttrib('class', 'inline link-like'); $this->setAttrib('class', 'inline');
} }
/** /**
* (non-PHPDoc) * {@inheritdoc}
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
*/ */
public function getSubmitLabel() public function addSubmitButton()
{ {
return mtp( $this->addElement(
'monitoring', 'Remove problem acknowledgement', 'Remove problem acknowledgements', count($this->objects) '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() public function init()
{ {
$this->setUseFormAutosubmit(); $this->setUseFormAutosubmit();
$this->setTitle('Feature Commands');
$this->setAttrib('class', 'inline object-features'); $this->setAttrib('class', 'inline object-features');
$this->loadDefaultDecorators()->getDecorator('description')->setTag('h2');
} }
/** /**

View File

@ -18,7 +18,7 @@ class WelcomePage extends Form
'note', 'note',
'welcome', 'welcome',
array( 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( 'decorators' => array(
'ViewHelper', 'ViewHelper',
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
@ -30,7 +30,8 @@ class WelcomePage extends Form
'note', 'note',
'core_hint', 'core_hint',
array( 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', 'note',
'description', 'description',
array( array(
'value' => $this->translate( 'value' => $this->translate(
'It offers various status and reporting views with powerful filter capabilities that allow' '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.' . ' 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) { if (! $raw) {
$output = '<pre class="pluginoutput">' . $output . '</pre>'; $output = '<pre class="plugin-output">' . $output . '</pre>';
} }
$output = $this->fixLinks($output); $output = $this->fixLinks($output);
return $output; return $output;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,119 +3,171 @@
<?= $this->tabs; ?> <?= $this->tabs; ?>
<?php endif ?> <?php endif ?>
<?= $this->render('partials/downtime/downtime-header.phtml'); ?> <table>
<tr> <?= $this->render('partials/downtime/downtime-header.phtml'); ?> </tr>
</table>
</div> </div>
<div class="content"> <div class="content"><h2><?= $this->translate('Details') ?></h2>
<h3><?= $this->translate('Downtime detail information') ?></h3> <table class="name-value-table">
<table class="avp"> <tbody>
<tbody>
<tr> <tr>
<th> <th>
<?= $this->isService ? $this->translate('Service') : $this->translate('Host') ?> <?= $this->isService ? $this->translate('Service') : $this->translate('Host') ?>
</th> </th>
<td data-base-target="_next"> <td data-base-target="_next">
<?php if ($this->isService): ?> <?php if ($this->isService): ?>
<?php <?php
$link = $this->link()->service( $link = $this->link()->service(
$downtime->service_description, $downtime->service_description,
$downtime->service_display_name, $downtime->service_display_name,
$downtime->host_name, $downtime->host_name,
$downtime->host_display_name $downtime->host_display_name
); );
$icon = $this->icon('service', $this->translate('Service')); $icon = $this->icon('service', $this->translate('Service'));
?> ?>
<?php else: ?> <?php else: ?>
<?php <?php
$icon = $this->icon('host', $this->translate('Host')); $icon = $this->icon('host', $this->translate('Host'));
$link = $this->link()->host($downtime->host_name, $downtime->host_display_name) $link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
?> ?>
<?php endif ?> <?php endif ?>
<?= $icon ?> <?= $icon ?>
<?= $link ?> <?= $link ?>
</td> </td>
</tr> </tr>
<tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>"> <tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
<th><?= $this->translate('Author') ?></th> <th><?= $this->translate('Author') ?></th>
<td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td> <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> </tr>
<tr title="<?= $this->translate('he date/time the scheduled downtime was' <tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
. ' actually started'); ?>"> <th><?= $this->translate('Entry Time') ?></th>
<th><?= $this->translate('Actual start time') ?></th> <td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
<td><?= $this->formatDateTime($downtime->start) ?></td> </tr>
</tr> <tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<tr title="<?= $this->translate('The date/time the scheduled downtime ' <th><?= $this->translate('Comment') ?></th>
. 'actually ended'); ?>"> <td class="comment-text"><?= $this->escape($this->downtime->comment) ?></td>
<th><?= $this->translate('Actual end time') ?></th> </tr>
<td><?= $this->formatDateTime($downtime->end) ?></td> </tbody>
</tr> </table>
<?php endif; ?>
<tr class="newsection"> <h2> <?= $this->translate('Duration') ?> </h2>
<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 ?> <table class="name-value-table">
<tr class="newsection"> <tbody>
<th><?= $this->translate('Commands') ?></th> <tr class="newsection">
<td> <th><?= $this->escape(
<?= $delDowntimeForm ?> $this->downtime->is_flexible ?
</td> $this->translate('Flexible') : $this->translate('Fixed')
</tr> ); ?>
<?php endif ?> <?= $this->icon('info-circled', $this->downtime->is_flexible ?
</tbody> $this->translate('Flexible downtimes have a hard start and end time,'
</table> . ' 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> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,43 +1,15 @@
<?php use Icinga\Data\Filter\Filter; ?> <?php use Icinga\Data\Filter\Filter; ?>
<div class="controls separated"> <div class="controls separated">
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<?= $this->tabs; ?> <?= $this->tabs ?>
<?php endif ?> <?php endif ?>
<?= $this->render('partials/host/object-header.phtml') ?> <?= $this->render('partials/object/host-header.phtml') ?>
<h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>> <?php
<?php $this->stats = $object->stats;
$this->stats = $object->stats; $this->baseFilter = Filter::where('host', $object->host_name);
$this->baseFilter = Filter::where('host', $object->host_name); echo $this->render('list/components/servicesummary.phtml');
echo $this->render('list/components/servicesummary.phtml'); ?>
?>
</h3>
</div> </div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>
<?= $this->render('show/components/grapher.phtml') ?>
<table class="avp newsection"> <?= $this->render('partials/object/detail-content.phtml') ?>
<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>

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