monitoring: Add spinner to inline command forms

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-30 22:44:52 +02:00
parent a69179c3f2
commit b333439b2e
4 changed files with 71 additions and 46 deletions

View File

@ -18,7 +18,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
*/
public function init()
{
$this->setAttrib('class', 'link');
$this->setAttrib('class', 'inline');
}
/**
@ -32,15 +32,17 @@ class CheckNowCommandForm extends ObjectsCommandForm
'button',
'btn_submit',
array(
'ignore' => true,
'type' => 'submit',
'value' => $this->translate('Check now'),
'label' => '<i aria-hidden="true" class="icon-reschedule"></i>'
. $this->translate('Check now'),
'decorators' => array('ViewHelper'),
'class' => 'link-button spinner',
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group form-controls'))
),
'escape' => false,
'class' => 'action-link link',
'title' => $this->translate('Schedule the next active check to run immediately')
'ignore' => true,
'label' => $this->getView()->icon('reschedule') . $this->translate('Check now'),
'type' => 'submit',
'title' => $this->translate('Schedule the next active check to run immediately'),
'value' => $this->translate('Check now')
)
)
));

View File

@ -17,7 +17,7 @@ class DeleteCommentCommandForm extends CommandForm
*/
public function init()
{
$this->setAttrib('class', 'link');
$this->setAttrib('class', 'inline');
}
/**
@ -65,13 +65,16 @@ class DeleteCommentCommandForm extends CommandForm
'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;

View File

@ -20,6 +20,30 @@ class DeleteDowntimeCommandForm extends CommandForm
$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}
*/
@ -31,17 +55,17 @@ class DeleteDowntimeCommandForm extends CommandForm
'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(
@ -56,27 +80,6 @@ class DeleteDowntimeCommandForm extends CommandForm
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}
*/

View File

@ -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;
}
/**