Navigation Menu

Skip to content

Commit

Permalink
Fix alert styling using "error" instead of "danger".
Browse files Browse the repository at this point in the history
There is no "alert-error" style, only "alert-danger" so rewrite the type
to "danger" for correct styling.

Change-Id: Ie812d5bbbbd84a1e9c6d94876c8726124d4fc4e9
Closes-Bug: 1362943
  • Loading branch information
r1chardj0n3s committed Aug 29, 2014
1 parent 770deb5 commit a62b4a4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions horizon/static/horizon/js/horizon.messages.js
Expand Up @@ -4,16 +4,24 @@ horizon.alert = function (type, message, extra_tags) {
if (typeof(extra_tags) !== "undefined" && $.inArray('safe', extra_tags.split(' ')) !== -1) {
safe = true;
}

var type_display = {
'danger': gettext("Danger: "),
'warning': gettext("Warning: "),
'info': gettext("Notice: "),
'success': gettext("Success: "),
'error': gettext("Error: ")
}[type];

// the "error" type needs to be rewritten as "danger" for correct styling
if (type === 'error') {
type = 'danger';
}

var template = horizon.templates.compiled_templates["#alert_message_template"],
params = {
"type": type,
"type_display": {
'danger': gettext("Danger: "),
'warning': gettext("Warning: "),
'info': gettext("Notice: "),
'success': gettext("Success: "),
'error': gettext("Error: ")
}[type],
"type_display": type_display,
"message": message,
"safe": safe
};
Expand Down

0 comments on commit a62b4a4

Please sign in to comment.