Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion application/controllers/EventRulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
use Icinga\Web\Notification;
use Icinga\Web\Session;
use ipl\Html\Html;
use ipl\Html\ValidHtml;
use ipl\Stdlib\Filter;
use ipl\Web\Common\BaseItemList;
use ipl\Web\Compat\CompatController;
use ipl\Web\Compat\SearchControls;
use ipl\Web\Control\LimitControl;
Expand Down Expand Up @@ -88,7 +90,7 @@ public function indexAction(): void
Url::fromPath('notifications/event-rule/edit', ['id' => -1, 'clearCache' => true]),
'plus'
))->openInModal()
->addAttributes(['class' => 'new-event-rule'])
->addAttributes(['class' => 'add-new-component'])
);

$this->addContent(new EventRuleList($eventRules));
Expand Down Expand Up @@ -168,6 +170,22 @@ public function addAction(): void
$this->addContent($eventRuleConfig);
}

/**
* Add attribute 'class' => 'full-width' if the content is an instance of BaseItemList
*
* @param ValidHtml $content
*
* @return EventRulesController
*/
protected function addContent(ValidHtml $content)
{
if ($content instanceof BaseItemList) {
$this->content->getAttributes()->add('class', 'full-width');
}

return parent::addContent($content);
}

public function completeAction(): void
{
$suggestions = new ObjectSuggestions();
Expand Down
20 changes: 19 additions & 1 deletion application/controllers/SchedulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
use Icinga\Module\Notifications\Model\Schedule;
use Icinga\Module\Notifications\Web\Control\SearchBar\ObjectSuggestions;
use Icinga\Module\Notifications\Widget\ItemList\ScheduleList;
use ipl\Html\ValidHtml;
use ipl\Stdlib\Filter;
use ipl\Web\Common\BaseItemList;
use ipl\Web\Compat\CompatController;
use ipl\Web\Compat\SearchControls;
use ipl\Web\Control\LimitControl;
Expand Down Expand Up @@ -68,7 +70,7 @@ public function indexAction(): void
Links::scheduleAdd(),
'plus',
[
'class' => 'add-schedule-control'
'class' => 'add-new-component'
]
))->openInModal()
);
Expand All @@ -82,6 +84,22 @@ public function indexAction(): void
$this->getTabs()->activate('schedules');
}

/**
* Add attribute 'class' => 'full-width' if the content is an instance of BaseItemList
*
* @param ValidHtml $content
*
* @return SchedulesController
*/
protected function addContent(ValidHtml $content)
{
if ($content instanceof BaseItemList) {
$this->content->getAttributes()->add('class', 'full-width');
}

return parent::addContent($content);
}

public function completeAction(): void
{
$suggestions = new ObjectSuggestions();
Expand Down
Loading