Skip to content

Commit

Permalink
Merge branch 'feature/dope-layout-5543#2'
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Nov 13, 2015
2 parents 202b493 + 30c769f commit d5fe0c9
Show file tree
Hide file tree
Showing 115 changed files with 1,862 additions and 2,157 deletions.
6 changes: 0 additions & 6 deletions application/controllers/ConfigController.php
Expand Up @@ -119,12 +119,6 @@ public function modulesAction()
->order('name');
$this->setupLimitControl();
$this->setupPaginationControl($this->view->modules);
// TODO: Not working
/*$this->setupSortControl(array(
'name' => $this->translate('Modulename'),
'path' => $this->translate('Installation Path'),
'enabled' => $this->translate('State')
));*/
}

public function moduleAction()
Expand Down
8 changes: 0 additions & 8 deletions application/controllers/DashboardController.php
Expand Up @@ -253,14 +253,6 @@ public function indexAction()
$this->dashboard->getConfig()->saveIni();
$this->redirectNow(URL::fromRequest()->remove('remove'));
}
$this->view->tabs->add(
'Add',
array(
'label' => '+',
'title' => 'Add a dashlet to an existing or new dashboard',
'url' => Url::fromPath('dashboard/new-dashlet')
)
);
$this->view->dashboard = $this->dashboard;
}
}
Expand Down
3 changes: 0 additions & 3 deletions application/controllers/GroupController.php
Expand Up @@ -324,7 +324,6 @@ protected function createShowTabs($backendName, $groupName)
array(
'title' => sprintf($this->translate('Show group %s'), $groupName),
'label' => $this->translate('Group'),
'icon' => 'users',
'url' => Url::fromPath('group/show', array('backend' => $backendName, 'group' => $groupName))
)
);
Expand Down Expand Up @@ -355,7 +354,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
Expand All @@ -364,7 +362,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
Expand Down
2 changes: 0 additions & 2 deletions application/controllers/RoleController.php
Expand Up @@ -163,7 +163,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
Expand All @@ -172,7 +171,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
Expand Down
3 changes: 0 additions & 3 deletions application/controllers/UserController.php
Expand Up @@ -290,7 +290,6 @@ protected function createShowTabs($backendName, $userName)
array(
'title' => sprintf($this->translate('Show user %s'), $userName),
'label' => $this->translate('User'),
'icon' => 'user',
'url' => Url::fromPath('user/show', array('backend' => $backendName, 'user' => $userName))
)
);
Expand Down Expand Up @@ -321,7 +320,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
Expand All @@ -330,7 +328,6 @@ protected function createListTabs()
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
Expand Down
113 changes: 113 additions & 0 deletions application/forms/Control/LimiterControlForm.php
@@ -0,0 +1,113 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

namespace Icinga\Forms\Control;

use Icinga\Web\Form;

/**
* Limiter control form
*/
class LimiterControlForm extends Form
{
/**
* CSS class for the limiter control
*
* @var string
*/
const CSS_CLASS_LIMITER = 'limiter-control';

/**
* Default limit
*
* @var int
*/
const DEFAULT_LIMIT = 50;

/**
* Selectable limits
*
* @var int[]
*/
public static $limits = array(
10 => '10',
25 => '25',
50 => '50',
100 => '100',
500 => '500'
);

/**
* Default limit for this instance
*
* @var int|null
*/
protected $defaultLimit;

/**
* {@inheritdoc}
*/
public function init()
{
$this->setAttrib('class', static::CSS_CLASS_LIMITER);
}

/**
* Get the default limit
*
* @return int
*/
public function getDefaultLimit()
{
return $this->defaultLimit !== null ? $this->defaultLimit : static::DEFAULT_LIMIT;
}

/**
* Set the default limit
*
* @param int $defaultLimit
*
* @return $this
*/
public function setDefaultLimit($defaultLimit)
{
$this->defaultLimit = (int) $defaultLimit;
return $this;
}

/**
* {@inheritdoc}
*/
public function getRedirectUrl()
{
return $this->getRequest()->getUrl()->setParam('limit', $this->getElement('limit')->getValue());
}

/**
* {@inheritdoc}
*/
public function createElements(array $formData)
{
$this->addElement(
'select',
'limit',
array(
'autosubmit' => true,
'escape' => false,
'label' => '#',
'multiOptions' => static::$limits,
'value' => $this->getRequest()->getUrl()->getParam('limit', $this->getDefaultLimit())
)
);
}

/**
* Limiter control is always successful
*
* @return bool
*/
public function onSuccess()
{
return true;
}
}
4 changes: 2 additions & 2 deletions application/forms/Dashboard/DashletForm.php
Expand Up @@ -96,7 +96,7 @@ public function createElements(array $formData)
array(
'required' => true,
'label' => $this->translate("New Dashboard Title"),
'description' => $this->translate('Enter a title for the new pane.')
'description' => $this->translate('Enter a title for the new dashboard')
)
);
} else {
Expand All @@ -107,7 +107,7 @@ public function createElements(array $formData)
'required' => true,
'label' => $this->translate('Dashboard'),
'multiOptions' => $panes,
'description' => $this->translate('Select a pane you want to add the dashlet.')
'description' => $this->translate('Select a dashboard you want to add the dashlet to')
)
);
}
Expand Down
1 change: 0 additions & 1 deletion application/forms/PreferenceForm.php
Expand Up @@ -41,7 +41,6 @@ class PreferenceForm extends Form
public function init()
{
$this->setName('form_config_preferences');
$this->setTitle($this->translate('Preferences'));
}

