mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
FormNotifications: Don't ignore warning and error notifications
This commit is contained in:
parent
5c6d04f5d7
commit
bc2e7588d7
@ -37,10 +37,7 @@ class FormNotifications extends Zend_Form_Decorator_Abstract
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = '<div class="form-notifications">'
|
$html = '<ul class="form-notification-list">';
|
||||||
. Icinga::app()->getViewRenderer()->view->icon('ok', '', ['class' => 'form-notification-icon'])
|
|
||||||
. '<ul class="form-notification-list">';
|
|
||||||
|
|
||||||
foreach (array(Form::NOTIFICATION_ERROR, Form::NOTIFICATION_WARNING, Form::NOTIFICATION_INFO) as $type) {
|
foreach (array(Form::NOTIFICATION_ERROR, Form::NOTIFICATION_WARNING, Form::NOTIFICATION_INFO) as $type) {
|
||||||
if (isset($notifications[$type])) {
|
if (isset($notifications[$type])) {
|
||||||
$html .= '<li><ul class="notification-' . $this->getNotificationTypeName($type) . '">';
|
$html .= '<li><ul class="notification-' . $this->getNotificationTypeName($type) . '">';
|
||||||
@ -59,6 +56,21 @@ class FormNotifications extends Zend_Form_Decorator_Abstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($notifications[Form::NOTIFICATION_ERROR])) {
|
||||||
|
$icon = 'cancel';
|
||||||
|
$class = 'error';
|
||||||
|
} elseif (isset($notifications[Form::NOTIFICATION_WARNING])) {
|
||||||
|
$icon = 'warning-empty';
|
||||||
|
$class = 'warning';
|
||||||
|
} else {
|
||||||
|
$icon = 'info';
|
||||||
|
$class = 'info';
|
||||||
|
}
|
||||||
|
|
||||||
|
$html = "<div class=\"form-notifications $class\">"
|
||||||
|
. Icinga::app()->getViewRenderer()->view->icon($icon, '', ['class' => 'form-notification-icon'])
|
||||||
|
. $html;
|
||||||
|
|
||||||
switch ($this->getPlacement()) {
|
switch ($this->getPlacement()) {
|
||||||
case self::APPEND:
|
case self::APPEND:
|
||||||
return $content . $html . '</ul></div>';
|
return $content . $html . '</ul></div>';
|
||||||
|
@ -386,7 +386,17 @@ form.icinga-forms {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form-notifications {
|
.form-notifications {
|
||||||
background-color: fade(@color-ok, 20%);
|
&.info {
|
||||||
|
background-color: fade(@color-ok, 20%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.error {
|
||||||
|
background-color: fade(@color-critical, 30%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
background-color: fade(@color-warning, 40%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-description {
|
.form-description {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user