diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-07-03 10:31:54 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-07-07 15:30:41 +0200 |
commit | d0c12fb0c0a892f61a5a6127069737fdab2c107d (patch) | |
tree | 1af99d8e072080cba8229235f6536ddf2325b7a6 /install/ui/src/freeipa/widget.js | |
parent | afe067b1ab9b224080ca05b906e9dfd50c40c59b (diff) | |
download | freeipa-d0c12fb0c0a892f61a5a6127069737fdab2c107d.tar.gz freeipa-d0c12fb0c0a892f61a5a6127069737fdab2c107d.tar.xz freeipa-d0c12fb0c0a892f61a5a6127069737fdab2c107d.zip |
webui: display messages contained in API responses
API responses can contain warnings in "messages" array. This patch
also adds support for displaying multiple notifications at the same
time in order to show the message and a status of finished operation.
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/widget.js')
-rw-r--r-- | install/ui/src/freeipa/widget.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index ae1ada239..780afb2bc 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -5557,12 +5557,18 @@ exp.alert_helper = IPA.alert_helper = { * @param {Object} alert * @return {jQuery} alert as html element */ - render_alert: function(alert) { + render_alert: function(alert, close_icon) { var el = $('<div/>', { 'data-name': alert.name, - 'class': alert.cls + 'class': "fade in " + alert.cls }); + if (close_icon) { + el.addClass('alert-dismissable'); + el.append("<button type=\"button\" class=\"close\" \ + data-dismiss=\"alert\"><span aria-hidden=\"true\">×\ + </span><span class=\"sr-only\">Close</span></button>"); + } $('<span/>', { 'class': alert.icon }).appendTo(el); el.append(' '); el.append(alert.text); |