/**
Expand Down
27 changes: 17 additions & 10 deletions application/views/scripts/about/index.phtml
@@ -1,7 +1,7 @@
<div class="controls">
<?= $tabs ?>
</div>
<div class="content content-centered">
<div id="about" class="content content-centered">
<?= $this->img(
'img/logo_icinga_big_dark.png',
null,
Expand Down Expand Up @@ -35,7 +35,7 @@
) ?>
</dd>
</dl>
<div>
<div class="about-social">
<?= $this->qlink(
null,
'https://www.twitter.com/icinga',
Expand All @@ -54,16 +54,25 @@
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
) ?> <?= $this->qlink(
null,
'https://plus.google.com/+icinga',
null,
array(
'target' => '_blank',
'icon' => 'google-plus-squared',
'title' => $this->translate('Icinga on Google+')
)
) ?>
</div>
<div>
<div class="about-links">
<?= $this->qlink(
null,
'https://dev.icinga.org/projects/icingaweb2',
null,
array(
'target' => '_blank',
'img' => 'img/bugreport.png',
'icon' => 'bug',
'title' => $this->translate('Report a bug')
)
) ?>
Expand All @@ -73,19 +82,17 @@
null,
array(
'target' => '_blank',
'img' => 'img/support.png',
'icon' => 'chat',
'title' => $this->translate('Support / Mailinglists')
)
) ?>
</div>
<div>
<?= $this->qlink(
null,
'https://wiki.icinga.org',
null,
array(
'target' => '_blank',
'img' => 'img/wiki.png',
'icon' => 'lightbulb',
'title' => $this->translate('Icinga Wiki')
)
) ?>
Expand All @@ -95,13 +102,13 @@
null,
array(
'target' => '_blank',
'img' => 'img/docs.png',
'icon' => 'doc-text',
'title' => $this->translate('Icinga Documentation')
)
) ?>
</div>
<h2><?= $this->translate('Loaded modules') ?></h2>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>
Expand Down
58 changes: 25 additions & 33 deletions application/views/scripts/config/modules.phtml
@@ -1,48 +1,40 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
<?= $this->tabs ?>
<?= $this->paginator ?>
</div>
<?php endif ?>
<div class="content">
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Module') ?></th>
<th><?= $this->translate('Module') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($module->enabled && $module->loaded) {
echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name));
} elseif (! $module->enabled) {
echo $this->icon('block', sprintf($this->translate('Module %s is disabled'), $module->name));
} else { // ! $module->loaded
echo $this->icon('block', sprintf($this->translate('Module %s has failed to load'), $module->name));
}
<tr>
<td>
<?php if ($module->enabled && $module->loaded) {
echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name));
} elseif (! $module->enabled) {
echo $this->icon('block', sprintf($this->translate('Module %s is disabled'), $module->name));
} else { // ! $module->loaded
echo $this->icon('block', sprintf($this->translate('Module %s has failed to load'), $module->name));
}

echo $this->qlink(
$module->name,
'config/module/',
array('name' => $module->name),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name), 'class' => 'rowaction')
); ?>
</td>
</tr>
echo $this->qlink(
$module->name,
'config/module/',
array('name' => $module->name),
array(
'class' => 'rowaction',
'title' => sprintf($this->translate('Show the overview of the %s module'), $module->name)
)
); ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</table>
</div>
2 changes: 1 addition & 1 deletion application/views/scripts/config/resource.phtml
Expand Up @@ -13,7 +13,7 @@
'title' => $this->translate('Create a new resource')
)
) ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Resource') ?></th>
Expand Down

0 comments on commit d5fe0c9

Please sign in to comment.