Skip to content

Commit

Permalink
monitoring: Add spinner to inline command forms
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Sep 30, 2015
1 parent a69179c commit b333439
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 45 deletions.
Expand Up @@ -18,7 +18,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
*/
public function init()
{
$this->setAttrib('class', 'link');
$this->setAttrib('class', 'inline');
}

/**
Expand All @@ -32,15 +32,17 @@ public function addSubmitButton()
'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('reschedule') . $this->translate('Check now'),
'type' => 'submit',
'value' => $this->translate('Check now'),
'label' => '<i aria-hidden="true" class="icon-reschedule"></i>'
. $this->translate('Check now'),
'decorators' => array('ViewHelper'),
'escape' => false,
'class' => 'action-link link',
'title' => $this->translate('Schedule the next active check to run immediately')
'title' => $this->translate('Schedule the next active check to run immediately'),
'value' => $this->translate('Check now')
)
)
));
Expand Down
Expand Up @@ -17,7 +17,7 @@ class DeleteCommentCommandForm extends CommandForm
*/
public function init()
{
$this->setAttrib('class', 'link');
$this->setAttrib('class', 'inline');
}

/**
Expand Down Expand Up @@ -65,13 +65,16 @@ public function addSubmitButton()
'button',
'btn_submit',
array(
'ignore' => true,
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'type' => 'submit',
'class' => 'action-link link',
'ignore' => true,
'label' => $this->getView()->icon('cancel'),
'title' => $this->translate('Delete this comment'),
'decorators' => array('ViewHelper')
'type' => 'submit'
)
);
return $this;
Expand Down
Expand Up @@ -20,6 +20,30 @@ public function init()
$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}
*/
Expand All @@ -31,17 +55,17 @@ public function createElements(array $formData = array())
'hidden',
'downtime_id',
array(
'required' => true,
'validators' => array('NotEmpty'),
'decorators' => array('ViewHelper')
'decorators' => array('ViewHelper'),
'required' => true,
'validators' => array('NotEmpty')
)
),
array(
'hidden',
'downtime_is_service',
array(
'filters' => array('Boolean'),
'decorators' => array('ViewHelper')
'decorators' => array('ViewHelper'),
'filters' => array('Boolean')
)
),
array(
Expand All @@ -56,27 +80,6 @@ public function createElements(array $formData = array())
return $this;
}

/**
* {@inheritdoc}
*/
public function addSubmitButton()
{
$this->addElement(
'button',
'btn_submit',
array(
'ignore' => true,
'escape' => false,
'type' => 'submit',
'class' => 'action-link link',
'label' => $this->getView()->icon('trash'),
'title' => $this->translate('Delete this downtime'),
'decorators' => array('ViewHelper')
)
);
return $this;
}

/**
* {@inheritdoc}
*/
Expand Down
Expand Up @@ -17,18 +17,35 @@ class RemoveAcknowledgementCommandForm extends ObjectsCommandForm
*/
public function init()
{
$this->setAttrib('class', 'inline link-like');
$this->setAttrib('class', 'inline');
}

/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
* {@inheritdoc}
*/
public function getSubmitLabel()
public function addSubmitButton()
{
return mtp(
'monitoring', 'Remove problem acknowledgement', 'Remove problem acknowledgements', count($this->objects)
$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->translatePlural(
'Remove problem acknowledgement',
'Remove problem acknowledgements',
count($this->objects)
),
'type' => 'submit'
)
);
return $this;
}

/**
Expand Down

0 comments on commit b333439

Please sign in to comment.