From 0db5167a35d403706f7e3215ecfa99149cce14ee Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 13 Nov 2014 18:40:13 +0100 Subject: [PATCH] Fix event grid layout and forms Make event grid horizontal, user build in form apply button, add linebreak between filter and grid --- .../controllers/ListController.php | 3 ++- .../application/forms/StatehistoryForm.php | 20 +++++++++---------- .../views/scripts/list/eventhistory.phtml | 2 ++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 3861d3f1b..15b90079e 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -18,6 +18,7 @@ use Icinga\Data\Filter\Filter; use Icinga\Web\Widget; use Icinga\Module\Monitoring\Web\Widget\SelectBox; use Icinga\Module\Monitoring\Form\StatehistoryForm; +use Icinga\Module\Monitoring\Form\EventOverviewForm; class Monitoring_ListController extends Controller { @@ -392,7 +393,7 @@ class Monitoring_ListController extends Controller $form->render(); $this->view->form = $form; - $orientation = $this->params->shift('horizontal', 0) ? 'horizontal' : 'vertical'; + $orientation = $this->params->shift('vertical', 0) ? 'vertical' : 'horizontal'; $orientationBox = new SelectBox( 'orientation', diff --git a/modules/monitoring/application/forms/StatehistoryForm.php b/modules/monitoring/application/forms/StatehistoryForm.php index f269cb0cd..3008724c3 100644 --- a/modules/monitoring/application/forms/StatehistoryForm.php +++ b/modules/monitoring/application/forms/StatehistoryForm.php @@ -13,6 +13,15 @@ use Icinga\Data\Filter\Filter; */ class StatehistoryForm extends Form { + /** + * Initialize this form + */ + public function init() + { + $this->setName('form_event_overview'); + $this->setSubmitLabel(mt('monitoring', 'Apply')); + } + /** * Return the corresponding filter-object * @@ -135,16 +144,5 @@ class StatehistoryForm extends Form ) ); } - $this->addElement( - 'button', - 'btn_submit', - array( - 'type' => 'submit', - 'escape' => false, - 'value' => '1', - 'class' => 'btn btn-cta btn-common', - 'label' => mt('monitoring', 'Apply') - ) - ); } } diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index aa120d81d..dd34b0067 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -4,6 +4,8 @@
translate('Sort by'); ?> sortControl->render($this); ?>
+ +
widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?> paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>