[icinga-checkins] icinga.org: icingaweb2/master: Dashboard: Fix design and labels

git at icinga.org git at icinga.org
Wed Nov 19 15:42:11 CET 2014


Module: icingaweb2
Branch: master
Commit: 3b190d7d8167df2a14d4e3a6d10ef373a74bc66e
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=3b190d7d8167df2a14d4e3a6d10ef373a74bc66e

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Nov 19 15:40:40 2014 +0100

Dashboard: Fix design and labels

refs #4537

---

 application/forms/Dashboard/ComponentForm.php |   44 +++++++------------------
 public/css/icinga/forms.less                  |    8 +++--
 2 files changed, 17 insertions(+), 35 deletions(-)

diff --git a/application/forms/Dashboard/ComponentForm.php b/application/forms/Dashboard/ComponentForm.php
index 54aa4c3..052b08b 100644
--- a/application/forms/Dashboard/ComponentForm.php
+++ b/application/forms/Dashboard/ComponentForm.php
@@ -83,17 +83,17 @@ class ComponentForm extends Form
             ((isset($formData['create_new_pane']) && $formData['create_new_pane'] != false) &&
              (false === isset($formData['use_existing_dashboard']) || $formData['use_existing_dashboard'] != true))
         ) {
-            $groupElements[] = $this->createElement(
+            $this->addElement(
                 'text',
                 'pane',
                 array(
                     'required'      => true,
-                    'label'         => t("New Pane Title"),
+                    'label'         => t("New Dashboard Title"),
                     'description'   =>
                         t('Enter a title for the new pane.')
                 )
             );
-            $groupElements[] = $this->createElement( // Prevent the button from being displayed again on validation errors
+            $this->addElement( // Prevent the button from being displayed again on validation errors
                 'hidden',
                 'create_new_pane',
                 array(
@@ -106,21 +106,20 @@ class ComponentForm extends Form
                     'use_existing_dashboard',
                     array(
                         'ignore'        => true,
-                        'label'         => t('Use An Existing Pane'),
-                        'description'   =>
-                            t('Click on the button to add the dashlet to an existing pane on your dashboard.')
+                        'label'         => t('Use An Existing Dashboard'),
+                        'class'         => 'link-like'
                     )
                 );
                 $buttonExistingPane->removeDecorator('Label');
-                $groupElements[] = $buttonExistingPane;
+                $this->addElement($buttonExistingPane);
             }
         } else {
-            $groupElements[] = $this->createElement(
+            $this->addElement(
                 'select',
                 'pane',
                 array(
                     'required'      => true,
-                    'label'         => t('Pane'),
+                    'label'         => t('Dashboard'),
                     'multiOptions'  => $panes,
                     'description'   =>
                         t('Select a pane you want to add the dashlet.')
@@ -131,34 +130,13 @@ class ComponentForm extends Form
                 'create_new_pane',
                 array(
                     'ignore'        => true,
-                    'label'         => t('Create A New Pane'),
-                    'description'   =>
-                        t('Click on the button if you want to add the dashlet to a new pane on the dashboard.')
+                    'label'         => t('Create A New Dashboard'),
+                    'class'         => 'link-like',
                 )
             );
             $buttonNewPane->removeDecorator('Label');
-            $groupElements[] = $buttonNewPane;
+            $this->addElement($buttonNewPane);
         }
-        $this->addDisplayGroup(
-            $groupElements,
-            'pane_group',
-            array(
-                'legend'        => t('Pane'),
-                'description'   => t(
-                    'Decide if you want add the dashlet to an existing pane'
-                    . ' or create a new pane. Have a look on the button below.'
-                ),
-                'decorators' => array(
-                    'FormElements',
-                    array('HtmlTag', array('tag' => 'div', 'class' => 'control-group')),
-                    array(
-                        'Description',
-                        array('tag' => 'span', 'class' => 'description', 'placement' => 'prepend')
-                    ),
-                    'Fieldset'
-                )
-            )
-        );
     }
 
     /**
diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less
index 2acb3d4..1b7e10b 100644
--- a/public/css/icinga/forms.less
+++ b/public/css/icinga/forms.less
@@ -104,7 +104,7 @@ form.inline {
   display: inline;
 }
 
-form.link-like input[type="submit"], form.link-like button[type="submit"] {
+form.link-like input[type="submit"], form.link-like button[type="submit"], input.link-like, button.link-like {
   color: @colorLinkDefault;
   font-weight: normal;
   border: none;
@@ -114,7 +114,11 @@ form.link-like input[type="submit"], form.link-like button[type="submit"] {
   cursor: pointer;
 }
 
-form.link-like input[type="submit"]:hover, form.link-like input[type="submit"]:focus, form.link-like button[type="submit"]:hover, orm.link-like button[type="submit"]:focus {
+form.link-like input[type="submit"]:hover,
+form.link-like input[type="submit"]:focus,
+form.link-like button[type="submit"]:hover,
+form.link-like button[type="submit"]:focus,
+input.link-like:hover, button.link-like:focus {
   text-decoration: underline;
   background: none;
   color: @colorLinkDefault;



More information about the icinga-checkins mailing list